Learning BizTalk Server 2000: Lesson 3

Igor Leybovich and Scott Woodgate
Microsoft Corporation

May 2001

Summary: The third in a series of 7 articles designed to show you how Microsoft BizTalk Server 2000 can help your business exchange a variety of documents with business partners, as well as integrate internal business processes and applications. In this lesson, we will take a look at how a requisition approval process is defined using BizTalk Orchestration Services. (7 printed pages)

Note
   
You will need to install Microsoft® BizTalk™ Server 2000 in order to complete this lesson. Before you install Microsoft BizTalk Server, make sure you have read the Readme.htm and Installation Guide.htm documents, paying particular attention to the following important prerequisites:
  • You must have a computer running Microsoft Windows® 2000 with Service Pack 1 or above (Professional or Server both work), including IIS and MSMQ services, and an account with administrative rights on that computer.
  • You must have Microsoft SQL Server™ 7.0 with Service Pack 2 or above (you can install SQL Server Desktop Edition if you choose to run everything on a single workstation running Windows 2000 Professional) and password for the "sa" account. If you use SQL Server 2000, you must configure it for "mixed" security mode in the install wizards that is not the default.
  • Microsoft Visio® 2000 SR1 Standard or above must be installed on the computer where you are installing BizTalk Server.
  • In Internet Services Manager, turn off the Enable authoring option on the Server Extensions tab of the Default Web Site.
Also, in order to execute the scripts for these lessons, you need to install the MSMQ component of Windows 2000.

Contents

Introduction
What is Orchestration?
Analyst's Point of View
Developers See It Differently
Joining the Two Sides
Let's Run It

Introduction

Now let's discuss how Northwind Traders implemented its requisition approval process using BizTalk Orchestration Services. Figure 1 gives a more detailed view of what needs to be done.

Ee265604.biztalk_lesson3_1(en-US,BTS.10).gif

Figure 1. Requisition approval process for Northwind Traders

What Is Orchestration?

So now that you know how to submit your business documents to BizTalk Messaging Services from Lesson 2, you might ask yourself: "How do I define what my business processes are, and how can BizTalk Server help me to apply these processes?" The answer to that question is BizTalk Orchestration Services. Microsoft BizTalk Server 2000 solves two problems: it provides you with BizTalk Messaging Services to send messages between business processes, and it provides you with BizTalk Orchestration Services to create your business processes.

BizTalk Orchestration Services enables you to create a detailed representation of your business process, and also to programmatically implement the business process within an integrated design environment based on Microsoft Visio 2000. Historically, the business-process design phase and the implementation phase were performed separately. One of the important features of BizTalk Orchestration Services is the integration of these previously distinct phases within a unified graphical design environment.

Because business processes are defined in a graphical environment, when these processes change at the business level this can be much more rapidly reflected at the implementation level.

In addition to integrating design and implementation, BizTalk Orchestration Services provides several other important features to solve tasks that are hard to achieve today: the ability to create processes containing concurrency, doing multiple tasks at the same time, and the ability to create robust, long-running business processes that span applications, platforms, and organizations. To achieve the second feature, create robust, long-running business processes, BizTalk Orchestration Services saves instances of long-running business processes and suspends them, which conserves computing resources and provides extra reliability. At a later point, the server restarts these processes from the exact point at which they were suspended while waiting for a long operation to finish. Even if the computer was turned off in the interim, the suspended processes restart when triggered. An example of such a long-running operation could be waiting for payment of an invoice, an operation that usually takes 20 to 30 days before completing. Go ahead and open the BizTalk Orchestration Designer and, from the File menu, open the file NorthWindApprovalL3.skv from c:\LearnBizTalk\Schedules.

Analyst's Point of View

If you are one of the many business analysts who frequently draw diagrams using Microsoft Visio, you will feel right at home the moment you open BizTalk Orchestration Designer. Figure 2 shows Northwind's approval process drawing that was designed in BizTalk Orchestration Designer.

Ee265604.biztalk_lesson3_2(en-US,BTS.10).gif

Figure 2. Approval process created in BizTalk Orchestration Designer

