Resource Queries
Resource queries read the state of a resource. Name the resource in quotes.
| Query | What it returns |
|---|---|
Resource('X').FreeUnits | Units currently free. |
Resource('X').Available | 1 if any unit is free, 0 if none. |
Resource('X').Utilization | Fraction of time in use, from 0 to 1. |
Resource('X').OnShift | 1 if the resource is on shift, 0 if off. |
Resource('X').Qty | Units of the resource the current entity holds. |
Resource('X').WaitCount | Entities waiting for the resource. |
Resource('X').DownQty | Units currently down. |
Examples
Section titled “Examples”Take a shortcut only when a specialist is free:
IF Resource('Specialist').FreeUnits > 0 THEN GET 1, Specialist ENDIFRecord a resource’s utilization for reporting:
SET v_DoctorUse TO Resource('Doctor').UtilizationLegacyHow this worked in the previous version
FreeUnits() function
Section titled “FreeUnits() function”Returns the free units of an activity or resource (an integer).
Example
The example below demonstrates the use of the FREEUNITS() function to adjust the processing time for an entity based on the number of units of a resource available to process it. Once a Plane arrives at a passenger gate, it captures a certain number of resources named BH (Baggage Handlers). Operation logic at the gate determines how many BH resources have been captured and, accordingly, how long it will take to service the Plane. The more Baggage Handlers a Plane captures, the less time it takes to service it.
V0hJTEUgRlJFRVVOSVRTKEJIKSA8MwoJewoJRE8gVElNRSgyIG1pbikKCX0KSUYgRlJFRVVOSVRTKEJIKT49NSBUSEVOIHtHRVQgNSBCSH0KRUxTRQoJewoJR0VUIEZSRUVVTklUUyhCSCkgQkgKCVRJTUUoNjAvUkVTUVRZKEJIKSBtaW4pCgl9
ResQty() function
Section titled “ResQty() function”Returns the number of units of a specific resource that the current entity owns. You can use RESQTY() to determine the amount of time necessary to process an entity based on the number of units of a resource the entity owns.
Example
The example below demonstrates the use of RESQTY() to adjust the processing time for an entity based on the number of resources available to process it. Once a Plane arrives at a passenger gate, it captures a certain number of resources named BH (Baggage Handlers). Operation logic at the gate determines how many BH resources have been captured and, accordingly, how long it will take to service the Plane. The more Baggage Handlers a Plane captures, the less time it takes to service it.
SUYgRlJFRVVOSVRTKEJIKT49NSBUSEVOIHtHRVQgNSBCSH0KRUxTRQoJewoJR0VUIEZSRUVVTklUUyhCSCkgQkgKCX0KVElNRSg0NS9SRVNRVFkoQkgpIG1pbik=
Percent() function
Section titled “Percent() function”The percent function allows you to execute one or more statements only a certain percentage of the time. Used in an IF…THEN statement, the function returns a TRUE or FALSE.
To use the percent function, enter PERCENT(n) where n is the percentage of the time that the statement will return a TRUE condition in an IF…THEN statement.
Example
In the first example, logic following the THEN statement is executed 21.5% of the time. In the second, logic following the THEN statement is executed 35% of the time and the logic following the ELSE statement is executed 65% of the time.
MSkgSUYgUEVSQ0VOVCgyMS41KSBUSEVO4oCmCjIpIElGIFBFUkNFTlQoMzUpIFRIRU7igKYKRUxTReKApg==

