banner



How To Create Dictionary In Uipath

A queue is a container that enables you to hold an unlimited number of items. Queue items can store multiple types of data, such as invoice information or customer details. A queue is usually considered as a list of pending jobs, executed by priority or other criteria related to the underlying order several jobs are executed. However, in UiPath, queues are related to information obtained or generated by the bot, that is, inputs and outputs.  The bot stores the information in a queue, where the information remains stored by the Orchestrator so that it can be retrieved later by other bots.  So, a queue is a container of data held so other bots or applications can use it.

How to use UiPath Queues

While developing the workflow for any process the Queues are managed by the RPA developers. There are various activities that help the UiPath Studio to communicate with the Orchestrator Queues.

So the studio activities that helps in communicating with the Orchestrator Queues are as follows:

  • Add Queue Item
  • Add Transaction Item
  • Bulk Add Queue Items
  • Get Transaction Item
  • Delete Queue Items
  • Get Queue Items
  • Postpone Transaction Item
  • Set Transaction Status
  • Set Transaction Progress
  • Wait Queue Item

These can be found in the Activities panel under Orchestrator -> Queues as shown below:

Queue_Activities_For_UiPath

Pre-Requisite

  • To work with these activities the Orchestrator should be connected with the Robot.

Add Queue Item

This activity helps to add data (item) in the Queue in Uipath. The status of the item will be New in the Queue.

`UiPath.Core.Activities.AddQueueItem`

Configurations in Properties Panel:

  • Queue Name: The queue where the QueueItem object is to be added. The Queue Name should be same as the Queue created in the Orchestrator.
  • Reference: The reference can be used to link your transactions to other applications used within an automation project.
  • ItemInformationCollection: This field accepts the dictionary variables. This enables importing an entire dictionary of information for a queue item. Dictionary<string, object>
  • Deadline– The date before which the queue item should be processed. This property can be filled in with relative dates such as DateTime.Now.AddHours(2), DateTime.Now.AddDays(10) and DateTime.Now.Add(New System.TimeSpan(5, 0, 0, 0))

Add Queue Item

Here you need to take care of Few properties as shown above, Which can be referenced from the Queue you have created in Orchestrator.

Queue Info from Orchestrator

Add Transaction Item

This activity adds an item in the queue, starts the transaction, and sets the status to In Progress. It can also be configured to add a custom reference to each transaction. The status of the item is set to **InProgress**. Returns the item as a `QueueItem` variable.

`UiPath.Core.Activities.AddTransactionItem`

Add Transaction Items UiPath

Bulk Add Queue Items

This activity adds the items from a specified Datatable to the queue in the orchestrator. The items once added in the Queue the statuses are changed to New.

UiPath.Core.Activities.BulkAddQueueItems

Add Bulk Items into Queues

Get Transaction Item

This activity is used to get the item from the orchestrator queue to process and sets its status to In-progress. Starting its processing makes it a transaction.

'UiPath.Core.Activities.GetQueueItem'

Get Transaction Items from UiPath Queues

Delete Queue Item

 Enables you to delete items with the 'New' state from a specified queue.

'UiPath.Core.Activities.DeleteQueueItems'

Delete Queue Items from UiPath

Set Transaction Status

This activity is used to set the transaction status of item to Failed or Successful.

Inputs:

  • Output– A collection of additional information about the specific TransactionItem whose status is to be updated.
  • Status– The status that is to be set to the TransactionItem (Failed/Successful).
  • TransactionItem– The TransactionItem whose status is to be updated.

8 Set Transaction Status

Get Queue Items

This activity is one of the important activity to work with the list of transactions at a time. This activity is used to get the list of 100 transaction items from the orchestrator Queue to process, according to priority, state, reference, etc.

These are some of the important activities that are mostly used while working with the orchestrator Queue.

Manage Queues in Orchestrator

The first step is to create the Queue in the Orchestrator.

