“Can an itinerary to be able to make a decision in the middle of the flow?”
I have an itinerary, that processes requisitions, there are two requirements:
- Must archive the message after it goes through the two web services
- Depending on the requisition amount go down one path or the other: if it is a high requisition, it applies a discount
Using out-of-the-box features, this is VERY challenging, however, using the Orchestration Broker Service, the itinerary looks like this:
We are going to concentrate on the Orchestration Broker section (the brown shape) (the other pieces are covered in other posts).
So I dropped the Broker Service shape onto the itinerary surface and chose Orchestration Broker Service (Stott Creations)
So there are two broker resolvers, the payload and the context: so I can create two types of filters: based on the data in the message, or based on the context.
The first one I create is the payload, I want to be able to send data based on data in the payload: to the high or low, so I add a new resolver and call it Payload, because there could be multiple parts to a message, you can specify which part number we want to interrogate. By default it is part 0, if you don’t deal with multi-part messages, leaving it at 0 is fine.
I also want to send data based on the Context, so I add another resolver and choose Orchestration Context Resolver Extension. Notice that there are no other settings (no multi-part requirements)
Okay, now for the fun part.
I want to create a filter so that it will archive the data (regardless of anything else). I add a filter name it Archive Filter, choose the out-of-the-box XPath Filter, and paste the following statement stating: look at all of the context properties and if you find that the Property is called ServiceName with the itinerary system properties and that value is set to StottCreations.ESB.Orchestration.Broker this filter will be true (which it always will because it is in an Orchestration Broker service step):
/ContextProperties/Property[@name=’ServiceName’ and @namespace=’http://schemas.microsoft.biztalk.practices.esb.com/itinerary/system-properties’] = “StottCreations.ESB.Orchestration.Broker”
I add two more filters based on payload:
Name: High Priority
Filter Implementation: XPath
Expression: /*[local-name()=’Information’ and namespace-uri()=’http://InternalInterface.Canonical’]/*[local-name()=’OrderNumber’ and namespace-uri()=”] > 853
Name: Low Priority
Filter Implementation: XPath
Expression: /*[local-name()=’Information’ and namespace-uri()=’http://InternalInterface.Canonical’]/*[local-name()=’OrderNumber’ and namespace-uri()=”] < 853
Now I drop three Itinerary Broker Outports to the edge of the Orchestration Broker Step, this marries the resolvers to the filters:
With the other two I choose the Payload Resolver, and the appropriate Filter
Here is what it looks like:
I connect the outputs and the input.
So when I run a high message through: (order number > 853) this is what the flow looks like in the Portal:
Here is the low flow