IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

stringList inside Document is not getting Aligned as per DT

  • 1.  stringList inside Document is not getting Aligned as per DT

    Posted Wed February 12, 2020 10:56 AM

    Hi All,
    I need some help with solving the below scenario.

    I have the below document(Idata in my pipeline)

    employeeDataDT(Document) which has below strings and stringLists
    workBranch (string)
    City (string)
    employeeName (stringList)
    employeeAge (stringList)
    employeeRole (stringList)

    then when I use pub.xml:documentToXMLString to convert the idata to XML String, I am seeing elements inside stringList coming together.
    ForExample:- like below

    <?xml version="1.0"?> Chennai MAA emp1 emp2 1 2 Dev1 Dev2

    But I want it to be coming as in the DT structure.

    For Example:- like below

    <?xml version="1.0"?> Chennai MAA
    <employeeName>emp1</employeeName>
    <employeeAge>1</employeeAge>
    <employeeRole>Dev1</employeeRole>
    
    <employeeName>emp2</employeeName>
    <employeeAge>2</employeeAge>
    <employeeRole>Dev2</employeeRole>
    

    I tried with giving and without giving my DT (employeeDataDT) as input to- documentTypeName of service documentToXMLString.

    but both gives me as output.

    Any help here is appreciated. Thank you!


    #edi
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: stringList inside Document is not getting Aligned as per DT

    Posted Wed February 12, 2020 12:39 PM

    Hello Pradeep,

    I belive you are seeing the output that way because the IDATA structure you had created may not work as per your given example

    OK try this way and rebuild the IDATA structure per outlined xml hierarchy below:

    employeeDataDT(Document)
    – workBranch (string)
    – City (string)
    – employeeDetails (Doc list) will be the child loop as it repeats for each employee (0-n) times.
    -----employeeName (string)
    -----employeeAge (string)
    -----employeeRole (string)

    Having said that with the above structure based on your revised mapping the example should output like:

    <?xml version="1.0"?> Chennai MAA [b] [/b] emp1 1 Dev1 [b][/b]


    emp1
    1
    Dev1

    ---- so on

    Give it a shot and let us know the updated results!

    HTH,
    RMG


    #webMethods
    #edi
    #Integration-Server-and-ESB


  • 3.  RE: stringList inside Document is not getting Aligned as per DT

    Posted Thu February 13, 2020 03:17 AM

    Hi RMG,
    Thanks a lot for looking into it and giving a suggestion. I too thought of it and have tried implementing solution as you suggested.

    But as you rightly said, it will add extra tag as below.

    But since I am working for migration project, I should not have that extra tag coming, as it is not there in the existing output-xml from smalltalk code.

    <?xml version="1.0"?> Chennai MAA [b][/b] emp1 1 Dev1 [b][/b] emp1 1 Dev1 ---- so on

    I thought we can parse and remove that particular tag in xml. but Since I was not so sure about the parse and remove logic implementation, I posted to get some suggestion/help.

    Please suggest me, if some way is there to solve this.

    Thanks & Regards,
    Pradeep N


    #webMethods
    #Integration-Server-and-ESB
    #edi


  • 4.  RE: stringList inside Document is not getting Aligned as per DT

    Posted Thu February 13, 2020 11:34 AM

    Hi Pradeep,

    I might be wrong, but you will have to add the extrag tag at least temporary during your processing as otherwise wM will group all elements of a list together in the XML as you have already noticed.

    Can you explain a bit more on your migration project?
    From above information it is a smalltalk → wM migration, right?

    Regards,
    Holger


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: stringList inside Document is not getting Aligned as per DT

    Posted Thu February 13, 2020 05:15 PM

    Pradeep,

    It would be a tough call unless you add that extra Tag in the structure and if not another rude way is once you get xmldata string (that has with employeeDetails) you can then invoke another flow step for pub.string:replace (map the xmldata) and replace those tags and with new line spaces that might look alike similar to your small talk outputs →

    Hope this will give some work around solution on this issue.

    HTH,
    RMG.


    #edi
    #webMethods
    #Integration-Server-and-ESB