Entity Properties
An entity property is a value carried by the entity that is currently being processed. Unlike an attribute, which you define yourself, these are built in and always available.
| Property | What it returns |
|---|---|
Entity.Age | Time since the entity was created, in minutes. |
Entity.TimeSinceEntry | Time since it entered the current activity. |
Entity.TotalCost | Cost accumulated so far. |
Entity.VATime | Minutes spent at value-added activities. |
Entity.NVATime | Minutes spent at non-value-added activities and in queues. |
Entity.RNVATime | Minutes spent at required non-value-added activities. |
Entity.TypeName | The entity’s type, for example "Order". |
Entity.Name | Its name, including any set with NEWNAME. |
Entity.Id | Its unique number (also available as the bare Id). |
Entity.GroupQty | How many members a batch is carrying. |
Entity.HeldResourceCount | How many resource units it currently holds. |
Entity.HeldResourceName() | The name of a resource it holds (see below). |
Entity.TypeName and Entity.Name are text, so compare them with quotes: IF Entity.TypeName = "Rush" THEN .... The value-added timers (VATime, NVATime, RNVATime) can also be set, to start an entity as though it had already spent time in the model.
The resource an entity holds
Section titled “The resource an entity holds”Entity.HeldResourceName() gives the name of a resource the entity currently owns, which you can hand straight to a FREE:
FREE Entity.HeldResourceName()With a number, Entity.HeldResourceName(1) is the longest-held resource, Entity.HeldResourceName(2) the next, and so on up to Entity.HeldResourceCount; with no number it is the most recently captured. This replaces the old OwnedResource() function from earlier versions.
LegacyHow this worked in the previous version
GroupQty() function
Section titled “GroupQty() function”Returns the number of entities in a batched or loaded entity (a loaded entity is an entity with other entities attached to it). If the entity is a loaded entity, it will return only the number of loaded entities, not the base entity. For example, if you attach four Castings to a Pallet, the GroupQty() will return the number of Castings (i.e. 4), which does not include the entity Pallet.
In the case of multiple levels of groups and loads, GroupQty() returns the number of entities in the uppermost level only.
Example
A group of documents called Folder arrives at the Secretary in-box and is processed for some amount of time according to the number of documents in the folder. Each document takes 3.0 minutes to process.
VElNRSAoR1JPVVBRVFkoKSAqMy4wIG1pbik=
[
Functions
](/help/functions/)
OwnedResource() function
Section titled “OwnedResource() function”Returns the n th resource currently being used by the entity. Each resource is referenced according to the order it was put into use so that the longest held resource is OwnedResource(1). The most recently captured resource can be referenced by omitting the number: OwnedResource().
Example
The **OwnedResource() **function is useful when a decision must be made based on the resource that was captured. For example, suppose an entity captures either Worker_1 or Worker_2 in order to perform an activity. If Worker_1 is used, the activity takes 5 minutes. If Worker_2 is used, the activity takes 6.5 minutes. This can be defined using the following Action logic.
R0VUIFdvcmtlcl8xIE9SIFdvcmtlcl8yCklGIE9XTkVEUkVTT1VSQ0UoKSA9IFdvcmtlcl8xIFRIRU4ge1RJTUUoNS4wIG1pbil9CkVMU0Uge1RJTUUoNi41IG1pbil9CkZSRUUgT1dORURSRVNPVVJDRSgp
- This function cannot be assigned a resource name in Action logic. For example, an assignment statement like OwnedResource() = Worker_1 will generate an error.
Functions
](/help/functions/)

