【问题标题】:Cumulative Maximum, calculate for every parent record累积最大值,计算每个父记录
【发布时间】:2009-06-01 08:11:00
【问题描述】:

有没有人使用过累积最大值 functoid 并注意到性能问题?

摘要
如果要映射字段的最大值,可以使用 functoid 累积最大值。

问题
在我们使用它一段时间后,我们注意到较大文件的性能下降。

检查 xslt 发现每个循环记录都进行了最大值计算...

可以将计算移至祖父,并在自定义 XSL 路径中指出新的 xslt,但我真的很喜欢在映射工具中保留映射的可能性。

有什么建议吗?

亲切的问候
马丁带来

http://martinbring.blogspot.com

【问题讨论】:

  • @Martin,你能编辑一下,让你的问题更明确吗?

标签: map biztalk max


【解决方案1】:

通过删除累积最大值并添加3个脚本functoid,以另一种方式进行计算,问题得到解决。 映射时间减少了 40 倍。

11 Mb,10 000 行,以前在 200 分钟内映射,现在在 5 分钟内映射。

解决方案
一种脚本 functoid,“内联 XSLT 调用模板”,没有输入或输出,包含来自 EXSLT Math library found here 的库的 max() 部分。我没有使用整个库,而是解压缩了文件并“提取”了 max() 模板。

 <xsl:template name="GetMax">
   <xsl:param name="nodes" /> 

    <xsl:choose>
      <xsl:when test="not($nodes)">NaN</xsl:when> 
      <xsl:otherwise>
        <xsl:for-each select="$nodes">
          <xsl:sort data-type="number" order="descending" /> 
          <xsl:if test="position() = 1">
          <xsl:value-of select="number(.)" /> 
        </xsl:if>
       </xsl:for-each>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>

一个脚本 functoid,“内联 XSLT 调用模板”,没有输入或输出,包含一个变量,该变量选择模板上的属性点,并设置要计算的节点

<xsl:variable name="var:MaxValueDate">
    <xsl:call-template name ="GetMax">
            <xsl:with-param name ="nodes" select="Root//Parent/ValueToCalculate" />
    </xsl:call-template>
</xsl:variable>  

一个脚本functoid,带有一个输出的“内联XSLT”,使用变量来填充输出元素的值。

<OutputElement>
        <xsl:value-of select="$var:MaxValueDate" />
</OutputElement>

瞧!

【讨论】:

    猜你喜欢
    • 2019-06-06
    • 2021-10-12
    • 2013-01-22
    • 1970-01-01
    • 2020-05-02
    • 2012-04-19
    • 2020-07-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多