Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Server

BizTalk 2010 Recipes : Orchestrations - Receiving Multiple Message Formats in a Single Orchestration

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
4/9/2011 4:48:28 PM

1. Problem

You need to execute the same orchestration logic for two or more different schemas.

2. Solution

Instead of creating separate orchestrations with identical logic, you can have one orchestration that uses the Listen shape and multiple Receive shapes. The Listen shape enables an orchestration to listen for any messages matching the schemas of any Receive shapes within the Listen shape. A Listen shape can contain multiple Receive shapes, all listening for different messages. In this solution, we will look at how to create an orchestration that listens for either of two messages to arrive.

The first step in the process is to define two different schemas to represent the different documents for which the orchestration will be listening. A typical example of this would be two versions of the same schema, where the elements defined differ enough to warrant a completely different schema. For instance, several required nodes on version 1 may not exist on version 2. Another example would be two different schemas representing similar data (such as customer, order, and so on) from two different legacy systems. In both cases, you would need to have both of the documents instantiate the same orchestration and be subject to the same rules and workflow.

For this solution, we will assume the following two documents are being used, representing different versions of the Person schema:

<ns0:Person xmlns:ns0="http://SampleListenShape.Person.V2">
<ID/>
<Name/>
<Role/>
<Age/>
</ns0:Person>

<ns0:Person xmlns:ns0="http://SampleSolution.Person">
<ID/>
<FirstName/>
<MiddleName/>
<LastName/>
<Role/>
<Age/>
</ns0:Person>

  1. In an empty orchestration, drop a Listen shape onto the design surface.

  2. Add two Receive shapes within the Listen shape.

    1. Set the Activate property on both Receive shapes to True.

    2. Rename the Receive shapes to Receive_Ver_1 and Receive_Ver_2. This is for reference purposes only.

    3. Create two message variables in the orchestration (click the Orchestration tab, right-click Messages, and select New Message), named msgVer1 and msgVer2, pointing them to the appropriate schema.

    4. Set the message type of Receive_Ver_1 to msgVer1 and Receive_Ver_2 to msgVer2.

  3. Add a new port to the Port Surface with the following properties (using the Port Configuration Wizard).

    1. Name the new port Port_Receive_Incoming.

    2. Create a new port type of PortType_ReceiveIncoming.

    3. Select "I'll always receive messages on this port."

    4. Set the port binding to Specify Later, or give a file path and set it to Specify Now.

  4. Create two operations on the port (there will be one created automatically). Right-click the port, name the operation Operation_VI, and set the Message Type to msgVer1. Repeat this to add Operation_V2 with the Message Type set to msgVer2.

  5. Add a map to transform the version 1 documents into version 2. This will allow the orchestration to work with one message type throughout.

    1. Add a construct message with a Transform shape under the Receive_Ver_1 shape.

    2. Create a new map.

    3. Set the source schema to msgVer1 and the destination schema to msgVer2. The orchestration will resemble Figure 1.

Figure 1. Orchestration with Listen shape

At this point, the orchestration can be deployed, bound to a receive port, and started. If either version of the Person schema is dropped on the MessageBox (via a port or directly bound), the orchestration will instantiate.

3. How It Works

This recipe demonstrated how to uses the Listen shape with multiple Receive shapes. There are alternative ways to use the Listen shape. One of the most common is a combination of a Receive shape and a Delay shape. This can be used for polling behavior in a long-running orchestration. For example, an orchestration could be set up to listen for a document to be dropped on a file directory. If a file is not dropped within a certain amount of time (as specified in the Delay shape), a series of steps could take place (such as notifying an administrator). By adding a Loop shape, the orchestration could return to listening for the document to arrive. An example of this is shown in Figure 2.

Figure 2. Listen shape with Delay shape
Other -----------------
- BizTalk 2010 Recipes : Orchestrations - Creating Branching Logic in an Orchestration
- SharePoint 2010 PerformancePoint Services : Examining Show Details Reports
- SharePoint 2010 PerformancePoint Services : Examining Decomposition Tree Reports
- SharePoint 2010 PerformancePoint Services : Reports - Strategy Map
- Windows Server 2008 R2 : Installing DFS (part 2) - Creating a DFS Folder and Replication Group & Configuring DFS Read-Only Replication
- Windows Server 2008 R2 : Installing DFS (part 1) - Creating the DFS Namespace and Root & Adding an Additional Namespace Server to a Domain-Based Namespace
- Windows Server 2008 R2 : File System Management and Fault Tolerance - Planning a DFS Deployment
- Windows Server 2008 R2 : File System Management and Fault Tolerance - The Distributed File System
- Windows Server 2003 : Creating Role-Specific Server Configurations (part 2) - Securing Infrastructure Servers & Securing File and Print Servers
- Windows Server 2003 : Creating Role-Specific Server Configurations (part 1) - Securing Domain Controllers
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server