BizTalk Training – Orchestrations – How to Call Orchestrations developed in a different Visual Studio Solution

Posted: June 15, 2013  |  Categories: BizTalk Orchestrations

In the past, I developed a demo on “How to Call Orchestration from another project or from another BizTalk Application” that you can read here and where you can download the source code.

This demo was composed by one Visual Studio Solution with two different projects:

  • Project1
    • Orch1
    • Schema1
  • Project2
    • Orch2

However, there were a few questions about how we can accomplish that using two different solutions… well is the exact same process, but to help clarify this topic and to better help the community members that placed the questions I decided to create a different demo.

In this demo we will create two Visual Studio Solution:

  • CallExternalOrchestrationCommonSolution with a common orchestration that will be called from others orchestrations
    • This will be deployed to a BizTalk Application called “CallExternalOrchestration.Common
  • CallExternalOrchestrationMainSolution with the main Orchestration that will call the common Orchestration using the “Call Orchestration” shape.
    • This will be deployed to a BizTalk Application called “CallExternalOrchestration

In both solutions, I will describe the basic steps (or the most important steps) to accomplish this task.

Creating the Common Solution: CallExternalOrchestrationCommonSolution

This project contains an orchestration that will receive two input strings (however you can define other types of input like a message or other object types) and will construct a message that will be sent to a folder on the file system.

Common orchestration

Again, I will not explain all the steps to create the entire flow of the orchestration. The most important thing here is to define the “Type Modifier” property of the orchestration.

If we make an analogy with C#, we can say that this property is the same as the Accessibility Levels to C# members or types. The “Type Modifier” property defines the scope of an Orchestration, i.e., it indicates the access restrictions to this Orchestration. An Orchestration can be public, private, or internal.

  • If it is Public, it is visible to anyone interacting with the orchestration.
  • If it is Private, it is visible to other orchestrations within the same project and namespace.
  • If it is Internal, the port type is visible only within the project.

When we create an Orchestration, the default “Type Modifier” is “Internal”. So to be able to call this orchestration from a different Visual Studio Solution or different project we need to set the “Type Modifier” to “Public”.

To set the “Type Modifier” property for an orchestration to “Public” you need to:

  • Open the orchestration in Microsoft Visual Studio
  • Right-click somewhere in the orchestration designer (except in the shapes otherwise you will go to the shape properties), for example, the green Start shape at the top of the orchestration and select the “Properties Windows” option to display the Orchestration Properties dialog
Common orchestration type modifier public
  • Set the “Type Modifier” property to Public as you see in the picture.

Compile and deploy the solution.

Creating the Main Solution: CallExternalOrchestrationMainSolution

The second project basically contains one orchestration that will receive an input message from a folder on the file system and will call a common (or external) orchestration.

Main Orchestration

Again, I will not explain all the steps to create the entire flow of the orchestration. The most important thing here is to import the reference (DLL) that contain the common orchestration that we want to call.

To import the reference to your project you need to:

  • In Solution Explorer, right-click on “References” and select “Add Reference”.
  • In the “Add Reference” dialog box, select the “Browse” tab that enables you to browse for a component in the file system.
  • Select the components you want to reference, and then click OK.
    • You can select multiple components by holding down the CTRL key, provided the components are all on the same tab.

Now if you drag a “Call Orchestration” shape to your orchestration you will be able to select the common orchestration that we created earlier, as you can see in the picture below:

call orchestration configuration

Once again, compile and deploy the solution.

You can download the source code from:
How to Call Orchestrations developed in a different Visual Studio SolutionHow to Call Orchestrations developed in a different Visual Studio Solution
GitHub

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

turbo360

Back to Top