none
Biztalk Mapping RRS feed

  • Question

  • Hi All,

    I have scenario like,

    Mapping XML document to schema generated from Stored procedure.

    Source Schema: Complex XSD.

    Destination Schema: Schema generated from the store procedure.

    But while mapping for most of the attribute records and fields i need to verify with the vocabulary if the attribute field value exists in the vocabulary then need to map.

    Please find the below xml code snippet from the input sample.

    <GenderCode code="M" codeSystem="2.16G"/>

    with respect to above input xml snippet. please find the below details in the vocabulary.

    <system valueSetOid="2.16A " valueSetName="GenderCode">
        <code value="F" displayName="Female" codeSystemName="Gendercode" codeSystem="2.14F" />
        <code value="M" displayName="Male" codeSystemName="Gendercode" codeSystem="2.16G"/>
        <code value="UN" displayName="Undifferentiated" codeSystemName="Gendercode" codeSystem="2.14F" />
      </system>

    I have to verify like Code and code system value in the sample matches with values in the vocabulary if it matches then that value need to mapped.

    Similarly for other fields in the input schema and also for few fields in vocabulary reaches more than 300 values.

    please provide an suggestion and  thanks in advance.

    Waiting for suggestions!!!




    Thursday, September 24, 2015 6:32 PM

Answers

  • Hi,

    You can have this two ways. You can have multiple input in the map. One ur complex schema message, second would be the vocabulary message . then in ur map (XSLT) you can lookup the data from vocabulary based on some parameters from 1st message and then map to destination.

    2nd, create a helper method that would take in ur search parameter and then will return the data from vocabulary. Ur c# method will load the vocabulary and xpath out the vale based on ur input parameter and then the return value can be mapped to destination.


    Regards &lt;br/&gt; When you see answers and helpful posts,&lt;br/&gt; please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    Thursday, September 24, 2015 6:48 PM
    Answerer

All replies

  • Hi,

    You can have this two ways. You can have multiple input in the map. One ur complex schema message, second would be the vocabulary message . then in ur map (XSLT) you can lookup the data from vocabulary based on some parameters from 1st message and then map to destination.

    2nd, create a helper method that would take in ur search parameter and then will return the data from vocabulary. Ur c# method will load the vocabulary and xpath out the vale based on ur input parameter and then the return value can be mapped to destination.


    Regards &lt;br/&gt; When you see answers and helpful posts,&lt;br/&gt; please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    Thursday, September 24, 2015 6:48 PM
    Answerer
  • Thank you,

    Can you please provide some more information or any link to follow up. 

    Friday, September 25, 2015 1:39 AM
  • Hi,

    I can think of using the Custom XSLT that would be the best option for your scenario:

    • In the input message get the Message and Vocabulary.
    • In the XSLT, get the Code System and compare it with the codeSystem in vocabulary (use for loop and if condtion to check)
    • Once you get the condition map the value to destination, else pass the if condition and do not map anything.

    Rahul

    Friday, September 25, 2015 8:30 AM
  • Hi Anil,

    The replies by Rahul and Pixelxx cover the ways in which you can achieve this. Let us know if you went through. Also, I assume 'vocabulary' is an other xml and not a kind of Rules Engine Vocabulary.. right?


    Praveen Behara
    MCST : BizTalk Server 2006 R2, 2010

    Sunday, September 27, 2015 8:26 AM
  • Yes vocabulary is another kind of xml.

    Regards

    Anil

    Thursday, October 1, 2015 1:37 PM