This demo was compose by one Visual Studio Solution with two different projects:
However there were a few questions about how we can accomplished 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 decide 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 a 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 of the solution I will describe the basic steeps (or the most important steeps) to accomplished
Creating the Common Solution: CallExternalOrchestrationCommonSolution
This project contain an orchestration that will receive two input string (however you can define other types of input like message or other types) and will construct a message that will be sent to folder on the file system.
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
- 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.
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 in “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 create earlier, as you can see in the picture bellow:
Once again, compile and deploy the solution.
Download the sample:
How to Call Orchestrations developed in a different Visual Studio Solution (206.2 KB)
Microsoft | MSDN Code Gallery