Recently, I have been doing some work with the ESB Toolkit. I needed
to use an orchestration as an itinerary service, and while there is some
documentation on how to build an orchestration that can be used as an
itinerary service, there is nothing in the documentation that shows how
to get your custom orchestration to show up in the itinerary designer.
After spending some time pulling my hair out trying to get this to work,
I managed to stumble upon this blog post and this video that
outline the steps necessary to make a custom orchestration available in
the itinerary designer.
Without further ado, here is what it takes to create a custom
orchestration for use with the ESB Toolkit.
Add the following references to your orchestration project:
Add a logical direct-bound receive port and a receive shape with the
“Activate” property set to true to your orchestration.
Set the receive shape filter expression to subscribe to the
itinerary context properties:
Create orchestration variables of type
Microsoft.Practices.ESB.Itinerary.IItineraryStep. Use an expression
shape to get the current itinerary.
itineraryWrapper = new Microsoft.Practices.ESB.Itinerary.SerializableItineraryWrapper();
- Add your custom logic to the orchestration.
- Advance the itinerary to the next step and attach it to the outbound
msgOutbound(*) = msgInbound(*);
- Send the outbound message to the message box using a direct-bound
Open the Esb.config file in the ESB Toolkit installation directory
and add a new itineraryService element with the following
- id: A GUID to identify the new service minus the curly braces.
- name: The assigned name for your orchestration. This will be the
name that shows up in Visual Studio and it used by the filter
- type: The fully qualified type name of the orchestration.
- scope: Since this is an orchestration it should be set to
- state: None