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.  [9.10] Exit step and continue fo break statement

    Posted Tue June 25, 2019 05:48 AM

    Hi,
    In Java we can have this kind of statement :

    
    for(String s : listStrings) {
    switch(s) {
    case "Case1" :
    continue;
    ....
    }
    }

    It means if “Case1” exists in listStrings, we go to the next iteration of the loop.

    In flowService I can not see how to do this :

    
    LOOP in listStrings
    BRANCH on listStrings
    SEQUENCE Label=Case1
    EXIT on ???? [i]($loop equivalent to break)[/i]

    Have you an idea


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


  • 2.  RE: [9.10] Exit step and continue fo break statement

    Posted Tue June 25, 2019 08:36 AM

    Not sure your exact usecase but as per the below code snippet this is how the “Enhanced For Loop” will work

    char[] vowels = {'a', 'e', 'i', 'o', 'u'};
    // foreach loop
    for (char item: vowels) {
    System.out.println(item);
    }

    Output

    a
    e
    i
    o
    u

    Now, putting this in webMethods flow service, you will have a “inStringList” which is a stringList data type (eg., 1, 2, 3, 4) and below attached code snippet will execute all the sequence steps including the $default.

    My question is what you are doing in each sequence step? Can you provide your requiement with example?

    for-each-loop.PNG


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


  • 3.  RE: [9.10] Exit step and continue fo break statement

    Posted Tue June 25, 2019 08:41 AM

    No it’is a simple example;
    the code is big and in the LOOP Sequence there are a lot of statements.
    If I want a continue statement (I can do in other way with other BRANCH statements), it’s in order to write not to many and nested statements


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


  • 4.  RE: [9.10] Exit step and continue fo break statement

    Posted Tue June 25, 2019 11:38 AM

    I find a way

    To reuse my example, the solution is

    
    LOOP over /stringsList
    Next: SEQUENCE
    BRANCH on /stringsList
    Case1 : EXIT 'Next'

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


  • 5.  RE: [9.10] Exit step and continue fo break statement

    Posted Tue June 25, 2019 08:12 PM

    Great and happy to know that, the sample looks similar to mine in the screenshot, you can mark this thread as “Closed”


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