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

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 video Game
-   Minecraft Mods - MAD PACK #10 'NETHER DOOM!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Minecraft Mods - MAD PACK #9 'KING SLIME!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Minecraft Mods - MAD PACK #2 'LAVA LOBBERS!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Minecraft Mods - MAD PACK #3 'OBSIDIAN LONGSWORD!' with Vikkstar & Pete (Minecraft Mod - Mad Pack 2)
-   Total War: Warhammer [PC] Demigryph Trailer
-   Minecraft | MINIONS MOVIE MOD! (Despicable Me, Minions Movie)
-   Minecraft | Crazy Craft 3.0 - Ep 3! "TITANS ATTACK"
-   Minecraft | Crazy Craft 3.0 - Ep 2! "THIEVING FROM THE CRAZIES"
-   Minecraft | MORPH HIDE AND SEEK - Minions Despicable Me Mod
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 92 "IS JOE DEAD?!"
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 93 "JEDI STRIKE BACK"
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 94 "TATOOINE PLANET DESTRUCTION"
-   Minecraft | Dream Craft - Star Wars Modded Survival Ep 95 "TATOOINE CAPTIVES"
-   Hitman [PS4/XOne/PC] Alpha Gameplay Trailer
-   Satellite Reign [PC] Release Date Trailer
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
programming4us programming4us
PS4 game trailer XBox One game trailer
WiiU game trailer 3ds game trailer
Trailer game
 
programming4us
Natural Miscarriage
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Game Trailer