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.  Regular expressions

    Posted Mon November 06, 2006 04:23 AM

    Hi everybody,

    Can we create a regular expression pattern dynamically using a pipeline variable and use it in branch statement.

    thanks and regards


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


  • 2.  RE: Regular expressions

    Posted Mon November 06, 2006 03:09 PM

    I am not very sure what you want but try using Branch statement with Evaluate Labels set to True.

    Give an example of your problem, it will be easier to respond


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


  • 3.  RE: Regular expressions

    Posted Tue November 07, 2006 11:03 AM

    Thanx for the prompt response Sreedhar.

    The following is the requirement.

    I get a CODE like “i12345” as input variable.
    This code has to be compared to see if the first letter matches a certain predefined character. This character is stored in db and has to be retrieved at run time.

    To check the condition, I thought of using a regular expression whose pattern can be generated from the value retrieved from db ( say code)

    My regular expression should look something like this

    %variable%==/^%code%*/

    But this option was not successfull and I ended up using services under pub.String folder to achieve the requirement.

    I would just like to know, if the regular expression patterns can be created dynamically using pipeline variables.

    thanks and best regards


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


  • 4.  RE: Regular expressions

    Posted Thu November 09, 2006 08:28 PM

    Hi

    Did u find the solution to this?

    You could branch on “code” set the evaluate labels to false and add sequence steps or map steps to match the first characters.

    BRANCH on “/code”(Evaluate Labels = false)

    --    /[/^i/]/MAP(Starts with i)
    
    --     Default Map - Do nothing
    

    Regards
    Krishna


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


  • 5.  RE: Regular expressions

    Posted Fri November 10, 2006 02:08 PM

    Hi Krishna,

    I had wrongly phrased the previous reply.

    The variable will have the value i12345
    The CODE will have a single character like i (this value is dynamic and retrieved from db)

    We need to write a regular expression like:

    %variable%=/^%code%*/

    I tried this option, but it doesnt seem to work.


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


  • 6.  RE: Regular expressions

    Posted Fri November 10, 2006 02:36 PM

    In this case did you set Evaluate Labels = true?? because you are trying regular expression and variable substituion syntax at the same time.

    HTH,
    RMG


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


  • 7.  RE: Regular expressions

    Posted Fri November 10, 2006 04:38 PM

    You can always evaluate the regular expression first, using PSUtilities.regex:matches or a similar java service, and branch on the outcome of that test.

    Tim


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


  • 8.  RE: Regular expressions

    Posted Thu November 16, 2006 02:05 PM

    Tim,

    I tried out your solution and it worked. Thanks a lot.

    RMG,

    I am working on your solution and will let you know the result of the same. Thanks for the support extended.

    regards,
    nshvr


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