In traditional transactions, because the work is atomic, a transaction either fully commits or is rolled back to a consistent state. Typically, an exception within the transaction itself will cause a rollback. Of course, exceptions are not limited to ACID transactions. Long-running transactions can also raise exceptions but in addition, special business exceptions might also be encountered.
Consider what might happen in the event that a long-running transaction consists of more than one discrete unit of work. It is very common to have a transaction that is long-running contain multiple scopes that are atomic.
Revisiting the airline booking system scenario, the transaction authorizes the customer's credit card as soon as the dubious seat choices are made. The process of charging the customer's credit card is atomic—it either completes or is aborted. This degree of control over process is not optional due to the financial nature of the activity. So what happens when the poor customer's seat is oversold? In addition to increased blood pressure and the probable exchange of expletives, the booking system must reverse the credit card charges and perhaps allocate a certain amount of points to the customer's rewards account. Think of this situation as a special type of business exception that must be addressed and the transaction that booked and charged the customer's credit card must be compensated, or "backed-out". Thus, an orchestration can define a compensating action for the billing authorization that performs the exact opposite of the authorization and effectively reverses it. The compensation (manually) cancels out the initial charge. Note, however, that the debiting (within the original authorization), and then crediting (during conditional compensation) of the fare and fees occur as two discrete atomic transactions within the root long-running transaction.
Compensation is a critical concept for providing pseudo-atomicity of a transaction. While with classic transactions, atomicity is essentially free, transactions that are long-running require extra effort by means of compensation to retain similar characteristics.
Overview of the VS 2005 BizTalk Project System
The BizTalk Project System provides the tools necessary to design, build, and deploy BizTalk Server 2006 solutions within the Visual Studio 2005 IDE:
|Service Orientation has evolved far past RPC-style services in which a caller asks a component to do some simple work and expects a quick and trivial response.|
- The BizTalk Schema Editor provides feature-rich functionality for authoring and maintaining XSD schema.
- The BizTalk Mapper allows source XML messages to be mapped to target XML messages based on XSD schema.
- The Orchestration Designer, the primary tool used to create orchestrations, offers a rich design surface for modeling workflow.
- Finally, the Pipeline Designer provides the ability to create custom pipelines when you require more control over the receiving or sending of messages.
I won't spend too much time describing these tools here but instead will provide a general orientation of a BizTalk project and important shapes.
Exploring a BizTalk Project
|Figure 4. BizTalk Project Template: A BizTalk project is just another project template within the Visual Studio 2005 project system (courtesy of the Microsoft BizTalk Server 2006 documentation team).|
Because BizTalk projects are fully integrated into Visual Studio 2005, the environment is intimately familiar. A BizTalk project is separated into four main panes: The BizTalk Explorer, BizTalk Type Browser, the Properties window, and the design surface. These correspond to either the Orchestration Designer, BizTalk Mapper, or Pipeline Designer. Figure 4
shows how to select a BizTalk project from the New Project dialog box along with the respective panes of interest.
While BizTalk Mapper and Pipeline Designer are full-length topics themselves, for the purpose of this article I will focus exclusively on the Orchestration Designer, as it is the most important tool for building BizTalk solutions.
When you add an orchestration item template and click on the .odx file, the Orchestration Designer sets the entire focus of the IDE to facilitate the creation and management of orchestrations. The Orchestration View tab provides a tree view of various item groups including variables and messages. This allows the developer to create variables and messages and associate them with a .NET type or XSD schema as well as set the various properties for each in the common Properties window.
On the left side, the BizTalk Orchestration Toolbox provides a selection of shapes that you can drag and drop on the Design Surface, which is flanked by two Port Surfaces (used for creating logical ports). Figure 5 provides a screenshot of the Orchestration Designer.
|Figure 5. Orchestration Designer: The Orchestration Designer is composed of the BizTalk Orchestration Toolbox, Orchestration Design Surface, and Orchestration View (courtesy of the Microsoft BizTalk Server 2006 documentation team).||
|Figure 6. Orchestration Shapes: The figure shows some common orchestration shapes (courtesy of the Microsoft BizTalk Server 2006 documentation team).||
, borrowed from the product documentation, provides a list of common orchestration shapes used to create an orchestration. I will use several of these shapes during the implementation of the EAI solution.
The Big Picture and Beyond
As with any new tool, the various concepts, components, and tools can at first seem a bit overwhelming, and a server platform of the magnitude of BizTalk Server 2006 is no exception. Often, it is difficult to understand how all the pieces fit together until you actually put them into practice. This is precisely what I'll show you how to do in Part 2 of this article. Until then, I would encourage those new to BizTalk Server to install BizTalk Server 2006 (see the sidebar "Installing BizTalk Server 2006
" for free trial information) and experiment with the BizTalk Project template in Visual Studio 2005. Bringing some familiarity with the Orchestration Designer, including the various shapes and corresponding properties, to the hands-on exercises in Part 2 will give you a great advantage and help you hit the ground running.
As an information technology professional, you no doubt encounter application integration all the time (whether consciously or not). EAI is by no means esoteric—application integration is everywhere.
Moreover, business process automation is gaining more and more traction and will continue to gain popularity as tools evolve. Mature platforms such as BizTalk Server and new technologies such as Windows Workflow Foundation (WF) will continue to drive innovation not only in the EAI space but will change how we think of designing business rules in software (see sidebar, "Getting the Big Picture" for more perspective on the relevance of workflow in moderns software engineering).
BizTalk Server 2006 is a very practical solution for addressing many of the EAI chores that are prevalent within organizations today. In this overview, I demonstrated how BizTalk Server goes far beyond messaging and provides a viable solution for addressing the integration spaghetti that exists as a result of the evolution of new and existing investments in enterprise software.
In addition to a very solid Messaging Engine, the Orchestration Engine is a very flexible approach to getting the most out of messaging while naturally supporting the implementation of complex business process via intuitive and easy-to-use graphical workflows. For more information, see the "Additional Reading" sidebar.
.....stay tuned for Part 2