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
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Resource queue | The name of the resource queue in which to look for the resource. | Robin.String | Yes | |
Tags | A 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 | |
Status | The status that the resource must have. | Robin.String | Yes | |
Min. priority | The 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. priority | The 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 creation | The 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 creation | The 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 update | The 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 update | The 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 type | The 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 reading | If 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.Boolean | true | No |
Deny writing | If the value is «true», the action will lock the found resource for writing to other robots. | Robin.Boolean | true | No |
Finish processing | If 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.Boolean | true | No |
Timeout, ms | Time 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 | ||||
Tags | A collection of strings, where each element is a separate tag of the resource. | Robin.Collection | ||
Priority | The priority of the resource over other resources in the queue. | Robin.Numeric | ||
Date of creation | The date and time the resource was created. | Robin.DateTime | ||
Date of update | The date and time the resource was last updated. | Robin.DateTime | ||
Value | The value of the resource. | Robin.Object | ||
Identifier | The unique identifier of the resource. | Robin.String | ||
Status | The 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
- Move the "Get resource by condition" action to the workspace and set its parameters:
- Specify the resource queue name where you want to find the resource in the "Resource queue" field.
- Specify the status the resource should have in the "Status" field. In this case, specify "In progress".
- Move the "Message in log" action to the workspace and set its parameters.
- Specify the priority obtained in the "Get resource by condition" action result in the "Message" field.
- Specify the priority obtained in the "Get resource by condition" action result in the "Message" field.
- 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.
Обзор
Инструменты контента