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

String table to string

  • 1.  String table to string

    Posted Thu May 01, 2008 08:21 PM

    Hi All,

    I have a string table which has three columns (eg. Fname, Lname, Email). Lets assume this string table has about 10 rows in it. I am looking for a way to traverse through this string table and create a string variable out of it which would look like:

    Fname1, Lname1, Email1; Fname2, Lname2, Email2; Fname3, Lname3, Email3;…

    and so on.

    I would also not mind it if I could instead store these values on a string list such as:

    Fname1, Lname1, Email1
    Fname2, Lname2, Email2
    Fname3, Lname3, Email3

    Fname10, Lname10, Email10

    Any help is greatly appreciated.

    Thanks in advance.
    pENGUIN


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


  • 2.  RE: String table to string

    Posted Fri May 02, 2008 07:51 AM

    Hello Penguin,

    Use the service pub.table:stringTableToTable and pass your string table to this service and give the column names. This gives a Document List with the column names a fields. Then you can loop over this doc list and create your desired outouts: Add each field to a separate string list or form a string in your desired format.
    I would appreciate, if you have already tried your own approach before posting here.

    Cheers
    Guna


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


  • 3.  RE: String table to string

    Posted Fri May 02, 2008 01:43 PM

    Hello Penguin ,

    You could do the following steps.

    Step1: Intialize a map in which you declare a var say finalList and set a value blank.

    Step2: Add a loop over the source table (i hav taken the table variable as source.)

    Step3: In a map inside this loop, intizalize a variable say tempList, and set its value to the following. %source[0]%,%source[1]%,%source[2]%; .

    Make sure you check the Overwrite Pipeline and Perform variable substition check.

    Step 4: Add a map inside the loop. In this set the value of finalList as
    %finalList% %tempList%
    Make sure you check the Overwrite Pipeline and Perform variable substition check.

    After the loop is over, you will get your desired output in finalList var.

    Hope this helps

    Hussain


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


  • 4.  RE: String table to string

    Posted Fri May 02, 2008 02:46 PM

    Hi Hussain,

    Worked like a charm. I had already implemented it before you replied, but having said that your solution was so much better. Changed the implementation to the one suggested by you and works beautiful.

    Thanks a bunch.

    Penguin


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


  • 5.  RE: String table to string

    Posted Mon May 05, 2008 02:12 PM

    Why not just write a quick Java service? All you need to do is convert String to String
    Depending on the size of the data, Java service will have much better performance.


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


  • 6.  RE: String table to string

    Posted Mon May 05, 2008 02:55 PM

    Writing a java service for a task that can be done with flow services is not acceptable. There are a lot many threads explaining why. You should go for them only if it can’t be done in a flow service or performance is a bottleneck.

    Cheers
    Guna


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


  • 7.  RE: String table to string

    Posted Mon May 05, 2008 02:59 PM


  • 8.  RE: String table to string

    Posted Tue May 06, 2008 02:26 PM

    The question was how to convert String table to String List… Now, doesn’t that sound like a simple utility service requirement? There’s nothing wrong in writing these simple utility services in generic fashion in Java and re-use it.
    If the requirement was the typical integration type of service, of course, it should be done in Flow.


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


  • 9.  RE: String table to string

    Posted Tue May 06, 2008 04:17 PM

    the question was how to convert a table of 3 columns to a string List and in a specific format specified. SO i guess its not an issue if done with a Flow. Moreover any manipulation inside the flow with the other data would be quite easy.


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