问题描述
我有一个带有双向发送端口的业务流程,用于从数据库中检索一个或多个项目.我使用WCF-SQL适配器,并成功地将传入的结果分批发送到单独的StoredProcedureResultSet0消息中.但是,编排仅处理一条消息并结束.
接收流程是否有办法在结束之前循环返回的消息?
我现在收到有关未处理消息的错误消息:
我知道有些人已经从业务流程内部使用管道启动了分批处理.我认为最好在离源头尽可能近的地方进行分批处理.
想法?
最终的解决方案是直接在接收管道中进行分批处理.在Orchestration中使用XPath会带来性能风险,而使用相关集(如@Dijkgraaf已回答)也会带来风险.
但是,尝试实施选择的解决方案时,我跳入了以下问题:
如果存储过程没有返回结果,则XMLReceive管道无法对消息进行分批处理.这是因为,如果没有返回任何行,则WCF-SQL适配器会忽略结果元素,并且分批处理(Body XPath)要求该元素存在.另外,即使使用XPath函数count()没有结果,也尝试使Body XPath正常工作,但是BizTalk不允许复杂"的XPath表达式(错误消息,找不到参考).因此,我必须开发一个接收解码自定义管道组件,以在缺少元素时添加该元素.然后XML Disassmebler工作并使用消息,即使element为空.
I have an orchestration with a two-way send port to retreive one or many items from a database. I use WCF-SQL adapter, and successfully managed to debatch incoming result into separate StoredProcedureResultSet0 messages. However, orchestration only processes one message and ends.
Is there a way for the receiving orchestration to loop over returned messages before ending?
Error message I receive now for the unprocessed messages:
I am aware that some people have initiated debatching using pipeline from within the orchestration. I thought that it would be preferable to debatching as close to the source as possible.
Ideas?
Final solution was to do debatching directly in receiving pipeline. Using XPath in Orchestration have performance risks, and using correlation sets, like @Dijkgraaf answered, also comes with risks.
However, trying to implement choosen solution, I bounced into the following problem:
XMLReceive pipeline failed to debatch message if there were no results returned from the stored procedure. This is because WCF-SQL adapter omits the resulting element if no rows are returned, and debatching (Body XPath) requires it to exist. Also, tried to have the Body XPath to work even if there was no results using XPath function count(), but BizTalk does not allow "complex" XPath expressions (given by error message, no reference found).
So, I had to develop a receive decode custom pipeline component to add the element if missing. Then XML Disassmebler works and consumes the message even if element is empty.
这篇关于BizTalk Orchestration从XML接收多个消息从双向发送端口接收管道吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!