How do I use the Contents() Function?

Returns the total number of entities at an activity. Use CONTENTS(name of activity) to make decisions based on how busy an activity is. Using CONTENTS() to keep track of the number of entities at an activity requires fewer steps and allows more flexibility than using variables to count the number of entities that enter and exit an activity. For example, the second syntax does in one statement what would require several statements without the CONTENTS() function.


A car wash has an activity called Wash that often gets too busy for one operator to handle so the supervisor then comes to help. The logic below models this situation with an IF…THEN statement and the CONTENTS() function. As long as the activity contains fewer than three cars, the worker processes any arriving car. However, if the contents of the activity are greater than three, the Supervisor may also be used.

GET Worker
GET Worker OR Supervisor


Was this article helpful?

Related Articles