cancel
Showing results for 
Search instead for 
Did you mean: 

How to store and access all marked completed items in queue

GracieDevine1
Level 3
Hello all,

I'm writing a program to extract 15 rows from a CSV, work the items, and then use these to place 15 orders in Centrix. At the moment, only one row is being placed as an order.

My Get Next Item outputs to a collection called Data and a data item called Item ID. However, the collection only stores 1 row and so only the one is passed to the input parameter on the next action page.

How can I store all 15 rows in a collection after they've been marked as completed in the work queue? Or should I go about solving this another way? I've attached images of the two pages after running the program.
1 BEST ANSWER

Best Answers

Hi Gracie,

The workflow you have shown in the READ-CSV part seems bit off to me as you are reading the CSV file into a collection then looping through each row, adding the data into the work queue which will return you the Item ID for the added item at that instance only and then you are again looping through the Item ID's and then using Get Next Item action which will return you the same Item ID and then marking it as complete.

The issue is with the highlighted part that you can see, the reason being if you directly use Item ID you will always get the current item which is in the queue at that point of time and you are again trying to mark it as complete without doing any processing at all.

The right approach should be to first load all the row items into the work queue one by one which can be done either in a separate process altogether or maybe as a part of the same process before fetching the items from the queue at that time. And you should only mark items as completed if you have completed processing on it end to end.

34904.png

In my workflow above I am reading the input file first in the first called page, then launching the application in the second page and in the third page I am loading the collection items from the CSV file into the work queue which you can see below:

34905.png

So here I am basically looping over each row of the collection from CSV file, then checking if any duplicates were there or not (optional step). If no duplicates found, I set the value of my current row to a pre built collection called queue data having a single row and all the columns as mentioned in the CSV file form the beginning only and then I add a tag (which is again optional) and then add the item to the queue. At the end of the execution of this page, I am supposed to get all my items from the CSV file into the work queue with status as Pending.


34906.png34907.png

Now once I have my queue set up, now I use 'Get Next Item' action which will return me the 'Item ID' data item if it exists, if not it will return me null which means I need to stop my process as we don't have any transaction to work on, so I check both the conditions as well as shown below:


34908.png
34909.png

If the item is present then, I would get a single row data item for my current item which has been picked up and I can process it accordingly for now post which I will be marking the item as either completed or exception depending on the execution result.

34910.png
34911.png
Once item is processed, we reset the error variables so that they dont get carry forwarded in the next transaction if they occurred currently and then we check if the user requested to stop the process from Control room or not, if no we go ahead with using the 'Get Next Item' action again checking if we received any item ID or not. This would ensure that we keep on processing all the items one after another till none is left.

34912.png

34913.png

This way you should be trying to iterate through the collection items in a queue, one at a time. Let us know if this helps you out and please mark the answer as the 'Best Answer' if it resolves your query so that others can track the answer easily 🙂


Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

View answer in original post

3 REPLIES 3

Hi Gracie,

The workflow you have shown in the READ-CSV part seems bit off to me as you are reading the CSV file into a collection then looping through each row, adding the data into the work queue which will return you the Item ID for the added item at that instance only and then you are again looping through the Item ID's and then using Get Next Item action which will return you the same Item ID and then marking it as complete.

The issue is with the highlighted part that you can see, the reason being if you directly use Item ID you will always get the current item which is in the queue at that point of time and you are again trying to mark it as complete without doing any processing at all.

The right approach should be to first load all the row items into the work queue one by one which can be done either in a separate process altogether or maybe as a part of the same process before fetching the items from the queue at that time. And you should only mark items as completed if you have completed processing on it end to end.

34904.png

In my workflow above I am reading the input file first in the first called page, then launching the application in the second page and in the third page I am loading the collection items from the CSV file into the work queue which you can see below:

34905.png

So here I am basically looping over each row of the collection from CSV file, then checking if any duplicates were there or not (optional step). If no duplicates found, I set the value of my current row to a pre built collection called queue data having a single row and all the columns as mentioned in the CSV file form the beginning only and then I add a tag (which is again optional) and then add the item to the queue. At the end of the execution of this page, I am supposed to get all my items from the CSV file into the work queue with status as Pending.


34906.png34907.png

Now once I have my queue set up, now I use 'Get Next Item' action which will return me the 'Item ID' data item if it exists, if not it will return me null which means I need to stop my process as we don't have any transaction to work on, so I check both the conditions as well as shown below:


34908.png
34909.png

If the item is present then, I would get a single row data item for my current item which has been picked up and I can process it accordingly for now post which I will be marking the item as either completed or exception depending on the execution result.

34910.png
34911.png
Once item is processed, we reset the error variables so that they dont get carry forwarded in the next transaction if they occurred currently and then we check if the user requested to stop the process from Control room or not, if no we go ahead with using the 'Get Next Item' action again checking if we received any item ID or not. This would ensure that we keep on processing all the items one after another till none is left.

34912.png

34913.png

This way you should be trying to iterate through the collection items in a queue, one at a time. Let us know if this helps you out and please mark the answer as the 'Best Answer' if it resolves your query so that others can track the answer easily 🙂


Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

GracieDevine1
Level 3
Hi Devneet,

This was a very thorough and helpful response, thank you so much! I appreciate that you walked me through the work queue.

Glad your query got resolved and my solution could help you out Gracie 🙂


Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------