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.  variable regex label

    Posted Mon September 22, 2008 09:53 AM

    Hullo experts,

    Thanks for reading this thread. Quick question about regular expressions: we are retrieving the regex as a string from a database, retrieving it and then we want to evaluate the value of a variable against it, in a labelled branch;

    Something like:

    BRANCH (evaluate labels= true)
    %/stringToCompare% == %/selectedRegEx%

    The problem is now that the IS will treat %/selectedRegEx% as a string, and is not evaluating it. So the branch will only work if the value of /selectedRegEx is “/stringToCompare”, which is obviously not what we want.

    Anybody know what does the trick?

    Thanks,

    Loic


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


  • 2.  RE: variable regex label

    Posted Mon September 22, 2008 04:26 PM

    Loic,

    I’ve hit the same problem before (most recently on a 7.1.1 impl). It seems that evaluation of the label contents only occurs once - so once it has substituted the contents of variable selectedRegEx into the label, it’s done. No evaluation of the regular expression itself. This implies a single pass left to right evaluation of the label expression.

    I never found a solution within the label itself.

    Phil


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


  • 3.  RE: variable regex label

    Posted Wed September 24, 2008 06:58 PM

    Loic,

    It sounds like you’ll need a Java service. Luckily, PSUtilities already has the service you need. Take a look at PSUtilities.regex:matches and see if it works for you.

    • Percio

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


  • 4.  RE: variable regex label

    Posted Tue September 30, 2008 05:04 PM

    Thanks for the input guys.

    We looked around a bit, but couldn’t get it to work in flow, so we used the java regex API.

    Cheers,

    Loic


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