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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Value Validation

    Posted 06/30/03 09:31 AM

    I’m looking frantically for a way to validate an incoming value (from a csv file) as numeric prior to inserting in Oracle. The only way I have found to do it so far is to perform some math function on it, such as cast as an integer, and let it bomb, which generates an error message in the log. This could result in an unacceptable amount of trash in the log for my particular client. Is there another way, such as an ‘isnumeric’ service? Any help would be greatly appreciated.

    Jennifer


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 2.  RE: Value Validation

    Posted 06/30/03 10:06 AM

    You can use regular expressions to test for numbers. eg. [0-9]

    See Appendix D in the ISDeveloperGuide.pdf for details.

    So you can test if the field is numeric and then add the steps to handle it either way.


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Value Validation

    Posted 06/30/03 10:10 AM

    Also, see Appendix E on how to use them, especially syntax on page 580.


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 4.  RE: Value Validation

    Posted 06/30/03 10:15 AM

    So, if I understand what you’re saying, the only way is to validate that each character of the string matches a value of 0-9? There isn’t a less processor-intensive method? Or am I misunderstanding?

    Jen


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 5.  RE: Value Validation

    Posted 06/30/03 02:15 PM

    Thank you for the time you took to respond to my question. I appreciate your help.

    Jennifer


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 6.  RE: Value Validation

    Posted 02/22/05 03:15 PM

    This is a cut/paste from the PSUtilities package, string folder. The package is downloadable from advantage.

    IDataCursor pipelineCursor = pipeline.getCursor();
    pipelineCursor.first( "input" );
    String input = (String)pipelineCursor.getValue();
    
    String isNumeric = "true"; 
    try
    {
    float fNumber = Double.valueOf(input).floatValue();
    }
    catch (Exception e)
    {
    isNumeric = "false";
    }
    finally
    {
    pipelineCursor.insertAfter("isNumeric", isNumeric);
    pipelineCursor.destroy();
    }
    

    #webMethods-General
    #Integration-Server-and-ESB
    #webMethods