Thursday 7 July 2016

Build Simple Orchestration Process in BizTalk | Basic Concepts - Part 4


BizTalk Orchestration
An orchestration is the executable implementation of a business process, that is, a logical and chronological set of activities in order to achieve a goal. 

Orchestrations are executed by the BizTalk orchestration engine which manages the life cycle of the orchestrations such as instantiate execution, termination and migration across host instances as well as schedule and monitor the interaction with external entities. The BizTalk engine consists technically by a set of SQL Server databases with stored procedures and jobs running on the MessageBox database and Management database as well as a set of managed assemblies which run within BizTalk host instances. XLANG is the main language use to specify and execute the workflows. Orchestrations are tied to the MessageBox database which receives messages from receive ports and dispatch messages through the send ports. 

Orchestration Designer is a visual tool for creating orchestrations. It provides several shapes that you can place on the design surface as visual representations of underlying actions, and they can help you to efficiently design and implement an orchestration. 

The Orchestration Designer has been divided in three sections: two port surfaces and an -orchestration flowchart area. You have also a Toolbox window with orchestration shapes and the Orchestration View window. You can drag-and-drop various toolbox shapes onto the flowchart area. 

Getting started with an example, I would build orchestration process by re-using the schema and map which we define in our earlier articles. 
  • Create a new BizTalk project by clicking File|New|Project, selecting the BizTalk Project node in the Project Types tree, and entering the name BizTalkDJ.BasicsConcepts. 
  • Create an orchestration by clicking Project|Add New Item and enter the name as BusinessProcess 
  • Let's define the simple business process, as an illustrative example, this process is straightforward. 
  • An Order Request document is received, and then order transformed and then sent to the Warehouse system. 
  • Add a Receive shape, Transform and a Send shape to canvas as shown 


  • We already have the schemas and Map, right-click on the Messages node in the Orchestration View window in the Orchestration Designer and select New Message, go to the Property window and set Identifier to orderReqMsg and MessageType to the created InboundRequest schema. Create another “outboundMsg” message by repeating the same steps and choose MessageType as OutboundFormat. 


  • Now, let's configure the shapes. Click on the Receive shape and go to the Property windows and set the name to RcvMsg, Activate to True. 
  • Double click on the Transform shape and in Transformation Configuration page, choose existing Map and then select the orderRequest and Outbound Message as Source and Destination respectively.

  • Let us add and configure the ports which are the communication channels between the orchestration and external systems. 
  • Right-click over the Port Surface and select New Port. Then right-click on the newly created port and select Configure Port. Enter the name: OrderRequestPort and click Next, in the Select a Port Type as 
  • One-Way Communication and set Restriction Type as Internal and click on Next. 
  • In the Port Binding page, select as shown, click Next and finish the wizard. 


  • Similar to logical Receive Port, create the Send Port, but in the Port Binding page set the Port Direction option to I'll always be sending messages on this port. 
  • Drag and drop the green icon on the left side of the Port to the green icon on the Receive shape to create a link from the logical item in the orchestration to the physical world and similarly configure the send port as well. 

Deploying and Configuration Application
BizTalk orchestrations and the underlying artifacts such as xsd schemas, mappings and pipelines are hosted in .NET assemblies, and they should be visible to BizTalk engine, thus the assemblies generated for BizTalk must be deployed into the Global Assembly Cache (GAC). Before an assembly is deployed into the GAC, it must have a strong name which helps the .NET Framework uniquely identify assemblies in the GAC. 

Right click on the BizTalk Solution and specify the snk and Application Name (BizTalkDJ.Concepts) then deploy the application. 
Go to BizTalk Admin Console, then drill down to our BizTalkDJ.Concepts Application and then right click and choose configure.



  • Create the Receive Port and associated location 
  • Create and configure Send Port. 
  • Once you have created all the necessary ports for the input and outputs of your physical messages, it is time to bind them to the orchestration. 
  • Click on the orchestration then change the Host setting to BiztalkServerApplication and bind the logical and physical ports 
Start the application and test the solution by copying an XML document with structure defined by the schema inside the input folder and wait the response of the process in the output folders. 

Conclusion
In this article, I covered principles of the orchestrations as well as I illustrated how to develop an orchestration and host in BizTalk Admin Console. 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.