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.  Integration Server DSPs and regex

    Posted Thu April 22, 2021 12:02 PM

    The documentation for Dynamic Server Pages (10-5_Dsp_And_Output_Template_Developers_Guide.pdf) claims that the %ifvar% tag supports regular expression matching:

    “matches(‘regular_exp’) Specifies that the condition is true if the value of Variable
    matches the regular expression regular_exp . For example:
    %ifvar carrier matches(‘UPS*’)%.”

    I’ve been trying to match odd numbers using character classes to workaround Outlooks lack of CSS support:

    %ifvar $index matches('^[0-9]*[13579]$')%

    and I’m beginning to suspect that the documentation is completely wrong and DSP does not support regular expressions at all, instead only simple globs.

    Does anyone know for sure?


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Integration Server DSPs and regex

    Posted Thu April 22, 2021 01:14 PM

    Hi,

    I am not sure if your regexp expressions are correct.

    Regards,
    Holger


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Integration Server DSPs and regex

    Posted Fri April 23, 2021 06:39 AM

    Hi Holger,

    Thanks but the regex is fine. You can test that it matches any odd number here.


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: Integration Server DSPs and regex

    Posted Thu April 22, 2021 04:11 PM

    May need to surround the string with / / to indicate it is a regex. The DSP doc does not say to do so, but the Service Development help indicates to do so for the multiple places where regex is supported – in a label for a step under a BRANCH and for an index, property or mask in WQL. It doesn’t reference DSPs specifically but I wouldn’t be surprised if enclosing in / is also needed there.


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Integration Server DSPs and regex

    Posted Fri April 23, 2021 07:45 AM

    Thanks Reamon,

    I’m afraid that doesn’t work either. I see someone else complaining about it here.

    I suspect that when this was developed they didn’t know the difference between a regular expression and a glob.

    But even the glob doesn’t work properly. If I do something like this
    %ifvar $index matches('*2')%

    it matches
    2
    12
    32
    43
    52

    But not 22!

    Bizarre. I think it’s just never worked properly.


    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Integration Server DSPs and regex

    Posted Fri April 23, 2021 11:29 AM

    Thanks for the update on that. And for the other thread. That thread seems pretty concrete that regex is not supported. @Xiaowei_Wang indicated he did a patch, but looks like it never officially went into the product. :frowning: Similar to what you noted, Xiaowei indicated “It just uses * and ? as kind of wild card.”

    Maybe we submit a Brainstorm request? Or submit as bug? It seems it is either a product bug or a documentation bug (incorrectly indicating matches supports regex).


    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: Integration Server DSPs and regex

    Posted Fri April 23, 2021 11:33 AM

    Hi Rob,

    probably submitting both (Incident and Brainstorm request) and correlate them to each other.
    Lets see which one will have an usable solution sooner or later.

    Regards,
    Holger


    #Integration-Server-and-ESB
    #webMethods