TPE and multiple continuations

Note: This information applies to Tracking Profile Editor in BizTalk Server 2006

For most part now, it seems that creating single continuation [say, between two orchestrations] is a breeze for most developers. The part where TPE is not explicitly clear is the case of multiple continuations. The situation is typical as a BAM activity spans multiple receive ports, orchestrations and send ports. In order to collect the Business Activity Monitoring (BAM) data in one record, one has to setup continuations between all the BizTalk schedules. This turns out to be non trivial through the TPE UI, hence this posting to illustrate the case of multiple continuations.

Let's discuss some special cases. Let me lay out the general terms first. The case of one port OR one orchestration is a special case of many port and many orchestrations scenario. Lets deal with the ramifications of many port and many orchestration scenario. The different ways in which a message can be received and processed by orchestrations presents some interesting challenges and solutions. The scenario consists of a number of receive ports (R), orchestrations (O) and send ports (S). We use interchangeID context property as the glue to bind the continuations. You can, of course, use any other context property, activityID or anything else in place of interchangeID. The choice is immaterial to the problem at hand. I exclude the discussion on the data item/milestone/context-property-value being tracked from these ports and orchestrations. You would do that part of the mapping as per your business logic. Our target is to capture all BAM data from all the ports and orchestrations in a single row in the completed activity table .

A message arrives at exactly one of the R receive ports and gets processed by exactly one of O orchestrations. In this case, you will create a continuation folder on the Left Hand Side (LHS) activity tree view and map the interchangeID context property from the context property schema via "select event source"->"select context property" menu item. Next you will right click on the newly created interchangeID node on the LHS and select the ports to map from. In the select ports dialog box that comes up, select all N receive ports. Next you will create a continuationID folder on the LHS. You will open all O orchestrations, one at a time, and map the interchangeID context property from a shape in the orchestration. The mapping will look something like this:

- OrderProcess
    |- start_milestone
    |- end_milestone
    |- order_amount
    |- order_number
    |- order_item_number
    |- continuationR2O          [the continuation folder]
        |- interchangeID        [port mapping includes all R receive ports]
    |- continuationR2O          [the continuationID folder]
        |- interchangeID        [from O1]
        |- interchangeID        [from O2]
        .    .
        .    .
        |- interchangeID        [from Oo]
           

A message arrives at exactly one of the R receive ports and gets processed by each and every one of O orchestrations. This happens as the message is simultaneously and parallely sent to each of the O orchestrations. In this case, we would need O continuations. The mapping will look something like this:

- OrderProcess
    |- start_milestone
    |- end_milestone
    |- order_amount
    |- order_number
    |- order_item_number
    |- continuationR2O1         [the continuation folder]
        |- interchangeID        [port mapping includes all R receive ports]
    |- continuationR2O1         [the continuationID folder]
        |- interchangeID        [from O1]
    |- continuationR2O2         [the continuation folder]
        |- interchangeID        [port mapping includes all R receive ports]
    |- continuationR2O2         [the continuationID folder]
        |- interchangeID        [from O2]
    .   .     .
    .   .     .
    |- continuationR2Oo         [the continuation folder]
        |- interchangeID        [port mapping includes all R receive ports]
    |- continuationR2Oo         [the continuationID folder]
        |- interchangeID        [from Oo]

Now, let's discuss a CBR scenario. A message arrives at exactly one of the R receive ports and gets sent to exactly one of S send ports. This routing happens based on a context property value in the message. In this case, we would need one continuation. The mapping will look something like this:

- OrderProcess
    |- start_milestone
    |- end_milestone
    |- order_amount
    |- order_number
    |- order_item_number
    |- continuationR2S          [the continuation folder]
        |- interchangeID        [port mapping includes all R receive ports]
    |- continuationR2S          [the continuationID folder]
        |- interchangeID        [port mapping includes all S send ports]

The above mapping will also hold true in the following case. A message arrives at exactly one of the R receive ports and gets sent to all of the S send ports.

A message is processed by exactly one of O orchestrations (we don't know which one will execute at runtime) and is then sent by that orchestration to all the S send ports. In this case, we would need one continuation. The mapping will look something like this:

- OrderProcess
    |- start_milestone
    |- end_milestone
    |- order_amount
    |- order_number
    |- order_item_number
    |- continuationO1S          [the continuation folder]
        |- interchangeID        [from O1]
        |- interchangeID        [from O2]
        .    .
        .    .
        |- interchangeID        [from Oo]
    |- continuationO1S          [the continuationID folder]
        |- interchangeID        [port mapping includes all S receive ports]

A message gets processed by all O orchestrations in sequence, one by one. The mapping will look something like this:

- OrderProcess
    |- start_milestone
    |- end_milestone
    |- order_amount
    |- order_number
    |- order_item_number
    |- continuationO12          [the continuation folder]
        |- interchangeID        [from O1]
    |- continuationO12          [the continuationID folder]
        |- interchangeID        [from O2]
    |- continuationO23          [the continuation folder]
        |- interchangeID        [from O2]
    |- continuationO23          [the continuationID folder]
        |- interchangeID        [from O3]
    .   .     .
    .   .     .
    |- continuationOxO          [the continuation folder]
        |- interchangeID        [from On]
    |- continuationOxO          [the continuationID folder]
        |- interchangeID        [from Oo]