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
Expand all | Collapse all

pub.string:replace

  • 1.  pub.string:replace

    Posted Wed November 01, 2006 04:46 PM

    Does any one know if you can search for more than one character using this bulit in service: pub.string:replace. Example I map a description field to the inString and on the searchString I need to search for any or all of these characters: ~,,> and replace with nothing? I have tried putting the search characters in brackets like this [~>] and set the replaceString to nothing and set the useRegex to true and it does not work. Is there some sort of deliminter that I need to use between the search characters? But of course I am not sure if you can use this BIS this way. Any comments or ideas would be helpful.

    Thanks,
    BD


    #Integration-Server-and-ESB
    #edi
    #webMethods


  • 2.  RE: pub.string:replace

    Posted Wed November 01, 2006 05:18 PM

    I am not sure why it doesn’t work for you.

    I tried the same service with these values:
    inString: ssss~>dddd
    searchString: [
    ~>]
    replaceString:

    The output value that I got was “ssssdddd”


    #Integration-Server-and-ESB
    #webMethods
    #edi


  • 3.  RE: pub.string:replace

    Posted Wed November 01, 2006 05:27 PM

    Yes, I performed the same test as Shubhro and the service worked correctly. Is there possibly something else in your flow (variables not being dropped or something like that) that could be causing the problem?

    Tim


    #edi
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: pub.string:replace

    Posted Wed November 01, 2006 07:35 PM

    useRegex must be true for this behavior.


    #edi
    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: pub.string:replace

    Posted Wed November 01, 2006 08:43 PM

    That was my first thought also, but he reports setting this to true.

    Tim


    #edi
    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: pub.string:replace

    Posted Wed November 01, 2006 09:01 PM


  • 7.  RE: pub.string:replace

    Posted Thu November 02, 2006 12:25 PM

    We are on version 6.1
    I too created a dummy service and it worked. But for some reason in my service that I need to use it in it won’t. But of course my dummy service is much simplified than my true service. The overview of the service:
    I am pulling data from customs tables so I will have one a only one header record with mutiple lines/details to the one header. I do an execSql to grab my header and map results to a canonical and then I loop over the canonical to grab my lines. I do an execSql for my lines and link to results and then I take the results of my lines and map it to the canonical and then drop results. So now the only thing I have in my pipeline is my canonical with my header and all lines. I then loop over my canonical/lines and map to a temp doc and then map the temp doc to LIN doc ref (which is an ST/LIN EDI doc list) so it be can appendded to a doc list and I make my the call pub.list:appendToDocument. After all lines are appended I then map to an EDI doc type and then call a service mapToEDIString which will take my EDI doc type and create the edi data with ST/SE and then it returns and I call a custom service EnvelopeandSubmitEDI which then creates the ISA/GS envelopes and submits to TN. Providing there are no special characters in the DESCRIPTION field (which is one of the strings in lines/details) it works like a charm and my EDI data is created. The place where I am trying to use the pub.string:replace on the DESCRIPTION field is when I am mapping from my fully built canonical (doc ref) to the tempDoc (document) which is in a loop. But I wouldn’t think being in a loop would cause it not to work, even though it maybe looping over several lines. Hope I have not confused anyone and not sure if explaining my service helps.


    #webMethods
    #edi
    #Integration-Server-and-ESB


  • 8.  RE: pub.string:replace

    Posted Thu November 02, 2006 04:16 PM

    My guess is it this is an issue that has nothing to do with pub.string:replace. Rather, I suspect that the mapping from the doc to the tempDoc and back is the issue.

    Can you post the snippet of your FLOW service where the call is being made?


    #Integration-Server-and-ESB
    #edi
    #webMethods


  • 9.  RE: pub.string:replace

    Posted Thu November 02, 2006 04:51 PM

    I agree that the replace service is unlikely to be the problem here.

    Actually this type of problem, changes being discarded when mapping within a loop or loops, is a familiar problem when working with loop statements. Here is an example of such an issue.

    Tim


    #edi
    #webMethods
    #Integration-Server-and-ESB