While many XML-based messaging servers offer the ability to transport and track XML messages in and out of systems, no application that can create and describe the processing flow a document must go through from start to finish exists. Enter BizTalk Orchestration Designer. This application, shown in Figure 15-6, allows you to drag and drop the necessary flowchart items to define a business process and then connect them to the implementation components used in processing the data.
Figure 15-6 The BizTalk Orchestration Designer.
Figure 15-6 shows you a visual representation of how these items are tied together, but as technologists we are sure you want to know and understand what is happening in the background. Behind the scenes, and after you have described your business process and its relationship to processing components, the Orchestration Designer creates an XLANG schedule. This schedule, which is saved with an .skx extension, is run by the XLANG Scheduler Engine, which controls the activation, execution, dehydration, and rehydration of the XLANG schedule. In other words, it handles the execution of the schedule details.
The functionality of the Orchestration Designer can be broken down into three areas. These are as follows:
To help you understand these items we are going to step through parts of an example, which will also familiarize you with the tool. This example will use the Orchestration Designer to route our technical support issue submission through our system.
The first step we will take in creating this example is to define the business process workflow. For those of you familiar with Visio, the Orchestration Designer functions in much the same manner. Most of the time you drag components, shapes, and so forth, to your workspace and access properties of these items to define their functions. After you have launched the BizTalk Orchestration Designer, step through the following items to define the business workflow.
For all of these functions you will drag items from the Flowchart stencil on the leftmost side of the application to the left of the Separator bar.
Now that all of our process descriptions are on the page, we need to connect these items. To connect them you need to follow these steps:
Connecting is this simple. In our example you will need to make the following eight connections:
At this point your screen should look like Figure 15-7. Now that this portion of our example is complete, save it in a file named Support.skv on the C drive. We will now begin adding our processing applications to the Implementation side of the workspace.
Figure 15-7 Our example after designing the workflow.
One of the great qualities of the Orchestration Designer is its ability to include definitions and descriptions of the processing applications. For instance, we might want to use a component to send the customer with a support issue an e-mail with the resolution. Maybe we want to pass the document to a script first and perform other processing before a phone call is made to the customer. Using the Orchestration Designer we are able to drag category components to our workspace, select the scripts, COM objects, message queues, and BizTalk messaging applications that will be used to process the data.
In our example we are going to add a few script components. The point of this exercise is to expose you to some of the terminology and screens you should expect to see when defining the processing applications. For instance, you will create ports that act as the conduit between the business process and the applications. Furthermore, you will be able to see how the Orchestration Designer represents these connections.
The following steps will show you how to add Script Components out of the Implementation stencil.
Listing 15-6 MsgBoxes.wsc: A script used to display our dialog boxes.
<?xml version="1.0"?> <component> <?component error="true" debug="true"?> <registration description="MsgBoxes" prog version="1.00" class > </registration> <public> <method name="ShowMsgBox"> <PARAMETER name="sMsg"/> <PARAMETER name="sTitle"/> </method> <method name="AskYesNo"> <PARAMETER name="sMsg"/> <PARAMETER name="sTitle"/> </method> </public> <script language="VBScript"> <![CDATA[ function ShowMsgBox(sMsg, sTitle) MsgBox CStr(sMsg), vbOKOnly, CStr(sTitle) ShowMsgBox = "" end function function AskYesNo(sMsg, sTitle) AskYesNo = MsgBox(CStr(sMsg), vbYesNo, CStr(sTitle)) end function ]]> </script> </component>
Want to know more about the other Implementation components? Be sure to check the BizTalk Help files—they contain more information, as well as other tutorials.
Once you've completed these steps, the right side of your workspace should look like Figure 15-8.
Figure 15-8 The results after connecting to processing scripts.
Before we move on, let's include a processing component that will be responsible for starting the entire process. This component, which will be of the Message Queuing type, will be what feeds the Receive Email action we defined on the business process setup. Here are the steps for adding this component.
At this point we have all the pieces in place—we just need to properly associate them and apply any needed functionality. In the next section, we will attach our business actions to our processing scripts and put the finishing touches on our example.
The final step in our example of using the Orchestration Designer application is to connect the business steps to the processing applications (scripts in our case). This step will not only involve defining the processing connections, but we will also add information in our Decision item to determine which connection is used.
In the same manner we used to connect the items together in the business process, we will drag control handles from the appropriate actions to the corresponding script component port. The following outlines how to complete this process.
Remember that the "port" is defined by the name we gave it. You can see these ports in the middle of your workspace.
Once you have completed these steps, your workspace should look like Figure 15-9.
Figure 15-9 The workspace after completing the process-to-port connections.
The next step in our example is to write the expressions to evaluate our document so we can properly process the data. Follow these steps to add in the necessary expressions:
What does this mean? Typing SupportMessage.Phone signifies that we are looking for the presence of a phone number in the document submitted. If this evaluates to TRUE, we will go through the ProcessPhone port and run the proper script.
We are now finished. Save your file so you do not lose any changes. At this point you should be able to combine what you've learned here with what we covered in Chapter 7 to build a complete BizTalk solution, or at least a simple one.
If you are still interested in the BizTalk Framework and Server product, check out http://mspress.microsoft.com. You will find several Microsoft Press titles on the subject.