Skip to content

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.

PropertyWhat it returns
Entity.AgeTime since the entity was created, in minutes.
Entity.TimeSinceEntryTime since it entered the current activity.
Entity.TotalCostCost accumulated so far.
Entity.VATimeMinutes spent at value-added activities.
Entity.NVATimeMinutes spent at non-value-added activities and in queues.
Entity.RNVATimeMinutes spent at required non-value-added activities.
Entity.TypeNameThe entity’s type, for example "Order".
Entity.NameIts name, including any set with NEWNAME.
Entity.IdIts unique number (also available as the bare Id).
Entity.GroupQtyHow many entities the current group holds. An entity travelling on its own is a group of one, so this is never 0.
Entity.HeldResourceCountHow 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.

Each line below is a complete piece of action logic, with a // note saying what it does.

How long the entity has been around:

// Minutes since this entity was created
SET a_AgeNow TO Entity.Age
// Minutes since it entered the activity it is in now
IF Entity.TimeSinceEntry > 30 THEN DISPLAY "Held here over half an hour" ENDIF

What it has cost, and where that time went:

// Cost the entity has picked up so far
SET v_RunningCost TO Entity.TotalCost
// Split its time three ways for a value-stream summary
SET a_Value TO Entity.VATime
SET a_Waste TO Entity.NVATime
SET a_Needed TO Entity.RNVATime

Which entity this is:

// Branch on the entity type; TypeName is text, so quote the comparison
IF Entity.TypeName = "Rush" THEN GET 1, Expert ENDIF
// Its current name, which NEWNAME may have changed along the way
IF Entity.Name = "Job_7" THEN DISPLAY "Job 7 reached inspection" ENDIF
// Its unique number, the reliable way to trace one entity through a run
DISPLAY "Now at inspection: {Entity.Id}"
// Entities in the group, so a check can take longer for a bigger batch; 1 on its own
SET a_BatchSize TO Entity.GroupQty

Two properties read what the entity is currently holding:

// How many resource units it holds at this moment
SET a_Held TO Entity.HeldResourceCount
// The name of the one it captured most recently, handed straight to a FREE
FREE Entity.HeldResourceName()

Entity.HeldResourceName() comes in two forms:

FormWhich resource it names
Entity.HeldResourceName()The one captured most recently.
Entity.HeldResourceName(n)The nth by how long it has been held: (1) is the longest-held, (2) the next, and so on up to Entity.HeldResourceCount.
// Release the resource it has held longest, keeping the rest
FREE Entity.HeldResourceName(1)

Both forms hand back empty text when there is no resource to name: when the entity is holding nothing at all, and when n is past Entity.HeldResourceCount. Read the count first whenever the logic that follows depends on getting a name back:

// Only free a resource when the entity is actually holding one
IF Entity.HeldResourceCount > 0 THEN FREE Entity.HeldResourceName() ENDIF

This replaces the old OwnedResource() function from earlier versions.

LegacyHow this worked in the previous version

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/)

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/)