BizTalk BAM

BAM View Creation using Relationship with Related Documents

Published on : Aug 11, 2017

Category : BizTalk Server

BizTalk360

Author

Business Activity Monitoring (BAM) is used to monitor a business process through Data and Milestones. The collection of Data and Milestone is Activity and The collection of Each Activity is View. The BAM contains the concept of Continuation and Relationships which used to enhance the relational activity. Relationships are used when the activity definition file contains more than one activity. Imagine an organization takes an order from the customer. For one order request, there may be multiple responses arrive from an organization. The relationship between one order and multiple responses are established using a one CommonID which should be common between two activities.

Create a Visual Studio Project:

1.Create a Simple BizTalk Application in Visual Studio name as “BAMTraningRelation”. 2.Create an “InboundOrder” Schema with below Child field elements to get an order from the customer Creating a BAM view using Relationship with Related Documents 3.Create an “OutboundOrder” Schema with below Child Field Element which is used to send an acknowledgment from the organization. Creating a BAM view using Relationship with Related Documents 4.Generate an Instance by Right clicking the schema for both “InboundOrder” and “OutboundOrder”. Creating a BAM view using Relationship with Related Documents 5.Open the properties window and create a key in Signing and in Deployment provide the Application Name as “BAMTrainingRelation” then save and deploy the project.

Create an Send Port and Receive Port In BizTalk Application:

Open the deployed application“BAMTraningRelation” in BizTalk Server and then follow the below steps to configure the send and receive port. 1.Create a One Way Receive Port and Receive Location. Creating a BAM view using Relationship with Related Documents Creating a BAM view using Relationship with Related Documents 2.Create a One Way Send Port for the created Receive Port and Receive Location by setting the filter for both “InboundSP” and “OutboundSP”. Creating a BAM view using Relationship with Related Documents Creating a BAM view using Relationship with Related Documents

Create a BAM Views:

The creation of activities and Views in Excel sheet is equivalent to designing the container that represents data to the end users. Follow the below steps to create the BAM Views and Activities. 1.Open the Excel and go to File->Option and click the Addins and Select the Business Activity Monitoring. 2.Select the BAM->BAM Activity. Creating a BAM view using Relationship with Related Documents 3.Create a below-mentioned Item in an “InboundOrderActivity”. Creating a BAM view using Relationship with Related Documents 4.Crete another activity as “OutboutOrderActivity” with below-mentioned Item. Creating a BAM view using Relationship with Related Documents 5.Click Ok when the BAM View Creation window opens and select next it will navigate the initial view page as mentioned below. Creating a BAM view using Relationship with Related Documents 6.Select Next and enter the view name and Select the activity as shown below. Creating a BAM view using Relationship with Related Documents In the next window, select the item as shown below. Creating a BAM view using Relationship with Related Documents And click a couple of next and then click ok. Then the BAM Views is created and the user can export the BAM View in XML format by Clicking BAM-> BAM Activity->Export XML. To Deploy the BAM View:
  1. Open the Command prompt as administrator
  2. Navigate to the %BTSInstallPath%/Tracking folder.
  3. Use the below command
bm.exe deploy-all -DefinitionFile:”<<FileLocation>>\BAMTraining.xml”

Configuring tracking Profile Editor for Inbound Order Activity:

Tracking Profile Editor tool is used to bind the data to the port. 1.Go to Start -> Tracking Profile Editor. Creating a BAM view using Relationship with Related Documents 2.Click the “Click here to import a BAM Activity Definition” and then Select the “InboundOderActivity”. Creating a BAM view using Relationship with Related Documents 3.The Activity status window is populated and select the Event Source Creating a BAM view using Relationship with Related Documents
Event source Description
Orchestration Schedule Orchestration Properties
Messaging Payload Deployed Schema Elements
Context Property BizTalk Context Properties
Messaging Property Message/Port Properties
4.Follow the below step to drag and drop the properties from right pane (Event Source) to the left pane (Activity window).
Activity Column Name Event Source Property/element Name Port Name
ActivityID MessagingPayload-> BAMTrainingRelation InboundOrderActivity->OrderID OrderID InboundRP
OrderID MessagingPayload-> BAMTrainingRelation InboundOrderActivity->OrderID OrderID InboundRP
ProductID MessagingPayload-> BAMTrainingRelation InboundOrderActivity->ProductID ProductID InboundRP
XProductName MessagingPayload-> BAMTrainingRelation InboundOrderActivity->ProductName ProductName InboundRP
ShipmentAddress MessagingPayload-> BAMTrainingRelation InboundOrderActivity  ->ShipmentAddress ShipmentAddress InboundRP
RcvPortName ContextProperty-> BTS.ReceivePortName BTS.ReceivePortName InboundRP
RcvdTime Messaging Property-> PortStartTime PortStartTime InboundRP
SendPortName ContextProperty-> BTS.SPName BTS.SPName InboundSP
SendPortTime Messaging Property-> PortEndTime PortEndTime InboundSP

