none
adding new record in target without source information RRS feed

  • Question

  • Hi

    In my project I have to do a mapping from FlatFile to EDIFACT.  My problem is that I don't know how to insert a new record with only constant values into an optional loop

    Example:

    Source:
    BGM
    DTM
    FTX
    RFF_DQ
    DTM_DQ
    RFF_ON
    DTM_ON
    RFF_ABO
    DTM_ABO

    Target (how it should be)
    BGM
    DTM
    FTX
    RFF+DQ:284197'
    DTM+171:20090123:102'
    RFF+ON:101359023'
    DTM+171:20090123:102'
    RFF+ABO:2'
    DTM+171:20090126:102'
    RFF+CT:1' <= This one I would like to create


    What if the RFF_DTM Loops do not occur in the source? How can I create the RFF:IT ?

    I tried several approaches but most of the times I get following error

    error btm1046: Output validation error: Non Segment level  : [8] No matching child node found
     error btm1046: Output validation error: Segment level  : Segment ID - RFF : Position - 7 : [2] Unexpected segment
     error btm1046: Output validation error: Segment level  : Segment ID - RFF : Position - 8 : [1] Mandatory data element missing
     error btm1046: Output validation error: Segment level  : Field Error : Segment ID - RFF : Field Position - 1 : Current value -  : [1] Mandatory data element missing

    What makes me wonder is that the temporary xml file that is created contains the correct structure

    Can anybody help me?


            
    Klaus Weber
    Tuesday, February 24, 2009 3:48 PM

Answers

  • Klaus,

    Check your schema min/max and mandatory/optional settings.  "Unexpected segment" normally means that you:

    1.  Are missing a mandatory segment.  For example, if your RFF and DTM are mandatory and you are getting
         RFF
         DTM
         RFF
         RFF
         DTM

         or if your last RFF doesn't have a DTM

    2.  Your RFF max is 3 and you are getting four RFFs.

    Essentially, the error is telling you that your data does not match your schema.  If you look at the data and it is what you want, then your schema may be incorrect.

    Jim


    Jim -- Pro Mapping in BizTalk 2009, Apress Books, March 23, 2009
    • Marked as answer by KWeber Tuesday, February 24, 2009 10:52 PM
    Tuesday, February 24, 2009 4:40 PM

All replies

  • Klaus,

    You must force the target node to loop one extra time.  You can do this by finding a non-repeating, mandatory node in your source and linking it to your Looping functoid.   In your example, you would link BGM and the three RFF_ nodes to a Looping functoid, which in turn would link to the target RFF nodes.  That would produce four output nodes.  You must then control the output of your constants so that they only occur in the extra loop.

    There are many way to handle the controlling.  You might pull all the values plus the constants into an array or hash table, then extract them in order as the loop is output.  You might use a counter, and output each RFF based on the counter.

    You'll find several examples of this exact problem (Forcing a Loop) in Pro Mapping in BizTalk Server 2009, due on the shelves March 23.

    In the meantime, let me know if you have any questions.





    Jim -- Pro Mapping in BizTalk 2009, Apress Books, March 23, 2009
    Tuesday, February 24, 2009 4:03 PM
  • Hi Jim


    I tried what you suggested. I triggered the fourth loop by the BGM Segment and connected the looping funcoid to the Rffloop1 Segment of the destination.

    The intermediary xml file shows me the correct structure but I always get the error message 

    error btm1046: Output validation error: Non Segment level  : [8] No matching child node found
     error btm1046: Output validation error: Segment level  : Segment ID - RFF : Position - 7 : [2] Unexpected segment

    Are there any more hints you could give me?

    Thanks in advance

    Klaus



    Klaus Weber
    Tuesday, February 24, 2009 4:35 PM
  • Klaus,

    Check your schema min/max and mandatory/optional settings.  "Unexpected segment" normally means that you:

    1.  Are missing a mandatory segment.  For example, if your RFF and DTM are mandatory and you are getting
         RFF
         DTM
         RFF
         RFF
         DTM

         or if your last RFF doesn't have a DTM

    2.  Your RFF max is 3 and you are getting four RFFs.

    Essentially, the error is telling you that your data does not match your schema.  If you look at the data and it is what you want, then your schema may be incorrect.

    Jim


    Jim -- Pro Mapping in BizTalk 2009, Apress Books, March 23, 2009
    • Marked as answer by KWeber Tuesday, February 24, 2009 10:52 PM
    Tuesday, February 24, 2009 4:40 PM