The Get statement enables an entity to obtain a resource. In addition to being short and easy to use for capturing a single resource. The Get statement has one primary function — When capturing multiple resources, hold on to any requested resource available while waiting for the remaining to become available. In all other instances of requesting a resource a JointlyGet is preferred.
If you get and free your resources in action logic (rather than with a connector line), the entity must enter the activity before it knows whether a resource is available or not. Therefore, if the resource is not available and the entity must wait “in” the activity for the resource to be available as compared to the GET/FREE route where the entity will wait at the input queue for the resource to be available before entering the activity.
To have the GET/ FREE action logic to behave in the same manner as the GET / FREE routes, add an extra activity that will server as the input queue, before the the activity where you want the resource to work. Remove the input/output queue from the new activity as well as the working activity. Change the capacity of the new activity to the input queu size for the work activity and GET the resource at the new activity.
Syntax
GET [ quantity ] resource, [ priority ]
GET [ quantity ] resource, [ priority ] AND [ quantity ] resource, [ priority ]
GET [ quantity ] resource, [ priority ] OR [ quantity ] resource, [ priority]
[quantity] You can optionally specify the number of resources to get if the resource has multiple units defined for it. (The square brackets illustrate only that this element is optional.)
- By default, quantity is equal to one unit of the resource.
resource The name of the resource to be captured.
AND Used to capture more than one resource as each becomes available.
OR Used to capture one resource or the other. Useful for situations where one of several resources could be used to accomplish the same thing.
[priority] You can optionally specify the priority level to get the resource (0-99). The higher the number, the higher priority. A priority above 99 will become an interrupt priority, to learn more see What is a Resource Priority (The square brackets illustrate only that this element is optional.)
Example
The following examples demonstrate the use of the GET statement. The first shows a simple request for a resource called Operator . The second tests the Size attribute to determine whether or not the Operator and Helper are needed. Notice the Helper lists first, and is captured even if the operator remains busy. And the third requests three units of the resource called Operator.
1) GET Operator
2) IF Size > 10 THEN GET Helper AND Operator
3) GET 3 Operator
- Connected resources capture before resources specified in a GET statement. On the other hand, resource connections that free a resource occur after any Action logic for the activity.