These three topics could be entire blog posts on there own. In this case, I’ll briefly cover all three and show how to use them all together.

Start Orchestration – This shape give you the ability to asynchronously start a new Orchestration. You can pass in all types of parameters but you can not return parameters like the Call Orchestration Shape.

Passing Configured Port Parameters – This is an input parameter type for Call and Start Orchestrations. This can be used to pass in already configured ports to use to send messages back into the original Orchestration.

Direct Binding using Self Correlation – When passing Self Correlation ports to a Started Orchestration a unique token is placed in BTS.PartnerService. This is used for the return subscription. I have not worked with Self Correlation Ports in any other scenario although they can be used on there own without a Start or Called Orchestration.

Solution Overview: A single message is received into a Master Orchestration (Master). This single message is then used to Start two different Orchestrations (SharedLogicA and SharedLogicB). Inside these two Orchestrations, the message is “processed” (i.e. mapped and a 5 to 15 second delay is used to simulate processing). The resulting mapped messages are returned to the Master Orchestration. A single result message is sent out.

Download: Passing Configured Port Parameters Sample

The master Orchestration looks something like this:

How does this differ from Direct Binding Using Partner Ports?

It is very similar except that you do not use the Start Orchestration shape (thus can not pass parameters, multiple messages, and so on). Using Partner Ports, if you wanted a message back you would need to create a Correction Set and work out all those complexities. There is some other under the cover differences between the two but that is for another post.

How to set this up on your own:

Step 1: Create the Master Orchestration with a Receive Port and a SharedLogic Orchestration. Set up all required input and output messages. Set up the Send Shape inside the SharedLogic Orchestation to send back the correct message.

Step 2: Inside the Master Orchestration add the Receive Shape and set it up to receive the response message from the SharedLogic Orchestration. Select the Red ! to configure the Operation for the Receive Shape. Give the Port a name (Port_A), create a new port type (PortType_A), select Directing Binding – Self Correlation.

Step 3: Inside the SharedLogic Orchestration add the parameters that will be passed in by from the Master. In this case, an input message (InputA) and a configured port parameter (Port_1). For the port type, select the type create above (PortType_A), for Port Binding select “I’ll always be sending messages on this port”. Connect your Send Shape to your new Port.

Step 4: Lastly, inside your Master Orchestration add a Start Orchestration Shape. Select your Sharedlogic Orchestration. Set your two input parameters if needed.

Note that you can send and receive messages on the same port type when using the Start Orchestration Shape. If you tried this same approach with the Call Orchestration shape you would get a build error. Read more about this on Charles Young awesome article on this topic.