在BizTalk Orch中管道验证中捕获异常

时间:2018-03-13 20:42:29

标签: biztalk pipeline biztalk-orchestrations

我正在做一个关于在业务流程中捕获验证错误的概念证明。最终,我们可能希望将它们映射回响应消息。

我创建了一个表达式形状,它调用带验证的接收管道(如下所示:https://docs.microsoft.com/en-us/biztalk/core/how-to-use-expressions-to-execute-pipelines)。

它位于原子范围内,具有Compenation处理程序,但没有Exception处理程序。管道在验证时爆炸,并结束了编排。如何捕获它并查看它生成的数据?最后,我将尝试这个捕获多个例外的组件:

rcvPipelineOutputMsgs1 = 
 Microsoft.XLANGs.Pipeline.XLANGPipelineManager.ExecuteReceivePipeline
(typeof(Myapp.Pipelines.ValidateAtlastRequestPipeline), msg_In);

错误已写入事件日志。数据是错误的,我想得到一个错误,但我想抓住它。

Shape name: Call Validation
ShapeId: efe2529a-acaa-416b-ad8e-c3faef9624c5
Exception thrown from: segment 2, progress 3
Inner exception: There was a failure executing pipeline "Myapp.Pipelines.ValidateAtlastRequestPipeline". Error details: "The XML Validator failed to validate.
Details: The element 'LtlTenderRequest' has invalid child element 'DocumentName'. List of possible elements expected: 'Tenders'.. ".

Exception type: XLANGPipelineManagerException

enter image description here

1 个答案:

答案 0 :(得分:1)

使用异常处理程序将原子范围(执行PipelineManager所需)放在长期运行范围(和业务流程)中。您根本不需要补偿区块。

您应该能够直接捕获XLANGPipelineManagerException,或者只是异常。