遍历BizTalk中的脚本功能 [英] Looping over a scripting functoid in BizTalk
问题描述
我有一个字符串值列表,例如'123','456','789'
等.这个列表可能很长,只有几千个项目.因此,我必须将其分成最大块. 750个项目.
一个想法是编写一个自己的functoid,将其分解并返回一个可循环的列表.也许它会更容易一些,我可以直接在脚本functoid中完成它.但是我收到消息
I've got a list of string values like '123','456','789'
and so on. This list can be very long with a few thousand items. So I have to split it in blocks of max. 750 items.
One idea is to write an own functoid which split in and returns a loopable list. Maybe it is a little bit easier and i could do it direcly in a scripting functoid. But I get the message
`error btm1090: The "Looping" functoid has place holders. Replace these with appropriate links or constants.`
所以我认为这是不可能的.是否有可能在脚本功能中执行此操作?我是否需要自己的功能?
So I don't think that this is possible. Is there a possibility to do it in a Scripting functoid or do I need my own functoid?
一方面,我需要分割后的值来创建多条结果行(通过循环),但每一行中的值本身也是如此.
I need the splitted values on the one hand to create multiple results lines (by looping) but also the value itself in each line.
谢谢.
推荐答案
我将使用其他方法.与其尝试在Xsl中不做受限循环(这很困难),不如在C#函数中生成所有Xml,这非常容易.
I would use a different approach. Instead of trying to do a restricted loop in Xsl, which is hard, I would generate all the Xml in a C# function, which is pretty easy.
第1步,编写一些C#来创建所需的Xml输出:
Step 1, write some C# that create the Xml output you need:
<LineValue>'1','2','3',...,'749','750'</LineValue>
<LineValue>'751','752','753',...,'1499','1500'</LineValue>
<LineValue>'1501','1502','1503',...,'2249','2250'</LineValue>
通常首选外部程序集,但内联也可以.但是,真的没关系,只需将此Xml作为字符串返回即可.
An External Assembly is generally preferred but inline works just as well. But, it really doesn't matter, just return this Xml as a string.
第2步,您唯一需要做的窍门"是将C#输出通过Xslt模板传递,以便将其视为Xml,而不是字符串内容.
Step 2, the only 'trick' you need is to pass the C# output through a Xslt Template so it's treated as Xml, not String content.
<xsl:template name="MyXsltConcatTemplate">
<xsl:param name="param1" />
<xsl:element name="field">
<xsl:value-of select="$param1" disable-output-escaping="yes" />
</xsl:element>
</xsl:template>
disable-output-escaping ="yes" 是使这项工作有效的原因.
disable-output-escaping="yes" is what makes this work.
这篇关于遍历BizTalk中的脚本功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!