Get resource by ID Version 7 (Java)

Action group: Orchestrator Subgroup: Resource queues


Description

  1. 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.
  2. 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).
  3. 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.
  4. The user has more authority than robots, so they can remove/set the lock regardless of who owns it.
  5. 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.
  6. 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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
IdentifierThe unique identifier of the resource.Robin.String
Yes
Deny readingIf the value is «true», the action will lock the resource for reading and hide it in the queue for other robots.Robin.BooleantrueNo
Deny writingIf 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.BooleantrueNo
Timeout, msThe 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
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

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

  1. Move the "Get resource by ID" action to the workspace and set its parameters.
    1. Specify the resource identifier in the "Identifier" field.
    2. Set the checkbox "Deny reading" to true to block the resource for reading.
    3. Set the checkbox "Deny writing" to true to block the resource for writing.


  2. Move the "Message in log" action to the workspace and set its parameters.
    1. Specify the result (Priority) of the action "Get resource by ID" in the "Message" field.


  3. 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.

  • Нет меток