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.  MakeString separator issue

    Posted Tue December 13, 2005 04:03 PM

    Hi Guys,

    Maybe you will be able to help out. I am using makeString in one of my flows and I need a carriage return as the separator so the text can be placed on newlines everytime in the string. I put in “\r” as the separator but in the output I get \r as string. Anyone knows why am I not getting the carriage return?

    Thank You,
    Sebastian


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


  • 2.  RE: MakeString separator issue

    Posted Tue December 13, 2005 04:18 PM

    You are correct, that won’t work.

    Here’s some Java code for a service that will return a line separator string regardless of your platform:
    \n for Unix/Linux
    \r\n for Windows

    Configure the service out to a string named “lineSeparator”,
    then paste the following into the body of your new getLineSeparator Java service.

    The service can be invoked standalone to set a pipeline variable, or used as a transformer in a map step.

    =================================================================

    String lineSeparator = System.getProperty(“line.separator”);

    IDataCursor pipelineCursor = pipeline.getCursor();
    IDataUtil.put( pipelineCursor, “lineSeparator”, lineSeparator );
    pipelineCursor.destroy();


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


  • 3.  RE: MakeString separator issue

    Posted Tue December 13, 2005 04:41 PM

    Maybe you can set the value of the separator by opening the large editor(right click on the textbox and select “open large editor…”) and pressing enter.


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


  • 4.  RE: MakeString separator issue

    Posted Tue December 13, 2005 06:45 PM

    Mark, Thanks …that worked perfectly… :slight_smile:


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


  • 5.  RE: MakeString separator issue

    Posted Wed December 14, 2005 02:50 AM

    One note on both approaches: often you want to pick a platform-independent separator. Using the line.separator property will mean that when run on Windows you’ll get one separator (\r\n) while on Unix you’ll get another (\n). This may or may not be an issue depending on 1) how the file is processed by the recipients; 2) if the solution will run on both platforms or changes at some point.

    Also, the reason \r didn’t work is because character escapes are not supported by makeString.


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