none
Force empty value mapping RRS feed

  • Question

  • Hi all,

    I have to map an EDI schema to a flat file schema. In the source EDI schema, I have one field with min occurs = 0, while its equivalent in the flat file has the min occurs property set to 1, and the positional length is 4. I have the problem that, when the source instance doesn't have this element, it doesn't appears in the destination schema.

    For example:

    Source instance:

    TDT+01++03'

    Should be this destination instance (each field has 4 as positional length):

    "TDT01      03  " (notice a tag, 2 spaces after each field and 4 spaces for the second field)

    But I have:

    "TDT01  03  " (notice a tag and 2 spaces after each field, but the second field doesn't appear)

    I can solve it with a logical existance, a not and a value mapping (with a space) functoids, in order to force a space mapping if the node doesn't exist, but I'm looking for a solution by modifying the schemas properties. Something like forcing to create empty nodes in the source schema, or something like that... but I don't know if it is possible... 

    Thanks you in advance.

    Tuesday, March 27, 2012 9:06 PM

All replies

  • The flat file serializer can actually do this for you.  On the destination schema <Schema> node properties set the Generate Empty Nodes to Yes and make sure you have a pad character specified (see below).


    David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.


    • Edited by David K. Downing Wednesday, March 28, 2012 1:15 PM Additional clarification
    • Proposed as answer by David K. Downing Wednesday, March 28, 2012 1:15 PM
    • Unproposed as answer by David Sempere Thursday, March 29, 2012 2:35 PM
    Wednesday, March 28, 2012 1:12 PM
  • Hi David,

    I have already that properties set (also "Suppress Empty Nodes" to "No")... :S

    I think I will have to solve it with functoids... :(

    Thursday, March 29, 2012 2:37 PM
  • Just to clarify; you are mapping from an EDI schema to a Flat File Schema is that correct?  If so, you need to set the serialization property "Generate Empty Nodes" to "Yes".  The "Suppress Empty Nodes" is a parsing (disassembly) property.  Are you processing the EDI message using the EDI disassembler?

    David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.

    Thursday, March 29, 2012 2:52 PM
  • David,

    Can you send me the output from the Map (xml) and the destination flat file schema to take a look at?  My MSDN email is: ddownin@hotmail.com.

    David


    David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.

    Thursday, March 29, 2012 7:08 PM
  • "Generate Empty nodes" option can work together with the "MinOccurs" option (or "Default" value). It is just my assumption. Try to combine these options.


    Leonid Ganeline [BizTalk MVP] BizTalkien: Naming Convention for BizTalk Solutions

    Wednesday, April 4, 2012 3:35 PM