Sequential convoy using listen shape in biztalk example

What is Sequential Convoy in BizTalk ?
A sequential convoy enables multiple single messages to join together to achieve a required result. A sequential convoy is a set of related messages that have a predefined order. Although the messages do not have to be exactly the same, BizTalk Server must receive them in a sequential order.

Listen Shape in BizTalk Example -:
Listen shape in BizTalk is the most powerful shape available in Orchestration developer toolbox. It can be used in many design patterns for BizTalk Soluton. Listen shape listens for some event to take place in its every branch. Suppose there are 3 branches in Listen shape and an event on 2nd branch takes place then all other branches would get terminated.

Sequential Convoy using Listen Shape 
I am going to demonstrate a sequential convoy using listen shape.
Suppose we have a file for Purchase order (PO) and a second file for Customer detail for that particular PO. We have to concatenate these two files and send it further.

Schema for 1st File i.e PO :

Since we are using Sequential convoy we need to define a correlation set and type. Therefore I have promoted the PONo field in both the schema.

Schema for 2nd File i.e Customer Details :

Destination Schema :

Orchestration goes like this :

In Orchestration I have used a Uniform Sequential convoy which means that the Orchestration can receive messages from same logical Orchestration port. There are two receive shapes in Orchestration where the 1st receive shape initializes the correlation set and is marked activating. The 2nd receive shape follows the correlation set. The only thing that we need to take care is that ordered delivery property of the receive port must to true.
First branch of Listen shape contain receive shape and transform shape. When Orchestration receives the PO file, the orchestration becomes dehydrate and waits for the 2nd file i.e customer file to arrive. If the file comes before the time specified in the delay shape then the first branch of listen shape executes otherwise second branch of expression shape executes.

Map :

Input Files :

PO file :

<ns0:PO xmlns:ns0="http://Working_With_ListenShape.SourceSch">

Customer file :

<ns0:Customer xmlns:ns0="http://Working_With_ListenShape.SourceSch1">

Output :

Case 1 : When 2nd file arrives before the time specified in delay shape.

Case 2 : When event on Delay branch happens then output in Debug View :

Note: Original post by Rahul Madaan from biztalkvillage

No comments:

Post a Comment