Using ReFramework and Long-Running - I have an automation for work that sends a form task for user correction if a data element isn’t formatted correctly. User can either correct the element and submit the form or reject the form. I am able to get the form information from orchestrator actions in a wait for resume section, but when we try to use set transaction status, the bot is unable to do so because in_TransactionItem is now null. For transactions where the field is formatted correctly and a form task is not created, set transaction status works fine. Do we need to do something to be able to access in_TransactionItem after the form? We tried mapping the argument, but once the Process finishes, in_TransactionItem becomes null. Alternatively, is there a way to include in_TransactionItem in the form fields so I can pull it from the form itself in Wait/Resume? Tried searching for that as well, but the only results were on how to get one part of the QueueItem, not the entire thing. I don’t see how I could add a QueueItem type variable to the form- it seems limited to mostly strings, int, etc.
You cannot add…instead you can have this workaround
- Use a get queue items activity and get the in progress items …
- Store the reference of queue item for filtering purpose…then you would get only one in progress item and as reference is string it can be stored
Hope this helps
Cheers
Hi @warek
In a long-running ReFramework process where you need to access the in_TransactionItem
after a form is submitted, you can follow these steps to ensure you have access to the transaction data even after the form task is processed:
- Custom Data Structure:
- Define a custom data structure or class that can hold both the form data and the
in_TransactionItem
data. This class should have properties for the form fields and any other information you need to preserve from the transaction.
- Combine Data:
- Before sending the form task, create an instance of your custom data structure and populate it with the relevant information. Include the
in_TransactionItem
data along with the form data.
- Form Submission:
- Send the form task with this combined data structure to the user for correction.
- Form Task Completion:
- When the user submits the form or rejects it, you will receive the updated data structure back. You can then extract the
in_TransactionItem
data from this data structure as needed.
Thanks!!
Hi
The reason why it is null is because the Wait and Resume activities create a new scope and the in_TransactionItem variable is not covered across scopes.
Hope these two steps would help you resolve this
-
You can use the Map Argument activity to copy the in_TransactionItem variable to a local variable before the Wait and Resume activities. This local variable will be available after the Wait and Resume activities, and you can use it to set the transaction status.
-
You can use the Create Form Task activity to create a form task that includes the in_TransactionItem variable. The user can then edit the form task and submit it, and the in_TransactionItem variable will be available to the bot when it resumes the workflow.
Cheers @warek
@PalaniyappanThanks for the suggestion. I tried to do that, but I am not able to add the new Transaction variable to the form to pass it through to wait/resume. Form task seems to only allow specific data types and I can’t get it to accept a QueueItem variable. Is there a trick to this that I don’t know?
Hello @
Nitya1
I have never created a custom data structure. I think where I am most confused is in how to add something that isn’t one of the specific data types mentioned in the Create Form Task activity. Unless it is one of those, how do I get extra variables included with the form?
Thanks,
Katie
I have a ticket with UiPath Support on this as previous suggestions aren’t working for us. May be user error on my part as I am new to DU/long running/action tasks. I will post final resolution once I have it. Please don’t close this post.
Please follow all the best practices mentioned in the UiPath docs for persistence scenarios.
Some references here - Studio - Managing Variables (uipath.com)
Activities - No Persist Scope (uipath.com)
Studio - Orchestration Process (uipath.com)