locked
Biztalk Orchestration variables in Maps RRS feed

  • Question

  • Hi,

    i want to use the orchestration variable inside a map in particular inside the inlineXSLT in scripting functoid.

    i Just have to add that variable at one place

    <xsl:value-of select="InputMessagePart_0/Fare_Travxcxcel/text()"/>

    i cannot promote the field and just assign it in the meesageassignment shape

    is there any way to use the orchestration variable in Inline XSLT?


    Thursday, March 12, 2015 5:25 PM

Answers

  • No. And it is also bad practice to create a Map that is dependent on the outside world (in this case an Orchestration) setting certain properties in order for the Map to function correctly.

    You should instead leave the elements blank in the Map. And then assign them when you leave the Map in a Message Assignment shape.

    Morten la Cour

    • Marked as answer by Angie Xu Friday, March 20, 2015 1:45 AM
    Thursday, March 12, 2015 6:57 PM

All replies

  • No. And it is also bad practice to create a Map that is dependent on the outside world (in this case an Orchestration) setting certain properties in order for the Map to function correctly.

    You should instead leave the elements blank in the Map. And then assign them when you leave the Map in a Message Assignment shape.

    Morten la Cour

    • Marked as answer by Angie Xu Friday, March 20, 2015 1:45 AM
    Thursday, March 12, 2015 6:57 PM
  • If it's just one value then the easiest way to accomplish this would be:

    1. In the Map, set the target field to some temporary value so the element or attribute exists in the destination.

    2. In a Message Assignment Shape in the same Construct Shape, use the xpath function to set the node value to the variable.

    The statement looks something like:

    xpath(MyMessage, "//MyXmlNode") = MyVariable;

    Thursday, March 12, 2015 7:07 PM
    Moderator
  • Definitely the above suggestions will work but in case if you want to pass values from Orchestration to map, then create a schema with those fields.

    For example if you want to pass A, B, C and D in map, then just create a schema with elements as A,B,C & D.

    Later you can create a map which has multiple schemas as input, one the original message and other the dummy message(having A, B, C, & D). Check below link to see how to create and test maps with multiple schemas.

    https://masteringbiztalkserver.wordpress.com/2011/07/08/developing-and-testing-maps-which-have-multiple-source-and-destination-schemas/

    Normally we use this technique if we want to use constant values in map or if pass key value pairs.


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    Friday, March 13, 2015 7:38 PM
  • No. And it is also bad practice to create a Map that is dependent on the outside world (in this case an Orchestration) setting certain properties in order for the Map to function correctly.

    You should instead leave the elements blank in the Map. And then assign them when you leave the Map in a Message Assignment shape.

    Morten la Cour

    ------------------------------------------------------------

    I disagree with la Cour here, there are situations when we need to perform transformation which should be dynamic and depends on outer entities like BRE, custom database, config file etc.

    For example sometimes we need to perform DBLookup for some key value(calculated in orch) in Map and populate the destination accordingly.

    In such cases assigning the values in orchestration will be a tough task. So, in that case we can create a dummy schema just having those key elements which are needed in the map.

    Later use Transform shape in orchestration to generate a map with two inputs one being the input message and other the dummy schema we created. This gives us complete flexibility and control over the usage of those key elements.

    I have written a blog to depict both the techniques. Please have a look.

    USING ORCHESTRATION VARIABLES IN MAPS


    Thanks,
    Prashant
    ----------------------------------------
    Please mark this post accordingly if it answers your query or is helpful.

    Monday, March 23, 2015 2:44 PM