|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article
IntroductionThis article shows how BizTalk can be used to Automate workflows which do not require Human intervention. A Message can be routed to various users, based just on business logic. This is similar to a state machine wherein a system moves through several states/stages based on external inputs/stimuli. For user oriented workflows, BizTalk Human Workflow Services (HWS) can be used. Purchase Order (PO) - WorkflowConsider a scenario where a Purchase Order (PO) request needs to be approved by various people in an organization, before it can sent to the procurement department. Lets consider three roles in an organization, where the PO Workflow happens. A Clerk, Supervisor and a Manager.
Various <STATES> in the PO Workflow
The Purchase Order (PO) - Schema
The PO schema has the following elements
The Purchase Order Workflow - Orchestrations"CREATE" message - Business ProcessThis Orchestration sets the status of the incoming message from "CREATE" to "LEVEL_0". The SendPort is bound directly to the message box and hence it automatically triggers a Clerk Orchestration which is filtered on "LEVEL_0" status messages. Clerk - Business Process
This Orchestration sets the POOut = POIn; POOut(POWorkflow.PropertySchema.POStatus) = "LEVEL_1"; POOut(POWorkflow.PropertySchema.POAuthorize) = "CLERK"; POOut(POWorkflow.PropertySchema.POComments) = "Supervisor! Please approve this PO."; If the POOut = POIn; POOut(POWorkflow.PropertySchema.POStatus) = "LEVEL_1"; POOut(POWorkflow.PropertySchema.POAuthorize) = "CLERK"; // The quantity is set 99, so as to get Approval from Manager. POOut(POWorkflow.PropertySchema.POQty) = 99; POOut(POWorkflow.PropertySchema.POComments) = "The quantity is set 99, so as to get Approval from Manager"; The Receive Port and Send Port is bound directly to the message box and hence it automatically triggers a Supervisor orchestration which is filtered on "LEVEL_1" status messages. Supervisor - Business Process
This Orchestration sets the POOut = POIn; // Send the message to Manager for Approval. POOut(POWorkflow.PropertySchema.POStatus) = "LEVEL_2"; POOut(POWorkflow.PropertySchema.POAuthorize) = "SUPERVISOR"; POOut(POWorkflow.PropertySchema.POComments) = "Manager, please approve this PO."; The ReceivePort and SendPort is bound directly to the message box and hence it automatically triggers a Manager/Clerk Orchestration. Manager - Business Process
This Orchestration sets the POOut = POIn; POOut(POWorkflow.PropertySchema.POStatus) = "REJECTED"; POOut(POWorkflow.PropertySchema.POAuthorize) = "MANAGER"; POOut(POWorkflow.PropertySchema.POComments) = "Rejected due to cost overrun."; The Filter ExpressionThe "Filter Expression" property in the "Receive" shape in every orchestration ensures that only messages which are intended to be processed arrive in the orchestration. Clerk Orchestration - Filter Expression (POWorkflow.PropertySchema.POStatus == "LEVEL_0") Supervisor Orchestration - Filter Expression (POWorkflow.PropertySchema.POStatus == "LEVEL_1") Manager Orchestration - Filter Expression (POWorkflow.PropertySchema.POStatus == "LEVEL_2") Executing the DEMOInput File
Notice the input file data. The Event Viewer
The Event Viewer shows the various logged messages during the routing of the BizTalk Explorer
Notice the Send and Receive Ports in the BizTalk Explorer. Output File
The final approved output file generated after the "MANAGER" approves the About the Downloadable Code
Some Takeaways
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||