Get resource by condition Version 7 (Java)

Action group: Orchestrator Subgroup: Resource queues


Description

The action searches for resources based on the specified conditions and returns the first matching resource. If the desired resource is not found, the action waits for it to appear within a specified timeout period

Action icon


Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
Resource queueThe name of the resource queue in which to look for the resource.Robin.String
Yes
TagsA collection of strings where each element is a separate resource tag. The search will be among those resources that have at least one of the listed tags.Robin.Collection
No
StatusThe status that the resource must have.Robin.String
Yes
Min. priorityThe lowest priority value that the resource can have. Together with the value from the «Max. priority» is the search range by priority.Robin.Numeric
No
Max. priorityThe highest priority value that the resource can have. Together with the value from the «Min. priority» is the search range by priority.Robin.Numeric
No
Min. date of creationThe smallest value of the creation date of the resource. Together with the value from the «Max. creation date» is the search range for creation date.Robin.DateTime
No
Max. date of creationThe largest value of the creation date of the resource. Together with the value from the «Min. creation date» is the search range for creation date.Robin.DateTime
No
Min. date of updateThe smallest value of the last update date of the resource. Together with the value from the «Max. date of creation» is the range of the search by the date of the update.Robin.DateTime
No
Max. date of updateThe largest value of the last update date of the resource. Together with the value from the «Min. date of creation» is the range of the search by the date of the update.Robin.DateTime
No
Sorting typeThe sort type of the found resources. The action sorts the found resources and returns only the first resource of those sorted.Robin.String
No
Deny readingIf the value is «true», the action will lock the found resource for reading and hide it in the queue. Other robots will not be able to find the hidden resource when searching by condition.Robin.BooleantrueNo
Deny writingIf the value is «true», the action will lock the found resource for writing to other robots.Robin.BooleantrueNo
Finish processingIf the value is «true», the action will get the value and parameters of the resource and then change its status to «Processed». With this status, the resource will be hidden for robots, even when searching by its ID.Robin.BooleantrueNo
Timeout, msTime to wait for a suitable resource to appear in the queue. If «-1» is specified, the action will wait indefinitely. Specified in milliseconds.Robin.Numeric
No
Results
TagsA collection of strings, where each element is a separate tag of the resource.Robin.Collection

PriorityThe priority of the resource over other resources in the queue.Robin.Numeric

Date of creationThe date and time the resource was created.Robin.DateTime

Date of updateThe date and time the resource was last updated.Robin.DateTime

ValueThe value of the resource.Robin.Object

IdentifierThe unique identifier of the resource.Robin.String

StatusThe status of the resource it had before the activity started.Robin.String

Special conditions of use

None.

Example of use

Task

There is a process where there is a resource queue, get the priority of the first suitable resource with status "New".

Solution

Use the "Get resource by condition", "Message in log" actions.

Implementation

  1. Move the "Get resource by condition" action to the workspace and set its parameters:
    1. Specify the resource queue name where you want to find the resource in the "Resource queue" field.
    2. Specify the status the resource should have in the "Status" field. In this case, specify "In progress".


  2. Move the "Message in log" action to the workspace and set its parameters.
    1. Specify the priority obtained in the "Get resource by condition" action result in the "Message" field.


  3. Click "Start" in the top panel to start the robot.
  • If you want to get a collection of resources with specific tags, you should fill in the "Tags" field, specifying the names of the resource tags.
  • If you want to get a collection of resources with certain priorities, you should fill in the "Min. priority" and "Max. priority" fields.
  • If you want to get a collection of resources grouped by creation date (for example, from 12.08.2022 4:00 to 14.08.2022 4:00), you should specify the dates and times in the corresponding fields: "Min. date of creation", "Max. date of creation". 
  • If you want to get a collection of resources grouped by update date (for example, 15.08.2022 5:00 to 17.08.2022 5:00) you should specify the dates and times in the corresponding fields: "Min. date of update", "Max. date of update".
  • If you want to sort the found resources, you should select the sorting type from the dropdown list of the "Sorting type" parameter. 
  • If you want to finish processing, you should set the "Finish processing" checkbox = true. 
  • If you want to block resources for writing and/or reading, you should check the checkbox in the fields: "Deny reading"/"Deny writing". 

    Queue resources can be denied by the robot (reading or writing).

    • only reading - when resources are blocked for reading, by default they are also hidden in the queue (hidden for search), i.e. they cannot be retrieved by actions with search by condition; by action of retrieving by ID the resources will become visible, but the robot will freeze on the resource waiting for the blocking to be removed (depending on the timeout set).
    • writing only - when resources are blocked for writing (by a robot or a user), another robot cannot change their values.
    • both reading and writing - two conditions described above are simultaneously met, i.e., the robot can neither modify the resources nor read them.

Result

The program robot completed successfully.

The first matching resource with the status "New" has been prioritized. The message is output to the log.

  • Нет меток