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.  Flow Example

    Posted Wed January 29, 2003 06:32 AM

    Hi All,
    I am new to wM, I went thro the documents provided by wM. Now, I want to do a sample on wM developer.
    I created an xml file and the following is the content of the xml file
    ?xml version=“1.0” encoding=“ISO-8859-1” ?
    Root
    operation>Add56</num2
    /Root

    I have created the flow by invoking getFile(so as to load the xml file into wM environment and parse the same), I want the result as per the operation tag(I mean if it is Add then the two values r added and if it is Multiplication then the two values are multiplied).
    Can anyone explain the flow, how I should proceed to get the result.
    Thanks in advance

    Regards
    Ragz


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


  • 2.  RE: Flow Example

    Posted Wed January 29, 2003 11:18 PM

    Your flow should do the following:

    getFile (as bytes)
    bytesToString
    stringToDocument
    DocumentToRecord

    You will then have something meaningful for flow logic. Assuming an XML structure of /root/operation, you should end up with a boundNode (record structure) containing a record called root containing a string called operation.

    Add a Branch operation (switch variable /boundnode/root/operation) and then set up operations under the branch for add, multiple, divide, etc. The labels of these operations (set on the properties tab for each operation) should equal the value you want Branch to find. So, your final flow should look something like:

    getFile
    bytesToString
    stringToDocument
    documentToRecord
    BRANCH on /boundnode/root/operation

    • add: addFloats
    • multiple: multiplyFloats
    • subtract: subtractFloats

    and so on.


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


  • 3.  RE: Flow Example

    Posted Thu July 06, 2006 11:31 AM

    Ragz,

    webMethods gives you flow services to handle XML docs. They also check if your xml is well-formed or not. These can be found in WmPublic package under xml subfolder. Your flow could be like this:

    • In your flow service, have fileName as an input variable
    • the first flow step would be a pub.file:getFile (set loadAs to bytes)
    • then add flow step pub.string:bytesToString
    • pub.xml:xmlStringToNode
    • pub.xml:xmlNodeToDocument

    The output of the last service will give you an IS doucment type. The value of each tag is available here. Check the value and do appropriate branches.

    Thanks,
    Rajesh


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


  • 4.  RE: Flow Example

    Posted Thu July 06, 2006 11:33 AM

    sorry, i never saw the date of the original message. Ragz must be an expert by now. :slight_smile:


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