orchestrator
2021.10
false
Orchestrator User Guide
Automation CloudAutomation Cloud Public SectorAutomation SuiteStandalone
Last updated May 20, 2024

Managing Queues in Studio

Adding Items to a Queue

  1. In the Queues page, create a queue.
  2. In Studio, create an automation project that, for example, collects certain figures from an Excel spreadsheet and stores them in a variable.
  3. From the Activities panel, drag an Add Queue Item activity to the Designer panel.
  4. In the Properties panel, in the QueueName field, type the name of the queue created at step 1, between quotation marks.
    Note: The queue names are not case sensitive. For example, "Test_QuEuE" and “test_queue” are the same.
  5. From the Priority list, select Low,Normal or High, depending on the importance of the items that are added by this activity and how fast you want them to be processed.
  6. (Optionally) In the Reference field, enter a string or string variable to act as an identifier for a queue item or a group of them. (The reference can be used to link your transactions to other applications used within an automation project. Additionally, this feature enables you to search for certain transactions, in Orchestrator, according to the provided custom reference.)
    Note: References are not compatible with the 2016.2 or lower versions of Orchestrator or Robot.
  7. (Optionally) In the Deadline field, add a date until which the items must be processed.
  8. (Optionally) In the Postpone field, add a date when to start processing the queue items.
  9. Next to the ItemInformation field, click the Browsedocs image button. The ItemInformation window is displayed, that enables you to add data to each created queue item.


    Note: The value of the string arguments added in the ItemInformation window cannot contain the following characters: [ and " "
  10. Click Create Argument. A new blank argument is created.
  11. Change the name of the argument to something more suggestive for your needs.
  12. Change the Type of the argument to what you need. For example, if you want to store numerical values from transactions, select Int32.
  13. In the Value field, enter the value that you want to add to queue items or a variable that you use to store a specific value.
  14. Click OK. Your settings are saved.
    Note: Place these types of automation projects in a loop. Otherwise, only one item is created and populated in Orchestrator.

The data added in the ItemInformation window in Studio is displayed in the Item Details window, under Specific Data, in Orchestrator. All items added to queues have the status set to New.



Getting Items From a Queue and Changing Their Status

  1. In Orchestrator, consider you have a queue populated with items.
  2. In Studio, from the Activities panel, drag a Get Transaction Item activity to the Designer panel.
  3. In the Properties panel, in the QueueName field, type the name of the populated queue from Orchestrator, between quotation marks.
    Note: The queue names are not case sensitive. For example, "New_QueUe" and “new_queue” are the same.
  4. Create a QueueItem variable. This variable stores the first item from a queue, according to its priority and deadline. When placed in a loop, the Robot iterates through all queue items. After a queue item passes through this activity it is NOT processed, and the status of the item changes to In Progress.
  5. In the TransactionItem field, enter the QueueItem variable created previously.
  6. From the Activities panel, drag a Decision activity under the Get Transaction Item activity.
  7. Create your automation requirements. For example, add the transaction items to an Excel spreadsheet and send e-mails with this information.
  8. In the Properties panel, in the Condition field, type a condition (for example, the queue item is empty) based on which the status of the item can change.
  9. From the Activities panel, drag a Set Transaction Status activity and connect it to the False branch of the Decision activity. All transaction items that pass through this activity do not meet the condition added at step 7.
  10. In the Properties panel, from the Status drop-down list, select Successful. This status is applied to all queue items that pass through this activity.
  11. In the TransactionItem field, enter the QueueItem variable used at step 5.
  12. (Optionally) Click the Browsedocs image button next to the Analytics field and enter the data that you want to be displayed in the Item Details window, in the Analytics field.
  13. (Optionally) Click the Browsedocs image button next to the Output field and enter the data that you want to be displayed in the Item Details window, in the Output field.
    Note: This information is only displayed if the queue item is processed successfully.
  14. Drag another Set Transaction Status activity to the Designer panel and connect it to the True branch of the Decision activity. All queue items that pass through this activity meet the condition added at step 7.
  15. In the Properties panel, from the Status field, select Failed. This status is applied to all queue items that pass through this activity.
  16. In the TransactionItem field, enter the QueueItem variable used at step 5.
  17. From the ErrorType list, select Business or Application, depending on the condition you put in the Decision activity. For example, an empty queue item could be an application exception, while a transaction value being smaller than a standard value could be a business exception.
  18. In the Reason field, type a string to explain why the exception was triggered. After the project is executed, this information is displayed in the Item Details window.
  19. Connect both Set Transaction Status activities to the Get Transaction Item activity. This creates a loop and enables you to iterate through all queue items. A basic automation project should look as in the following screenshot.


    A mapping of the properties in the Set Transaction Status activity (on the left) and their corresponding fields in the Item Details window in Orchestrator.



To retrieve specific data from a queue item, you can use the SpecificContent() function. Write the name of the argument that was used to add information to the queue between quotation marks in brackets.


For example, the screenshot above displays the Value field of an Assign activity. It enables you to retrieve the value attributed to a queue item (displayed in the Item Details window, under Specific Data, in Orchestrator) and assign it to a string variable, so that you can process it later.

In the screenshot above:

  • transItem - is a QueueItem variable used to store transaction items.
  • .SpecificContent - is the function that retrieves information from transaction items.
  • ("transactionID") - is the name of the argument that was added in the ItemInformation window to populate the queue items with data. The argument name is also displayed in the Item Details window, under Specific Data, in Orchestrator.
  • .ToString - is a function used to convert the ID of the queue, which was initially an integer, to a string.

Postponing a Transaction Item

  1. In Orchestrator, consider you have a queue populated with multiple items.
  2. In Studio, consider you already have a Get Transaction Item activity that iterates through all queue items.
  3. From the Activities panel, drag a Decision activity to the workflow. The activity enables you to make a business decision, based on which to postpone some queue items. For example, if the value of a bill is grater than 3000$, you might want to postpone its payment.
  4. From the Activities panel, drag a Postpone Transaction Item activity to the True branch of the Decision. This means that all queue items that meet the condition placed in the Decision activity are postponed according to your configurations.
  5. In the TransactionItem field, enter the QueueItem variable used in the Get Transaction activity.
  6. In the Postpone field, add the date after which this item can be processed.
  7. In the Deadline field, add the date before which this item has to be processed.

    The Deadline and Postpone properties add a new priority to queue items. For example, a queue item which is due today at 7 pm and has a Medium priority is processed first, before another item that has no due date and a High priority.

    Note: Modifying the deadline of a queue item or postponing it changes its status to new.

Adding a Custom Progress

  1. In Orchestrator, consider you have a queue populated with a lot of items (millions) with the In Progress status.
  2. In Studio, consider you already have a Get Transaction Item activity that iterates through all queue items and uses a QueueItem variable.
  3. From the Activities panel, drag a Set Transaction Progress activity to the Designer panel.
  4. In the TransactionItem property of the activity, enter the QueueItem variable.
  5. In the Progress property, add a custom string to describe the progress reached here, such as "BeforeFirstDecision". That lets you know that the item has been retrieved from the Orchestrator database. If your automation project crashes at this point during the execution, one item has this status, and it is displayed in the Progress column.
    Note: Custom progress statuses are only displayed while an item has the InProgress status.

The remainder of the automation project can be set as explained above.

For example, the following workflow example sets each item status to Successful or Failed automatically, depending on how you design the Transaction Body sequence:

  • Do nothing,Break, or Continue- results as Successful
  • Throw Exception - results as Failed (Application error)
  • Throw BusinessRuleException - results as Failed (business error)
  • Set Transaction Status - results as the status you set
  • Postpone Transaction Item - results as New
  • Should stop - if you stop the workflow from Orchestrator, the workflow exists the loop after the current transaction completes.

    The workflow repeats for every queue item automatically, and sets the corresponding transaction status.

    In case of Break or if the queue is empty, the workflow exists the loop.



Download the archived workflow and use it as a reference.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.