IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Name XML elements not mapping as expected

    Posted 06/02/14 11:05 AM

    Originally posted by: Budman


    Good Day.

    I am encountering an issue when mapping name components from the EDIFACT NAD segment to XML elements.  The sourcing data is the NAD Composite C080.  I am attempting to map the first three appearances of sub-elements 3036 to, in order,  LastName, FirstName, OtherName.

    The target XML elements are defined as:

    <xs:complexType name="NameType">

                    <xs:sequence>

                                    <xs:element name="LastName" type="xs:string">    </xs:element>

                                    <xs:element name="FirstName" type="xs:string">    </xs:element>

                                    <xs:element name="OtherName" type="xs:string">   </xs:element>

                    </xs:sequence>

    </xs:complexType>

     

    Map rules :

    LastName 

    =PartyName Element[1]:PartyName Composite:NAD Segment:In1

     

    FirstName 

    =PartyName Element[2]:PartyName Composite:NAD Segment:In1

     

    OtherName 

    =PartyName Element[3]:PartyName Composite:NAD Segment:In1

     

    Mapping results:

     

    This example:

    NAD+FL+++DOE:JOHN:A+20 MAIN STREET:2ND ADDR LINE+ANYCITY+VA+12345+USA' 

    Properly maps:

    <Name>

    <LastName>DOE</LastName>

    <FirstName>JOHN</FirstName>

    <OtherName>A</OtherName>

    </Name>

     

    Missing First Name yields:

    NAD+FL+++DOE::A+20 MAIN STREET:2ND ADDR LINE+ANYCITY+VA+12345+USA'

    Missing First Name yields:

    <Name>

    <LastName>DOE</LastName>

    <FirstName>A</FirstName>      ß would have expected Middle Name to be mapped

    </Name>

     

     

    OtherName only:

    NAD+FL+++:JOHN:+20 MAIN STREET:2ND ADDR LINE+ANYCITY+VA+12345+USA'    Mapping discontinues/fails  altogether.

    I need to determine a means to simply map these components accurately when they are present or otherwise and have the map continue and NOT stop altogether.

    Any thoughts on this would be MOST HELPFUL.

    Thank you for any assistance you may provide.

    Bud


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Name XML elements not mapping as expected

    Posted 06/03/14 02:22 PM

    Originally posted by: Tim Rabbitt


    Hello Bud:

    You should be able to accomplish what you want by using the Track places feature of a type tree.  You mentioned EDIFACT data, so I used the edifd96a.mtt tree as an example.  In this tree, the NAD segment has a structure of:

    PartyName Composite (0:1)  defined as a group with subelements of PartyName Element (1:5) and PartyNameFormatCd Element(0:1)

    If you open the tree, go to the properties associated with PartyName Composite, and set the Group SubClass - Format to Explict and then Track to Places.  Analyze and save the tree, then recompile and run your map.

    This will force WTX to track PartyName components by places, so if PartyName[2] is empty, the output tag will be empty as well. 

    Using the xmlpo.mms map source (edifacttoxml map) that comes with the EDIFACT pack as an example, I modified the type tree as described above and then modified a NAD segment entry to be:

    NAD+FL+++DOE::A+20 MAIN STREET:2ND ADDR LINE+ANYCITY+VA+12345+USA'

    The corresponding section of map output is:

    <composite_C080>
    <simple_3036>DOE</simple_3036>
    <simple_3036></simple_3036>
    <simple_3036>A</simple_3036>
    </composite_C080>

    Regards,

    Tim


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: Name XML elements not mapping as expected

    Posted 06/03/14 03:55 PM

    Originally posted by: Budman


    Good Day, Tim.

    I have applied the modification per your recommentation.  I am indeed seeing improved results.  However,  when the LastName (1st 3036 occ) is not present on the NAD sement, the mapping completely stops cold at that point in the EDI stream,  regardless of how well constructed subsequent NAD segment party names appear below that point in the set.   Any thoughs on getting the below sample NAD segment to produce the necessary output (empty XML elements) and NOT stop processing altogether?

    NAD+FL+++:JOHN:A+20 MAIN STREET:2ND ADDR LINE+ANYCITY+VA+12345+USA'

    You assistance most welcome.

     

    Bud - Customs

     


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 4.  Re: Name XML elements not mapping as expected

    Posted 06/03/14 04:17 PM

    Originally posted by: Budman


    Tim,

    Kindly disregard.  Updated the range on sub-element 3036 from (1:5) to (0:5).   Output mapped as desired.

    Again, thank you for the assist.

    Bud - Customs.


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender