问题
I have a problem in my project i have to create orchestration and base o first node of xml file i have to decide what map will be use. Any idea how to do it? I try to use decide shape and in decide shape use xslt query to find first node equal particular node decide shape will send it to particular map. is that a good approach?
回答1:
Another option that would use a receive location for each type of message would be to use a Listen shape in the orchestration. Each branch of the listen would be expecting a different message type (or root node as you put it) and you could apply the appropriate map. Then, assuming you are mapping to a canonical schema, the rest of the orchestration would be the same regardless of input message type.
In the image the orchestration is using a listen shape to listen for 3 types of message. It's mostly for replay-ability for when the orchestration fails at different stages, I can inject it back into the flow after a fix is made.
回答2:
Here's some suggestions:
- If the schema can be resolved by the XmlDisassembler, the engine will apply the matching Map on the Receive Port automatically.
- If the number of different Maps is manageable, say 4 or 5, and very unlikely to change, then sure, the decide shape is a workable approach.
- Be sure to carefully examine the differences in the Maps. I've had times when the planners believed the maps were significantly more different then in reality. If the difference is a handful of differing codes or conditional fields, maybe one Map can handle all cases.
来源:https://stackoverflow.com/questions/20616655/biztalk-using-first-node-xml-file-to-decide-what-map-to-use