RE Framework weakness

Hello there fellow developers,
This question for those with knowledge of the REF framework as its a logical problem.
I am stuck on a issue on my automation which might possibly be a flaw of the RE Framework.

I am processing items on my queue with the RE Framework and after processing them I want to group them based on a field, suppose “type”, meaning creating an excel file for each type containing all the users of that type
The issue is that I dont want to do this at the end of the job because the job might be running for hours and there is extra work to do manually and that would be inconvenient for the person doing this.
I know that the items of the same type come one after another because I upload them in that order and i want when the type changes the process to create a report with that type name, fill it with these items, send it via email and continue with the others.
I thought this was easy with the logic: at the end of the proccess file of the framework save the last items type, and when the type changes write the datatable, sent it via email and clear it.

The problem stands that the state machines REF user clears the variables once you get out of the state and so I cant keep track of the last item type inside a state. Passing the LastItemState and the datatable containing the items processed so far wouldn’t resolve the issue as the REF transits between multiple states and the data gets lost.
One other solution I thought is saving the variables I need locally or in orchestrator and assigning them when entering a state but I find this as heavy work and not very elegant.

Any fellow REF lover out there who has an idea on this problem?

Hi Indroid,

I think the issue could be solve by creating a Global Variable and then use the in and out arguments in your sequences so the Global Variable should be able to maintain an historic through out the execution.

Nonetheless, if the process suddenly stops due to an exception the data will be lost. An alternative to this, will be to create and temporary spreadsheet that holds the values.

Hope this helps :slight_smile:

1 Like

It might not be a specific REF problem, I faced this challenge as well with other platforms in the past. The challenge is to have a current work item (queueitem) to be aware of the state of others in your process loop. Basically if I were a queueitem, I would ask myself the question, am I the last of my team in line. And since a queue item only has the information of itself, it cannot answer it by itself.

So… the information needs to be requested elsewhere. There should be something or someone to ask the question to. The solution depends a bit on ‘how’ you implemented REF.

I’d stay away from global variables. They are lost if your processflow is interrupted and restarted. REF will continue processing the queue, but will not have the global up-to-date anymore.

Possible solution A:
at the end of each process run, you request the queueitems in the orchestrator that apply the specific filter / bundling, in your case on “type”. You as a queue item know your own type, and by querying the queue on the number of ‘new’ items left in the queue of your type, you can deduct if you are the last one of that type or not, and use that logic to bundle and finish up the type-report at that time.
The challenge: filtering on ‘type’ in the get queueitems request. SpecificContent values are not queryable, only the reference and date/time filters. So in order to make this solution work you’d have to process your ‘type’ in the reference. This might not fit your usage of the queueitems, and you are in fact mis-using the reference for other purposes than being a unique identifier for the item.

Possible solution B:
This one does not differ too much from A, other than that you create a secondary storage for the progress data. Can be excel, a database, or even a simple txt file. On the dispatcher moment you update the storage with the number of items / type, and during the process/perform stage you update and validate it again.
The challenge: you add extra functionality in external documents, soyou need to implement airtight errorhandling to keep it consistent. A failed item needs to be updated as well, and if you use retries you need to account for that as well.

I’d like to see one or two (or ‘n’) filterable arguements in the queueitem, and to have the queuemanagement updated based on these values.
This would enable the above feature (making solution A a lot easier), but also would allow for a lot easier queue managment. (Updating priorities per type in bulk, canceling, rescheduling etc).
This however requires not a change in the REF, but in the basic architecture of UiPath Queue Orchestration.

1 Like

Hi Svillalobos,

thank you for your answer, that is indeed a solution. I was curious if there was a more elegant and secure solution out there :slight_smile:

1 Like

Hi Jeroen,
Could not have explained better, thank you.
Indeed this is a more general problem, having an item to be aware of the the other items state.
Global variables are a way to go if not possible to know the states of other items.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.