カスタマー サービス オーケストレーション (CustomerService) のインライン バージョンは、支払い追跡システムを直接呼び出します。 送信されたメッセージを準備し、受信したメッセージを処理するために、オーケストレーションはコードからパイプラインを呼び出します。 これにより、他のシナリオ バージョンのパイプラインを再利用できます。 また、パイプライン ステージからのオーケストレーションの分離も維持されます。
パイプラインの呼び出し
コードからパイプラインを使用するには、メッセージ コレクションを作成し、処理するメッセージをコレクションに追加し、結果メッセージを受信する空のメッセージを作成してパイプラインを呼び出す必要があります。
CustomerService オーケストレーションの次のコードは、ConstructRequestMessageAfterSendPipeline 構造にあります。
// Create the collection of messages to be sent to the send pipeline...
sendPipelineInputMessages =
new Microsoft.XLANGs.Pipeline.SendPipelineInputMessages();
sendPipelineInputMessages.Add(LastPaymentRequest);
// Create an empty message for the output from the pipeline...
LastPaymentRequestAfterSendPipeline = null;
// Execute the send pipeline and get the message output from
// the send pipeline.
Microsoft.XLANGs.Pipeline.XLANGPipelineManager.
ExecuteSendPipeline(
typeof(
Microsoft.Samples.BizTalk.
WoodgroveBank.PaymentTrackerPipelines.
PaymentTrackerSendPipeline
),
sendPipelineInputMessages,
LastPaymentRequestAfterSendPipeline
);
GetLastPaymentResponse 図形は、上記のコードからメッセージを受け取り、それを支払い追跡システムに送信し、返されたメッセージを受信パイプラインを介して処理します。
// Execute the inline method to send the message to the
// Payment Tracking System and get the response.
// The response message received should be passed through the
// receive pipeline.
LastPaymentResponseBeforeReceivePipeline =
Microsoft.Samples.BizTalk.
WoodgroveBank.
PaymentTrackerCall.
PaymentTrackerCaller.
GetPaymeTrackerResponse
(
LastPaymentRequestAfterSendPipeline
);
// Execute the receive pipeline using the helper class so that we don't
// need to declare the non-serializable types involved.
// Set the documentspec name so the xml disassembler in the
// pipeline can resolve the schemas for the received message
// without ambiguity.
LastPaymentResponseBeforeReceivePipeline(XMLNORM.DocumentSpecName) =
"Microsoft.Samples.BizTalk.WoodgroveBank.Schemas.LastPaymentResponse, Microsoft.Samples.BizTalk.WoodgroveBank.Schemas, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5f57a322d27bc5fb";
// Create an empty response message and fill it in with the
// real response from the Payment Tracking System
LastPaymentResponse = null;
Microsoft.Samples.BizTalk.WoodgroveBank.Utilities.
ReceivePipelineHelper.CallReceivePipeLine (
typeof(
Microsoft.Samples.BizTalk.WoodgroveBank.
PaymentTrackerPipelines.PaymentTrackerReceivePipeline
),
LastPaymentResponseBeforeReceivePipeline,
LastPaymentResponse
);