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

REPEAT step in Flow service

webMethods Community Member

webMethods Community MemberThu May 18, 2006 04:02 PM

  • 1.  REPEAT step in Flow service

    Posted Thu May 18, 2006 03:22 PM

    Hi,

    My Document List contains 2 rows. I want to get the product of qnty and price for both the rows.

    So I have called “multiplyints” function as a child of REPEAT. I have set properties of REPEAT as :

    count = %sizeoflist% (that’s giving me number of rows correctly)
    repeat-on = SUCCESS
    backoff = 1

    I have set properties of “multiplyints”. Done with mapping for num1, num2 and value.
    Still after doing all this, I’m getting product amout only for 1 row and not for both the rows in Document List.

    Thanks,
    Asawari


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


  • 2.  RE: REPEAT step in Flow service

    Posted Thu May 18, 2006 03:31 PM

    Asawari,

    Why dont you loop thru documentlist and inside the loop call the multiplyints.Try this.

    Loop (Inarray=Doclist)
    Call multipyints(map qty to num 1,price to num 2) output total_amt.

    Exit the loop after iterations you should have total_amt(of 2 rows) in the pipeline.

    Sorry,i am not sure why you are using REPEAT step for this logic?

    HTH,
    RMG


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


  • 3.  RE: REPEAT step in Flow service

    Posted Thu May 18, 2006 03:47 PM

    Hi

    I tried that too i.e. looping through Doc List. But it’s giving me some or the other problem.
    Now here after looping through the Doc List, I enter into its child step ie. multiplyints. It’s showing me that same Doc List as Document in PipeLine Input.
    Any idea why does it show so? Because of that I guess, it’s not looping through it.

    Thanks,
    Asawari


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


  • 4.  RE: REPEAT step in Flow service

    Posted Thu May 18, 2006 03:50 PM

    "Now here after looping through the Doc List, I enter into its child step ie. multiplyints. It’s showing me that same Doc List as Document in PipeLine Input. "

    What is your service input/ouput mapping of multiplyints service??

    If you can provide more details on looping i can think whats wrong.

    HTH,
    RMG


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


  • 5.  RE: REPEAT step in Flow service

    Posted Thu May 18, 2006 04:01 PM

    That’s exactly what is supposed to happen. The pipeline editor is showing you that it is working on just one element within the list. Map your fields from the doc list variable (which appears to be a single doc) to the inputs of your service.

    Pretty basic stuff…


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


  • 6.  RE: REPEAT step in Flow service

    Posted Thu May 18, 2006 04:02 PM

    Flow service goes as follows:

    INVOKE sizeofList
    Loop over /DTL
    n INVOKE multiplyInts


    I have set properties as follows:

    For sizeofList function:

    Document List is “DTL”.
    So, Pipeline In “DTL” mapped to “fromList”.
    “size” mapped to Pipeline Out “sizeoflist”.


    For Loop step:
    Specified in-array as /DTL

    Called multiplyInts as child function inside Loop.
    Now here it is showing me DTL as document. I had mapped qty and price to num1 and num2 resp. and mapped value to TotalAmount.

    While mapping num1 and num2, what should be the index ?

    I have not used any specification.


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


  • 7.  RE: REPEAT step in Flow service

    Posted Thu May 18, 2006 04:07 PM

    Actually inside the loop (doclist) you dont need to specify index when you map qty,price to num1,2.The doclist should show as document and when you map qty,price to multiplyints make sure you dont give any index(click on the map link and see the map properties it wont show any index to specify).

    I think the problem is inside the loop for multiplyints unmap the qty,price and remap it this works.

    HTH,
    RMG


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


  • 8.  RE: REPEAT step in Flow service

    Posted Thu May 18, 2006 04:19 PM

    Hi

    Problem got solved. Thanks.
    Pipeline inputs were not getting showed properly. So it was asking me to enter index value even for Document, which was incorrect.
    But how to get accummulated total amount? It is showing me amount only for last row.


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


  • 9.  RE: REPEAT step in Flow service

    Posted Thu May 18, 2006 04:36 PM

    It should be overwriting the amount in the loop.Try this logic.

    Map (set total_amt to 0)
    Loop(Doclist)
    Invoke multiplyints (qty to num1,price to num2 and output map to tmp_amt)
    Invoke addints(map total_amt to num1,tmp_amt to num2) map output to total_amt (This will hold final amount)

    Exit the loop you should see the total_amount value of 2rows.

    HTH,
    RMG


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


  • 10.  RE: REPEAT step in Flow service

    Posted Fri May 19, 2006 06:57 PM

    Try this logic.

    Map (init amtList as string list)
    Loop( inArray: Doclist; outArray: amtList)
    Invoke multiplyints (qty to num1,price to num2 and output value map to amtList)
    Exit the loop.
    You should see the amtList with 2 rows.


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


  • 11.  RE: REPEAT step in Flow service

    Posted Fri May 19, 2006 08:10 PM

    bsingh,

    The original query was to capture accumulated amount value,so amtList with 2 rows may not be the solution looking for.Again some sort of sum is required.

    Anyways thx for chim in.

    HTH,
    RMG


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