简体   繁体   中英

Catching Exception in Pipeline Validation in BizTalk Orch

I'm doing a proof of concept on catching validation error in an orchestration. Eventually, we might want to map them back to a response message.

I created a expression shape that calls a Receive Pipeline with Validation (as desribed here: https://docs.microsoft.com/en-us/biztalk/core/how-to-use-expressions-to-execute-pipelines ).

It's in an atomic scope, which has a Compenation handler, but no Exception handler. The pipeline blew up on validation, and ended the orchestration. How can I capture this and look at the data it generates? Eventually, I will try this component which catches multiple exceptions:

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

The error was written to the eventlog. The data is wrong, and I want to get an error, but I want to catch it.

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

在此处输入图片说明

Put the Atomic Scope (required to execute the PipelineManager) in a Long Running Scope (and Orchestration) with a Exception Handler . You don't need the Compensation Block at all.

You should be able to catch the XLANGPipelineManagerException directly, or just Exception.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM