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.  Loop inside Lopp issue?

    Posted Mon July 02, 2007 11:48 AM

    Hi All,

    I am trying to sort StringList using a Flowservice and am initializing the outer loop like i->0
    Loop over itemList
    –Seq i<size
    do something
    initializing j = i+1
    Loop over itemList
    –Seq j<size
    do something(swapping logic to exchange values like temp = a[i],
    a[i]=a[j] and
    a[j]=temp)
    j=j+1
    i=i+1
    But the control is not getting transfered inside the inner loop
    What went wrong. Help is highly appreciated:confused:
    Regards,
    Datta


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


  • 2.  RE: Loop inside Lopp issue?

    Posted Mon July 02, 2007 04:52 PM

    As many will attest, I’m a big proponent of writing most services in FLOW. However, in this case I must ask why are you doing this? There is a sort method available in the IS Java API that you can use to sort the list. You do not need to reimplement a sort. Indeed, it usually boggles my mind when anyone writes a sort from scratch–in the vast majority of cases it just isn’t necessary.


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


  • 3.  RE: Loop inside Lopp issue?

    Posted Mon July 16, 2007 10:28 PM

    Hi Datta,

    In the first loop when you are traversing, the “itemList” becomes a single String in each iteration and not a StringList. And so when you try again to loop over the itemList it can not loop over since there is no StringList as it was before outer loop statement and so not getting into the inner loop. You may need to duplicate your stringList and use the original one in outer loop and duplicated one in inner loop depending on the kind of sort you are trying to implement. Hope this would help you to give an idea of where it is going wrong.

    • Dinakar.

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