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.


#TechXchangePresenter
 View Only
  • 1.  regular expression to find a substring inside a string

    Posted Fri February 12, 2016 01:10 AM

    Hi,

    I have 2 arrays.
    1)/errorDetailDoc/Events
    2)/ErrorHandlingProperties/properties/ErrorCategory/NetworkException/NetworkError

    I am doing a nested loop, then I should search if the 1st array element contains the 2nd array element.
    Suppose, the 1st array element is :: “we can not find a solution for this”
    the 2nd array element is :: “find a solution”
    I should search if “find a solution” is present in “we can not find a solution for this”

    To achieve this, I am using a sequence and I am writing the label like:

    %errorDetailDoc/Events/ErrorDump% = /%ErrorHandlingProperties/properties/ErrorCategory/NetworkException/NetworkError%/

    But this is not working.
    Can somebody please help me on this.

    Regards
    Jyoti


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: regular expression to find a substring inside a string

    Posted Fri February 12, 2016 03:28 AM

    HI,

    Loop over both the array elements first and
    Take branch step, and set evaluate labels to true
    then, move the sequence ( your code) inside branch as a child sequence.

    Regards,
    Sreekanth


    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: regular expression to find a substring inside a string

    Posted Fri February 12, 2016 06:11 AM

    Hi Jyoti,

    There are some problems in what you say.

    1. You say that you want to check for containment and yet you test the equality

    2. %errorDetailDoc/Events/ErrorDump% = /%ErrorHandlingProperties/properties/ErrorCategory/NetworkException/NetworkError%/ is not correct

    the / characters should be inside the %%

    My suggestion is:

    1. to check the WMPublic services to see if there is a service that checks the containment of a string within another string
    2. if no such service exists you can make your own java service that can easily test the containment (Java String contains() method example).

    Hope this helped,
    Vlad Turian


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: regular expression to find a substring inside a string

    Posted Fri February 12, 2016 07:27 AM

    Hi Jyoti,

    Additiionally you can check out the PSUtilities Package available from tech community downloads section.

    Regards,
    Holger


    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: regular expression to find a substring inside a string

    Posted Fri February 12, 2016 11:38 AM

    If you don’t want to use java service, you can just try:
    WmPublic/pub.string:indexOf
    give the first and 2nd string as the parameters.


    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: regular expression to find a substring inside a string

    Posted Wed February 17, 2016 04:24 AM

    Hi Jyoti,

    You can try below Reg Exp statement as it is used for searching a document with specific string .

    %errorDetailDoc/Events/ErrorDump%.p[/%//ErrorHandlingProperties/properties/ErrorCategory/NetworkException/NetworkError%///]

    But in this case you cannot use this in side label property of any service as label works on Boolean functions.

    For more details in regular expression you can refer the below documents on page no 1120.

    http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuites/wmsuite9-9/Designer/9-9_Service_Development_Help.pdf

    better use pub.string:indexOf built in service or any java Service.

    Regards,
    Ashish Kumar


    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: regular expression to find a substring inside a string

    Posted Wed February 17, 2016 04:39 AM

    Hi All,

    I wrote a java service to check if one string is contained inside another string and it worked. :slight_smile:
    Thanks a lot everyone for your help.

    Regards
    Jyoti


    #Integration-Server-and-ESB
    #webMethods