我正在做一个关于在业务流程中捕获验证错误的概念的证明。最终,我们可能希望将它们映射回响应消息。
我创建了一个表达式形状,它调用带有验证的接收管道(如此处所描述的:https://learn.microsoft.com/en-us/biztalk/core/how-to-use-expressions-to-execute-pipelines)。
它位于原子作用域中,它有一个复现处理程序,但没有异常处理程序。管道在验证时爆炸了,并结束了业务流程。我如何捕捉它并查看它生成的数据?最后,我将尝试这个组件,它捕获多个异常:
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
发布于 2018-03-14 00:46:16
将原子作用域(执行PipelineManager所必需的)放在长时间运行作用域(和编排)中,并使用异常处理程序。你根本不需要补偿块。
您应该能够直接捕获XLANGPipelineManagerException,或者仅仅是异常。
https://stackoverflow.com/questions/49265513
复制相似问题