Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Mapping based on input message attribute
- This topic has 3 replies, 1 voice, and was last updated 9 years, 7 months ago by
community-content.
-
AuthorPosts
-
-
April 2, 2008 at 5:21 AM #19230
Maybe someone can help me with this:
Problem:
I have one inbound message, called “Customer”, with an attribute on the root element telling me if it is an Create, Update or Delete.
I now want to map this message, to one of three messages based on this attribute. If the attribute value is Create, a message call CreateCustomer must be made an so one. This means that I first know at executing time, how the mapping should be done!Is there any way to do this using the BizTalk Mapper or XSLT? Or do I have to make an orchestration or a custom pipline?
-
April 2, 2008 at 5:37 AM #19231
Mcgyver,
I don’t know how to accomplish this using the BizTalk mapper, so would probably resort to XSLT, however I’m now sure how I would represent the destination schema given that the output message isn’t determined until ‘map execution time’.
I think that the cleanest way to accomplish this (assuming you’re not doing a messaging only solution) would be to use three transformation shapes in an orchestration, using the decide shape and an XPath query on the root element attribute to determine which branch to traverse. This approach would also cleanly separate orchestration messages (i.e. you’d have individual Create, Update and Delete messages rather than a single ‘everything’ message); it would also make maintenance of maps easier in the long-run IMHO.
Hope that helps.
Cheers, Nick.
-
April 2, 2008 at 5:43 AM #19232
It did!
I will make an orchestration with three branches (Create, Update, Delete) and a last branch if nothing is specified in the attribute (Suspend message)’
Thanks!
-
April 2, 2008 at 6:10 AM #19234
I agree with Nick – a switch in an orchestration is a nice clear way of doing what you want.
If you really wanted to avoid an orchestration, you might be able to do this with a small pipeline component which basically just needs to tweak the output file name according to the message type. So, reach into the message context and change depending on the action field.
But, it’s not very clear or obvious.
John D.
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.