Navigate: Login to Orchestrator > Click on the Queue Option > Click on the Add (+) icon.

9_Create Queue

Enter the mandatory Queue Name, Description, Unique Reference (Y/N), Auto Retry (Y/N), enter Max Retry if yes and Enable/Disable SLA.

10_Queue Description

Click on the Add button -> Queue Created Successfully.

11_ Queue Edit Details

You can Edit, Monitor, Remove the Queue at any time by clicking on the actions icon.

12_Transaction Details

To view the items in a specific queue you have to click View Transactions. On clicking the Transactions page is displayed where you can view all the items with its status.

13_Queue Transaction Status

Queue Understanding with example

 The example is to add the data into the Queue and process the data. So let's build the process from the studio.

Pre-Requisite: Make sure that the robot is connected with the orchestrator.

We have some data in the Excel and we have to add the data to the Orchestrator Queue that we have created (i.e – TestQueue).

14_Data To be Added to Queue

Let's build the workflow in studio

  1. Create the new blank process and take Simple Sequence with name (GetDataDetails).
  2. Now from Activity panel take Read range activity and give the path of the sheet and store it in Data table (DataDT)
  3. Then to iterate every row in the datatable use For Each row activity
  4. Now take the "Add Queue Item" activity and give the Item Information (collection) as shown below. This is the key value for the items.

UiPath Queues | Working Example Step by Step Guide 1

  • Now provide the Queue name as created in the orchestrator (Same name – "TestQueue") as string.

UiPath Queues | Working Example Step by Step Guide 2

UiPath Queues | Working Example Step by Step Guide 3

  1. Now Run this activity and check. – Execution successful.
  1. Now Go to the Orchestrator and Click on the Queue > Refresh > Actions (View Transactions). Here all the items are added that were in the Data table and will be in "New" state. If you see in the below screenshots all the five records are shown.

UiPath Queues | Working Example Step by Step Guide 4

UiPath Queues | Working Example Step by Step Guide 5

Now to process the data from the Queue we have to use the "Get Transaction Item" activity. So now let's see how it works

  • Take a New sequence and Drag an activity "Get Transaction Item"
  • Give the "Queue Name". With the Queue name it matches the queue and look for the items that are in "New" status.
  • Create variable and store the output as a single item in "TransactionItem" – .
  • Now take an Assign activity and take one variable as "Dob"

[Dob = SingleItemTrans.SpecificContent("DoB").ToString]

  • Run the workflow
  • See the Below screenshots of steps

UiPath Queues | Working Example Step by Step Guide 6

UiPath Queues | Working Example Step by Step Guide 7

Now Check the orchestrator you will observe that the "New" state becomes "In progress"

UiPath Queues | Working Example Step by Step Guide 8

Now we need to check whether the transaction is successful or failed. Take an activity "Set Transaction Status" and set Status – Failed/Successful.

UiPath Queues | Working Example Step by Step Guide 9

Run the activity you will notice in orchestrator that the status of the transaction is "successful" as shown below.

UiPath Queues | Working Example Step by Step Guide 10

Now Click to see the Values with the Key

UiPath Queues | Working Example Step by Step Guide 11

Now if you see the records the items are as per the excel the third item is processed successfully.

UiPath Queues | Working Example Step by Step Guide 12

So this is the small example by which you can work with the Queues in the UiPath.

That's all! Happy Automation!

Conclusion

Queues enable to create of large automation projects underlies by complex logic. The Item Statuses are controlled by the developers of UiPath and the Revision Status are controlled I, Orchestrator.

By Default, the Queue items that have been processed successfully are archived on a daily basis, while the others remain in the queue so that you can decide what to do with them.

How To Create Dictionary In Uipath

Source: https://rpabotsworld.com/working-with-uipath-queues-step-by-step-guide/

Posted by: dellingerknobson.blogspot.com

0 Response to "How To Create Dictionary In Uipath"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel