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.  variable field name

    Posted Fri April 07, 2006 03:50 PM

    I want to get a value from a field with a variable name:

    I have a document with this structure:

    document/field1/field2/VARIABLEFIELDNAME/field3/field4

    I want to get the value of field4. Field1, 2, 3 et 4 have fixe name

    VARIABLEFIELDNAME content the string “Pivot” like “ABCPivot” or “dkoPivotezee”

    i wanted to do a thing like
    document/field1/field2/[/Pivot/]/field3/field4 but I don’t know if it’s possible (when I try it doesn’t work)

    Someone know how to do that?


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


  • 2.  RE: variable field name

    Posted Sun April 09, 2006 08:34 AM

    I believe you can use a java service to extract the document information.
    Give the java service the following inputs :
    document and the varibale field name u want to extract the value

    Use the below java service. THis service has got inputs namely “tempDoc” and “key” and gives an output “value”

    // pipeline
    IDataCursor pipelineCursor = pipeline.getCursor();
    String value=null;
    // tempDoc
    IData tempDoc = IDataUtil.getIData( pipelineCursor, “tempDoc” );
    String key = IDataUtil.getString( pipelineCursor, “key” );
    if ( tempDoc != null)
    {
    IDataCursor tempCursor=tempDoc.getCursor();
    while(tempCursor.next())
    {
    if(key.equals(tempCursor.getKey()))
    {
    value=(String)tempCursor.getValue();
    IDataUtil.put( pipelineCursor, “value”, value );
    pipelineCursor.destroy();
    return;
    }
    }
    tempCursor.destroy();
    }
    pipelineCursor.destroy();


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


  • 3.  RE: variable field name

    Posted Sun April 09, 2006 12:33 PM

    If you convert your document to a node using pub.xml:documentToXMLNode, you can use pub.xml:queryXMLNode to locate variables using regular expressions.

    See this post for a couple of examples of XQL queries that will do this.

    Mark


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