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
  • 1.  Empty fields in a record

    Posted Wed January 14, 2004 10:05 AM

    Hi all,

    My issue is:
    Input:

    1. a record (it could contain sub-records)
    2. a substitution symbol

    Output:

    1. a record (the same structure as an input one)

    Goal:
    If a field of input record is not empty -> just copy it in an output record
    If it is empty -> substitute it with a substitution symbol

    thanks in advance,
    Vassili


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Empty fields in a record

    Posted Wed January 14, 2004 04:23 PM

    You can do this with a transformer. Write a flow service that takes an object as input, the transformer tests the input for null, if so, put the substitution into the output pipeline, otherwise put the input variable back to the output pipeline. Instead of direct maps, map each field through this transformer.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Empty fields in a record

    Posted Wed January 14, 2004 05:02 PM

    thanks Eric,
    that’s what I was thinking about before. I was looking for a more simple solution, because if I had 50 fields in the record I would have to use 50 transformers.

    I used the next method:

    1. I created a new record with the same structure as the source one
    2. I assigned ‘*’ to all the fields
    3. I mapped the source record to this new one

    As the result, I have the new record with the same structure and ‘*’ for the empty fields.

    Question: maybe someone can tell me if there is another way to keep the same record structure if in run-time there are empty fields.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 4.  RE: Empty fields in a record

    Posted Mon April 12, 2004 11:54 AM

    Hello Vassili, not sure if you have found the better way. Anyhow, when set a variable value, you can untick the overwrite pipeline value box. This will subsitute the variable with your subsitude sympol if the value is empty.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 5.  RE: Empty fields in a record

    Posted Mon April 19, 2004 04:22 PM

    Hi The Terry,

    it’s quite elegant, but what should i do, if i need to implement this service like a transformer or just as a flow step?


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 6.  RE: Empty fields in a record

    Posted Mon April 19, 2004 09:37 PM

    Vassili,
    Both of these methods should work

    Loop over OldList
    Map (OldList to NewList)
    Map (Set Value to Constant with ‘Overwrite pipeline value’ unchecked)

    or

    Loop over OldList
    Map (Initialize NewList Iteration to Constant)
    Map (OldList to NewList using ‘Copy only if…’ on each mapping)

    I think it comes down to a personal preference.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 7.  RE: Empty fields in a record

    Posted Mon April 19, 2004 10:53 PM

    Hi,

    Use the second method in Jesse’s posting.

    Loop over OldList
    Map (Initialize NewList Iteration to Constant)
    Map (OldList to NewList using ‘Copy only if…’ on each mapping)

    Also you need to nullify the filed values before you apply the conditional map.

    Thanks,

    Pauly


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 8.  RE: Empty fields in a record

    Posted Tue April 20, 2004 01:12 PM

    thanks a lot for your replies,

    best regards,
    Vassili


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services