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.


#TechXchangePresenter
 View Only
  • 1.  How to compare two String Lists and spit out the differences, put them in a String Lists - SOLVED

    Posted Thu May 15, 2014 02:52 PM

    Hi All,

    I want to compare two String Lists and spit out the differences, put them in a String Lists.

    For Eg.,
    ListA
    Micheal
    Jackson
    Katy
    Perry
    Ne-Yo
    Guetta
    Eminem
    Linkinpark and so on…

    ListB
    Micheal
    Justin
    Katy
    Perry
    Ne-Yo
    Linkinpark and so on…

    I want the difference in two String Lists say (ListC and ListD)

    ***Items from first list that are not in second list
    Jackson
    Eminem
    Guetta

    ***Items from second list that are not in first list
    Justin

    Do we have a BIS for this in wM 8.x and above or should we write a custom java/flow service.

    Please provide your inputs/comments on this.


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: How to compare two String Lists and spit out the differences, put them in a String Lists - SOLVED

    Posted Thu May 15, 2014 03:21 PM

    There is no BIS for this, you can go for a flow service…if you are comparing based on certain patterns or regular expressions go for a java service.


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: How to compare two String Lists and spit out the differences, put them in a String Lists - SOLVED

    Posted Fri May 16, 2014 04:33 AM

    @ Sreenivas,

    Writing the same logic using LOOP will not be feasible due to performance issues.

    Can you share your ideas/comments. I have a sample java code but I should adapt the same code to suit webMethods 7.1.2 API


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: How to compare two String Lists and spit out the differences, put them in a String Lists - SOLVED

    Posted Sun May 18, 2014 03:56 AM

    If performance is important you can do this in java using collections and ListUtils.


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: How to compare two String Lists and spit out the differences, put them in a String Lists - SOLVED

    Posted Sun May 18, 2014 01:19 PM

    @ Anjni,
    Yes. I am aware of that. Currently i am working on the java code that I downloaded for Google.

    Do you have a working code with you? please share :slight_smile:


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: How to compare two String Lists and spit out the differences, put them in a String Lists - SOLVED

    Posted Sun May 18, 2014 01:44 PM

    Did u try something like this
    String A = {“Michael”, “Joe”, “Katy”};
    String A = {“Michael”, “Joe”, “Justin”};
    List finalDiff = ListUtils.subtract(Arrays.asList(A), Arrays.asList(B));

    ListUtils is a class available in apache commons jar
    see this http://commons.apache.org/proper/commons-collections/javadocs/api-3.2.1/org/apache/commons/collections/ListUtils.html


    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: How to compare two String Lists and spit out the differences, put them in a String Lists - SOLVED

    Posted Fri July 18, 2014 01:19 AM

    Hi Mahesh,
    The Tundra package has a lot of unique utilities and one of them does exactly what you need.

    Tech Community post:
    http://techcommunity.softwareag.com/ecosystem/communities/public/f2146ca4-ad80-11e2-8369-cd8d7ef22065/

    Download the Tundra package from GIT:

    Then look for the service within the Tundra package:
    tundra.list.string:difference

    Cheers,
    David


    #webMethods
    #Integration-Server-and-ESB


  • 8.  RE: How to compare two String Lists and spit out the differences, put them in a String Lists - SOLVED

    Posted Fri July 18, 2014 03:21 AM

    Thanks… I will check and get back to you!


    #Integration-Server-and-ESB
    #webMethods