To Insert the Continuation and Document Reference URL For InboundOrderActivity:

1.To Insert Continuation->Right Click the InboundOrderActivity->Select New Continuation and assign InterchangeID form Messaging Property and Right click InterchageID and Select the Send Port Mapping to the InboundRP 2.To Insert ContinuationID->Right Click the InboundOrderActivity-> Select New ContinuationID (Rename as Continuation) and assign InterchangeID form Messaging Property and Right click InterchageID and Select the Send Port Mapping to the InboundSP. 3.To Insert Document Reference URL->Right Click the InboundOrderActivity->Select New Document Reference URL and assign Transmitted file Location form Context Property (select the Messaging tracking. Transmitted File Location) and Right click TransmittedFileLocation and Select the Send Port Mapping to the InboundSP. Creating a BAM view using Relationship with Related Documents After mapping, go to Tools->Click Apply Tracking Profile Editor. Then save the Tracking Profile Editor as “TestInboundRelationTPE.btt”.

Configuring tracking Profile Editor for Outbound Order Activity:

Open a New Tracking Profile Editor and open the OutboundOrderActivity on Left Pane and assign the Values as shown below. Creating a BAM view using Relationship with Related Documents
Activity Column Name Event Source Property/element Name Port Name
ActivityID Messaging Property-> InchangeID InterchangeID OutboundRP
OrderID MessagingPayload-> BAMTrainingRelation OutboundOrderActivity ->XOrderID XOrderID OutboundRP
OrderStatus MessagingPayload-> BAMTrainingRelation OutboundOrderActivity  ->OrderID XOrderStatus OutboundRP
RcvPortName ContextProperty -> BTS.ReceivePortName BTS.ReceivePortName OutboundRP
RcvdTime Messaging Property-> PortStartTime PortStartTime OutboundRP
SendPortName ContextProperty->        BTS.SPName BTS.SPName OutboundSP
SendPortTime Messaging Property->  PortEndTime PortEndTime OutboundSP
InboundOrder Activty MessagingPayload-> BAMTrainingRelation OutboundOrderActivity ->XOrderID XOrderID OutboundRP

To Insert the Continuation and Document Reference URL For InboundOrderActivity:

1.To Insert Continuation->Right Click the OutboundOrderActivity->Select New Continuation and assign InterchangeID form Messaging Property and Right click InterchageID and Select the Send Port Mapping to the OutboundRP 2.To Insert ContinuationID->Right Click the OutboundOrderActivity-> Select New ContinuationID (Rename as Continuation) and assign InterchangeID form Messaging Property and Right click InterchageID and Select the Send Port Mapping to the OutboundSP. 3.To Insert Document Reference URL->Right Click the OutboundOrderActivity->Select New Document Reference URL and assign Transmitted File Location Form Context Property (select the Messaging tracking. Transmitted File Location) and Right click TransmittedFileLocation and Select the Send Port Mapping to the OutboundSP. Creating a BAM view using Relationship with Related Documents After mapping, go to Tools->Click Apply Tracking Profile Editor. Then save the Tracking Profile Editor as “TestOutboundRelationTPE.btt”.

To populate Data In BAM For InboundOrderActivity:

1.Edit The Generated instance file “InboundOrder” as shown below.
&lt;ns0:Inbound xmlns:ns0="http://BAMTrainingRelation.IndoundOrder"&gt;
  &lt;OrderID&gt;OID5&lt;/OrderID&gt;
  &lt;ProductName&gt;Departmental Store&lt;/ProductName&gt;
  &lt;ProductId&gt;PId5&lt;/ProductId&gt;
  &lt;ShipmentAddress&gt;India&lt;/ShipmentAddress&gt;
&lt;/ns0:Inbound&gt;
2.Transfer the generated instance file “InboundOrder” to InboundRP file location and “OutboundOder” to OutboundRP wheatear the output is transferred to the “InboundSP” and “OutboundSP” file Location. 3.Goto BAM Portal and Select the “InboundOrderActivity” and Execute the Query and the result will be shown below Creating a BAM view using Relationship with Related Documents 4.Click the Result which navigates to Activity status window will contain the Related Documents and Related Activities.The related documents will show the document URL at the bottom of the page. Creating a BAM view using Relationship with Related Documents 5.Click the Outbound Activity will navigate to the OutboundOrderActivity status window received for the OrderId “ODID7” as shown below. Creating a BAM view using Relationship with Related Documents Note: The more status can be received for the same orderID and the user can create one or more Related Documents for the Activity.