webMethods

webMethods

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.  Evaluate multiple values in branch

    Posted Thu July 31, 2008 12:15 AM

    Hi,
    I am new to webMethods and using version 7. Trying to the build the flow to implement branch based on output value.

    I’m getting the state abbreviation from the output document ( /stateid ) and if the stateid value is not ‘A’ or ‘B’ or ‘C’ then invoke service1 and for all others invoke service2.

    Is it possible to implement using Branch and evaluate multiple values at once in the following sequence? :confused: If not what is the best approach? Please give me some suggestions on this, thanks in advance.

    Here is my flow

    Sequence
    –Sequence (try)
    ----- Mapping
    ----- Branch on ‘/stateid’
    ----- Sequence: !=( “A” || “B” || “C” )
    ---------- service1
    ----- Sequence: $default ( for all other states )
    ---------- service2
    –Sequence (catch)


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


  • 2.  RE: Evaluate multiple values in branch

    Posted Thu July 31, 2008 04:52 AM

    Hi Nola,

    If I understand your requirement correctly, You can do the following.

    Branch
    if (StateID!=‘A’ || StateID!=‘B’ || StateID!=‘C’ ) (use evaluate option)

    or
    default

    Hope this helps.

    Rookie4Webm


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


  • 3.  RE: Evaluate multiple values in branch

    Posted Thu July 31, 2008 06:24 PM

    Hi Rookie4webM,

    Thanks for the response.

    Per your suggestion I used if condition in the 1st sequence step and when testing it is not evaluating the condition and directly jumping to $default sequence.

    Here are the steps I was following to accomplish, let me know if anything is missing.

    In Branch:
    Switch = /folder1/subfolder2:docName/variableName ( in mycase variable name is StateID)
    Evaluate labels = FALSE

    In Sequence:
    Label = if (StateID!=”A” || StateID!=”B” || StateID!=”C”’ )


    For testing purpose when I specified just the value in the sequence label without any conditional statement it steps through the sequence flow and executes the service.
    In Branch:
    Switch = /folder1/subfolder2:docName/variableName
    Evaluate labels = FALSE

    In Sequence:
    Label = A

    Please correct if I’m not following the steps correctly, I’m new to this tool.


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


  • 4.  RE: Evaluate multiple values in branch

    Posted Thu July 31, 2008 06:33 PM

    On the branch step set evaluate labels = true.

    In the labels for your sub-branch-steps, you should mention,
    %StateID%!=”A” || %StateID%!=”B” || %StateID%!=”C”’
    or $default, whatever is appropriate

    I suggest you to go through developer’s guide before starting any coding.


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


  • 5.  RE: Evaluate multiple values in branch

    Posted Thu July 31, 2008 06:40 PM

    Just make the Evaluate Lables in Branch step to TRUE and leave the SWITCH value blank.
    The rule here in BRANCH is,
    if Evaluate Lables=TRUE then dont specify anything in SWITCH. Give only condition on the label of the child steps.
    if Evaluate Lables=FALSE then specify the SWITCH variable and give the value in the label of the child steps.

    Refer the document “webMethods Developer Users Guide 65.pdf” for more information. You can download it from the adavantage.webmethods.com website.


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


  • 6.  RE: Evaluate multiple values in branch

    Posted Fri August 01, 2008 02:55 PM

    It’s working thank you all for your help and suggestions.


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


  • 7.  RE: Evaluate multiple values in branch

    Posted Sat August 02, 2008 11:13 PM

    Another option is to use a regular expression. You can have a BRANCH on /stateID with Evaluate lables set to false and then set the label of the first step to: /A|B|C/ (or /^A$|^B$|^C$/ if you want to be exact - although with state codes the first expression would suffice.)

    • Percio

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