Like its predecessor, BizTalk Server 2006 supports several features that make it easier to build and deploy applications that involve complex workflows or process orchestration. To take advantage of these features, you'll first want to understand the basics of orchestrations in BizTalk. Orchestrations in BizTalk are representations of an executable business processes. You create visual representations of your business processes using the BizTalk Orchestration Designer tool, which lets you design workflows, transform data, invoke custom code, and organize all these actions. These visual representations are then compiled into an executable moduleautomatically reflecting your visual representation in underlying code. The designer provides a variety of shapes that correspond to different actions that you might want to perform with your business process or systems integration workflow.
There are some important components of orchestration that you need to know about. Messages, the send and receive actions that perform message operations, and the ports through which messages are transported are all elements of an orchestration. The message is the medium through which orchestrations communicate. Receive and Send shapes encapsulate the functionality you need to receive messages in your orchestration and send messages from it. You need to become familiar with the various shapes that the Orchestration Designer provides to represent the logical flow of your orchestration. By defining message types, ports, port types, and operations in a standard way, based on Web services, disparate systems can communicate with each other.
Other important orchestration concepts include correlations and transactions. Correlation is a mechanism that associates messages with specific running instances of an orchestration, so that your business processes gets the appropriate information when many instances are running and many messages are being transmitted. Transactions let you maintain the state of an orchestration appropriately if any unexpected issues arise. BizTalk's orchestration designer includes exception-handling support, letting you deal with errors in a controlled manner.
With the basics of orchestrations defined, you can now proceed with creating one in BizTalk and implementing your Web service.
Creating an Orchestration
Getting started with orchestrations in BizTalk is simple. First, you create a project in Visual Studio 2005. You select one of the BizTalk project types, and start with an empty BizTalk project. From there, you right click on the project and select the option to add new items to the project. You can add Orchestration Files to the project from the BizTalk Project Items menu. At this point, you should see an Orchestration design surface similar to that in Figure 1.
|Figure 1. Orchestration Design Surface: The figure shows the orchestration design surface in Biztalk 2006 where you can drag and drop orchestration shapes.||
|Figure 2: Port Configuration Wizard: Right-clicking on a port object launches this configuration wizard.|
With this surface in place, you can view shapes in the toolbox from within the Visual Studio environment and start building the orchestration. To get started, add a Receive shape, a Send shape, and a port to receive a request and send a response. You'll also want a port to receive a message for file mapping. To configure the port for Web service binding, right-click on the port. That will start a wizard as shown in Figure 2
. In this wizard, you'll be asked to create a new port type (or specify an existing type) and create a binding for that port. In this case, you'll bind the receive port to the SOAP service provided by the Web service you created earlier by entering the URI for the Web service and specifying the transport type. Because invoking the Web service requires a request-and-response communication pattern, select that communication pattern when configuring the port.
With the Web service wired up to the orchestration, your design surface should be similar to that shown in Figure 3. Now you can build the solution to ensure that your messages are correctly configured and that your Web services bindings are correct. With the Web service configured in the orchestration, you can use the results in a variety of ways. For example, you might pass the message results on to another port. The sample project serializes the message and stores it as an XML file on the file system using a file as the transport type and a file location. Figure 4 shows a message transform added to the orchestration.
|Figure 3. Orchestration Designer: The figure shows how the orchestration design surface should look after wiring up the Web service to your orchestration.||
|Figure 4. Message Transform: The figure shows the orchestration after adding a message transform.|
You'd use a message transform to configure a transformation of the message based on a pre-defined or custom mapping. For example, you can use one to map an XML file to a flat-file format or to modify data in the file based on rules or custom logic (e.g. currency conversion).
Leveraging Web Services in BizTalk Orchestrations
The BizTalk Server 2006 upgrade includes a variety of capabilities, but the Web services support for SOAP arrays and easy integration into BizTalk orchestrations is one of the more useful features. When you consider the fact that there are a host of new BizTalk adapters, including the POP3 adapter, an officially supported SharePoint adapter, and a number of adapters for third-party applications including Oracle Application Suite, Siebel and PeopleSoft the benefits of using Web services in orchestrations are obvious.
BizTalk Server 2006 also supports pipeline adapters with the next version of Commerce Server, slated for release next year. This will include adapters to support integration with Commerce Server orders, profiles, and inventory data with bi-directional functionality to enable integration with trading partner sites or with ERP systems integrated with BizTalk. Combined with BizTalk Server's Web services publishing wizard, which lets you expose orchestrations as Web services that can be invoked externally, the power of Web services in BizTalk is growing.
While BizTalk isn't as commonly used as .NET by Windows developers, it provides a powerful set of features to support common scenarios for application integration, workflow and process management. Although it can be simpler and more straightforward to publish a Web service using Visual Studio, implementing Web services in BizTalk lets you change the processes where Web services are employed dynamically. Simply put, BizTalk makes complex software for integration more agile than custom code.