This example shows how to design a business process to use the Assign activity to set default data for process probes. Setting default data in the business process helps to resolve a potential tracking issue with the tracking message after it is delivered to the BizTracker component.
At runtime, empty elements are automatically created for probe messages with elements that do not have values. If you define an element to be included in the probe message that does not contain data as its value, an empty element is automatically created when the probe message is created. Therefore, if you are using the empty element value to update an object SetType in BizTracker, the object cannot be updated because there is no value.
Empty elements can also be problematic if your business process uses two notifications and you want to monitor the messages using an object SetType. When the first notification is received, the elements that are to be populated by the second notification do not contain data and empty elements are automatically created.
The following set of explanations and screen captures show the before and after design of a business process to set default data.
This business process:
Receives a single notification, MyGetService.
MyGetService receives an OrderRequest message that contains elements that include OrderNumber, AccountInfo, and LineItem. It defines a Write to Probe property that sends a probe message to MyProbe.
View the original business process
Maps information from the notifications to create a response message. A process probe is defined to send a probe message containing Account, DeliverDate, and OrderStatus elements to MyProbe. OrderStatus in the probe references MySendService, the messaging service to send a response message.
View the original process probe definition
Sends the response message to a target system using MySendService.
The business process fires when the notification message is received, however, the probe message that is created contains empty elements because the map has not yet populated the MySendService context variable.
A redesign of the business process uses an assign activity to provide default values for the elements that are to be completed by information from the second notification message.
View the redesigned business process
The redesigned business process:
Adds a context variable to the business process. The context variable, Status, has the value InProgress by default. (In the original business process, the MySendService/OrderResponse/Status element was empty, causing tracking problems for the object SetType.)
View context variable definition for redesigned business process
Creates an Assign activity to:
Set the source by creating a Literal with a value of GetComplete.
View the literal definition for assign activity
Set the target using a context reference with the context variable, Status.
Adds the Assign activity to the business process flow.
View business process with Assign activity
Defines the probe to send a message at the Assign activity and to point to the Status context variable.
View revised probe definitiion at Assign activity
Removes the probe definition for MyGetService
View probe redefiniton for MyGet Service