You are simply defining your business process using such basic shapes as Action, Decision, and While shapes. You are not required to think in terms of documents, specifications, components, and messages—leave this work to the developer. No limitations are imposed on the number or names of the steps in your process. In addition, you can use Fork shapes to split the process into multiple concurrent paths, such as requesting the same price quote from multiple suppliers, and later reunite these paths with a Join shape. Finally, you can use the Transaction shape to "wrap" several steps of the process into a unitary transaction if business requirements dictate this.

Developers See It Differently

Once the business process has been defined, you can now implement it by instructing BizTalk Server as to what must be done to perform each of the tasks drawn by an analyst. If you are a software developer, this is probably the moment you've been waiting for, thinking that we would finally show some coding tasks. As much as we hate to disappoint you, we must say that BizTalk Orchestration Services does most of the work, so the amount of code that's left to be written is minimal, if any.

Figure 3 shows the developer's side of the diagram.

Ee265604.biztalk_lesson3_3(en-US,BTS.10).gif

Figure 3. Implementation process created in BizTalk Orchestration Designer

As a developer you certainly need to understand how to use the BizTalk Messaging shape, the COM Component shape, and the Message Queuing shape. Note that you do not write any code to bind the business processes together; your coding is in the individual components of specialized business logic, rather than in the glue that holds them together.

For example, when you drag and drop the BizTalk Messaging shape onto the drawing, you open the BizTalk Messaging Binding Wizard, which walks you through a series of simple pages to define which messaging port is associated with a given implementation shape. As you may recall, a messaging port is simply a collection of properties associated with a certain document destination, and your business process can certainly be such a destination.

At the same time, for simpler tasks you can also create lightweight components in a scripting language of your choice, such as Microsoft Visual Basic® Scripting Edition (VBScript). We have used a component like this in this XLANG schedule drawing. Our script component exposes a method called DeclineReq, whose only job is to display a message box alerting the user that a requisition has been declined.

The NorthwindApprovalL3.skv XLANG schedule contains two script components and one BizTalk Messaging shape.

Of course, if a specific part of the business process requires you to perform specialized tasks, such as accessing internal databases or interfacing with a mainframe system, you would most likely implement them in a COM component and simply call its appropriate methods from BizTalk Orchestration Services.

In the next lesson, we will take a closer look at the process of creating a Script Component.

Joining the Two Sides

Finally, we need to connect the business analyst's view with the implementation. Each flowchart shape used by an analyst, as well as each implementation shape used by a developer, has a "handle" on its side. Using familiar Visio techniques, you connect an action shape on the left with an implementation shape on the right by simply drawing a line between their handles. Once the shapes are connected, the XML Communication Wizard opens and you then answer a few questions to determine how the communication between the shapes occurs.

Now that all the action and implementation shapes have been connected, we are almost done. The last step, on the Data page, is to define how the actual business document will be passed from one action to the next. You can view the Data page by clicking the Data tab at the bottom of the drawing in BizTalk Orchestration Designer. The next lesson contains more details about that.

Let's Run It

To test the parts of the scenario we have discussed up to this point, run the following script file: L3Post.vbs. This script temporarily alters our XLANG schedule drawing so the requisition does not get passed to Contoso just yet. Don't worry, we will return everything to its original configuration later, but now it is useful to make this change so that you can visualize this step of the process.

Copy the ReqToDecline.xml file from the C:\LearnBizTalk\Documents directory and paste it into the C:\LearnBizTalk\Pickup directory. The File Receive function picks up that file and delivers it to BizTalk Messaging Services. BizTalk Messaging Services in turn invokes the Northwind requisition approval process using BizTalk Orchestration Services, since we defined an XLANG schedule as the destination for the messaging port that was created for this business process. Finally, BizTalk Orchestration Services processes the requisition and displays a message box informing you that this particular requisition was declined. Go ahead and do it again, this time using the ReqToApprove.xml file. The message box informs you that the requisition has been approved.

In Lesson 4, we will focus on configuring Implementation shapes in BizTalk Orchestration Designer, developing a Script Component, and determining what needs to be done on the Data page so that our document is properly passed from action to action.

Show: