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.
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.
"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.
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.
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.
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.
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.
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.
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.
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.