Click here to Skip to main content
15,895,256 members
Articles / Programming Languages / C# 3.5
Tip/Trick

Calling orchestration using Call orchestration Shape

Rate me:
Please Sign up or sign in to vote.
3.86/5 (3 votes)
5 Jul 2013CPOL2 min read 26.8K   3   1
Here we see how can we invoke other orchestration by using Call orchestration shape

Introduction 

The Call Orchestration shape can be used to synchronously call an orchestration that is referenced in another project. This allows for reuse of common orchestration workflow patterns across BizTalk projects. When we invoke another nested orchestration synchronously with the Call Orchestration shape the enclosing orchestration waits for the nested orchestration to finish before continuing. we can specify parameters that will be passed to the nested orchestration. Parameters can be messages, variables, port references, role links, or correlation sets. Passed-in port references, role links, and correlation sets all perform like self-addressed envelopes: they supply the nested orchestration information it can use to send information back to the enclosing orchestration.

Background

Some times we need to re-use the orchestration. By Call orchestration shape we can achieve this. Here I am going to show how can we do it.

Step 1

Followings things are needed to make our project so first we create these. 

  1. First create a BizTalk project and give it a name “CallOrch”.
  2. Add two orchestrations and name it “InnerOrch.odx” and “OuterOrch.odx”
  3. Add one schema “OuterSchema.xsd” as below pic.

    Image 1

  4. In the orchestration "OuterOrch.odx" create two messages "input_messge" and "output_message" and select their type as schema "OuterSchema.xsd". 
  5. In the orchestration "InnerOrch.odx" right click on Orchestration Parameter and add two Orchestration Messages Parameter.

    Image 2

  1. Input_msg and make direction "in"
  2. Output_msg and make direction  "out"

Step 2

  1. Drag and drop a receive shape into design surface on OuterOrch.odx orchestration and select message is Input_messge.
  2.  Now drop a call orchestration shape from toolbox and place it below receive shape. Click the exclamation mark (tool tip) on the shape. Select No Called Orchestration - Click to Configure. The Call Orchestration Configuration dialog box appears.
  3. In the Call Orchestration Configuration dialog box, select the orchestration you wish to call, as shown in Figure 1. In this dialog box, you can also select parameters that can be passed by an orchestration. Only orchestration types that have Activation set to False—that is, only orchestrations that are invoked from another process—will be available for selection and configure it as shown in the picture.

    Image 3

  4. Drop a send port and select its message is Output_message. Now Orchestration will look as below.

    Image 4

Step 3

  1. Drop a Decide shape into design surface in InnerOrch.odx. Give Descriptive names to condition branches.
  2. Drop a construct message shape in both branches within Decide shape. Now Drop Message assignment shapes in both construct message shape and write  following expressions.

    Image 5

  3. Now InnerOrch.odx will look like below.

    Image 6

Step 4

Now our project is ready to deploy .build it and deploy the project and make necessary configuration in BizTalk Admin console for receive port, receive location and send port and send location.

Now drop a test message in receive location and see the output in send location.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 3 Pin
Amir Mohammad Nasrollahi27-Jul-13 22:18
professionalAmir Mohammad Nasrollahi27-Jul-13 22:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.