Biztalk mapper – choose Nodes on value

Home Page Forums BizTalk 2004 – BizTalk 2010 Biztalk mapper – choose Nodes on value

Viewing 1 reply thread
  • Author
    Posts
    • #22026

      Hi

      Depending on a value in incoming XML i what to choose beteween different nodes in the outgoing xml.

      I set up an example to explain what I wan to do. In the example I use value=1 to choose to map all data in data to node data1 in outgoing message. If the value was 2 i map to data2 an so on.

      XML Example:

      <message-in>
      <value>1</value>

      <data>
      ……
      </data>

      </message-in>

      <message-out>
      <value1>1</value1>

      <data1>
      ……
      </data1>

      <data2>
      ……
      </data2>

      <data3>
      ……
      </data3>

      </message-in>

       

      What i s the best approach for doing this in the Biztalk mapper?

       

      – Dag

       

    • #22028

      Depends on the number of variations of value1.  If there are only a few then you can use the Logical Equals and Value Mapping functoids.

      For each different value of value1 add a Logical Equals functoid and Value Mapping functoid pair. Connect the value1 field to the Logical equals, add the value (e.g 1) as the second parameter of the Logical Equals. Connect the output of the Logical Equals to the Value Mapping functoid. Connect the data field to the Value Mapping functoid and the output of this functoid to the appropriate field (e.g. data1). The order of inputs to the Value Mapping functoid is important. The output from the Logical Equals functoid should always be first.

      If you have an indeterminate number of values then you can get creative with custom Xslt.

      • #22048

        Thanks, think I use a custm XSLT since it i s a lot of mappings. Then I just has to have the test for value once instead of for each mapping.

         

        – dag

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.