Adding Items to a Queue
- In the Queues page, create a queue.
- In Studio, create an automation project that, for example, collects certain figures from an Excel spreadsheet and stores them in a variable.
- From the Activities panel, drag an Add Queue Item activity to the Designer panel.
- 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.
- 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.
- (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.)
Important!
References are not compatible with the 2016.2 or lower versions of Orchestrator or Robot.
- (Optionally) In the Deadline field, add a date until which the items must be processed.
- (Optionally) In the Postpone field, add a date when to start processing the queue items.
- Next to the ItemInformation field, click the Browse 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" "
.
- Click Create Argument. A new blank argument is created.
- Change the name of the argument to something more suggestive for your needs.
- Change the Type of the argument to what you need. For example, if you want to store numerical values from transactions, select Int32.
- 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.
- Click OK. Your settings are saved.
Important!
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
- In Orchestrator, consider you have a queue populated with items.
- In Studio, from the Activities panel, drag a Get Transaction Item activity to the Designer panel.
- 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.
- 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.
- In the TransactionItem field, enter the QueueItem variable created previously.
- From the Activities panel, drag a Decision activity under the Get Transaction Item activity.
- Create your automation requirements. For example, add the transaction items to an Excel spreadsheet and send e-mails with this information.
- 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.
- 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.
- 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.
- In the TransactionItem field, enter the QueueItem variable used at step 5.
- (Optionally) Click the Browse 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.
- (Optionally) Click the Browse 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.
- 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.
- In the Properties panel, from the Status field, select Failed. This status is applied to all queue items that pass through this activity.
- In the TransactionItem field, enter the QueueItem variable used at step 5.
- 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. For more information on this choice, see the Business Exception vs Application Exception article.
- 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.
- 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
- In Orchestrator, consider you have a queue populated with multiple items.
- In Studio, consider you already have a Get Transaction Item activity that iterates through all queue items.
- 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.
- 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.
- In the TransactionItem field, enter the QueueItem variable used in the Get Transaction activity.
- In the Postpone field, add the date after which this item can be processed.
- 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.
For details on the processing order of transactions, see here.
Adding a Custom Progress
- In Orchestrator, consider you have a queue populated with a lot of items (millions) with the In Progress status.
- In Studio, consider you already have a Get Transaction Item activity that iterates through all queue items and uses a QueueItem variable.
- From the Activities panel, drag a Set Transaction Progress activity to the Designer panel.
- In the TransactionItem property of the activity, enter the QueueItem variable.
- 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.
Important!
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. A basic workflow should look as in the following screenshot.
Updated 3 years ago