Get resource by ID Version 7 (Java)
Action group: Orchestrator Subgroup: Resource queues
Description
- The action searches for a resource by the specified identifier and returns its value and parameters. The action sends a request to get the value and parameters of the resource created in the resource queue in the Orchestrator database. The resource is searched by the specified resource identifier.
- The specified resource will be searched according to the following rules:
- If the robot project is started, the resource with the specified identifier will be searched only in the tenant under which the user logged into the Studio. If the resource is found, respectively, there is access to work with it.
- If you run a ready-made robot, the search for a resource with the specified identifier will be performed only in the tenant to which the robot is added (added either to the tenant itself or to its group).
- The action can lock a resource for reading or writing if the corresponding input parameters are activated. When a resource is locked, this robot instance becomes the owner of the set lock type. Being the owner of a lock means that only the same robot instance can release such a lock. And 2 different launches of the same robot (2 different instances) are considered as different owners.
- The user has more authority than robots, so they can remove/set the lock regardless of who owns it.
- If the resource is already blocked for reading and the initiator is not the given robot instance, the action stands in wait for this blocking to be removed.
- If an action should lock a resource to write, but it is already locked to write by a user or another robot instance, the action waits for that lock to be lifted. If the resource is blocked for writing, but the action should not set this type of blocking, the wait to remove the write block does not occur, it is simply ignored.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Identifier | The unique identifier of the resource. | Robin.String | Yes | |
Deny reading | If the value is «true», the action will lock the resource for reading and hide it in the queue for other robots. | Robin.Boolean | true | No |
Deny writing | If the value is «true», the action will lock the resource for writing to other robots. But if the resource is already write-locked by another initiator, the action will wait until the lock is released. If set to false, the action ignores the write lock. | Robin.Boolean | true | No |
Timeout, ms | The time to wait for the lock to be released from the resource. Specified in milliseconds. If «-1» is specified, the action will wait indefinitely. | 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 |
Special conditions of use
None.
Example of use
Task
There is a resource, close it for reading and writing, and get the priority of the resource.
Solution
Use the "Get resource by ID", "Message in log" actions.
Implementation
- Move the "Get resource by ID" action to the workspace and set its parameters.
- Specify the resource identifier in the "Identifier" field.
- Set the checkbox "Deny reading" to true to block the resource for reading.
- Set the checkbox "Deny writing" to true to block the resource for writing.
- Move the "Message in log" action to the workspace and set its parameters.
- Specify the result (Priority) of the action "Get resource by ID" in the "Message" field.
- Specify the result (Priority) of the action "Get resource by ID" in the "Message" field.
- Click "Start" in the top panel to start the robot.
Result
The program robot completed successfully. The resource is blocked for reading and writing, and the resource priority was output in the log.
Обзор
Инструменты контента