Friday, August 08, 2008

Exploring Activity Relationship in BizTalk BAM

I was exploring and evaluating activity relationship in BizTalk BAM to use the feature for my Client . I have taken a simple scenario, where my BizTalk application send Purchase order to a supplier and receive PO Progress and Invoice (There may be n number of other message related to the PO from the supplier with no patterns). Requirement is to find the status of the each Purchase Order and related activity. It should not affect the existing Client Integration Services


First question in my mind can we tackle the whole scenario as a single activity like PO Process or a muliple activity. But I have the following constraint

  • l There is no pattern in receiving the message from supplier
  • l BizTalk is not handling the business process and it is used only for integration
  • l Orchestrating in a single activity , will consume lot of resource
    
    I need to keep the Orchestration instance live till the whole business process is over, It will directly impact my Disaster Recovery(DR) story
    
    I Should re-think about my capacity management to handle .

So I decided to handle the situation as multiple activity and by tracking the sending and receiving message on each activity (Not handling the business process)

I have created a messaging solution for sending and receiving the PO and Other documents. And track the each message. (The Integration Architecture is more of messaging solution)


Step 1

For tracking the PO and other activity using BAM, I have created the 3 Activity as given below

in the Excel

Activity Name Fields

POACTIVITY ------------------------- POID, PODATE...

INVOICEACTIVITY ------------------------ INVOICEID, POID, INVDATE...

PROGRESSACTIVITY ------------------------ PROGRESSID, POID, PROGRESSDATE...


The POID represent the Purchase Order ID, Which will uniquely represent the purchase Order


Step 2

Create a View will all the three activity (say InvoicePOView) using the excel and deploy to the BizTalk

You will be able to see the view in the BAM Portal as given below










Note: Activity Relationship can be done only within the same view.


Step 3 Tracking Profile – Implementing the Relation ship

For each activity Message Payload has been used for tracking

· POID has been used as the unique key to create Activity relation PO, PO Progress and Invoice

POActivity Tracking
















Invoice Activity Tracking

Right Click on InvoiceActivity, Click on New Relationship and Rename as POActivity
















Progress Activity Tracking

Right Click on InvoiceActivity, Click on New Relationship and Rename as POActivity















Deploy the TPE in BizTalk and test the tracking you can view the result as given below

Views and Results











The Activity Status Page for PO Activity Show as above

The PO (POID: 1000001 have 3 Invoice activities and 2 Progress Activity which are related the PO Activity)
















On click on one of the InvoiceActivity we can find the details of the invoice

I have limited to show the capability of creating relationship using TPE Tool. You can also create relationship using custom code using addrelatedactivty method (refer http://msdn.microsoft.com/en-us/library/microsoft....)