Group and Ungroup
Entity-Related Operation Statement
The Group statement accumulates and temporarily consolidates a specified quantity of Entities into a single Group shell Entity. The shell Entity retains the same Attributes as the first Entity that is grouped into the shell. However, you also have the option to use a Group As statement, which creates a new shell Entity that does not retain any Attribute values, even if the same name is used for the Group shell Entity as the Entities that have been grouped.
The Ungroup statement separates Entities that were grouped by a Group statement.
Syntax
Group <expression> {As <entity name>}
Ungroup {LIFO}
Syntax Examples
Group (Var1+Var2)
Group 10 As EntX
Ungroup
Ungroup LIFO
Parameters
<expression>
The amount of Entities to include in the group.
{As <entity name>}
A Group statement optional part that considers the Group shell Entity a new Entity, defined by the Entity name.
LIFO
An Ungroup statement optional part that stands for Last In First Out. Use LIFO to ungroup Entities in the opposite order that they were grouped.
Parameter Examples
Suppose your model produces and sells Egg Entities. Once the Eggs have been gathered, they move to a Packaging Location. At the Packaging Location, you want to group 12 Egg Entities into a Carton Entity before they are sold. To achieve this result, define the statement...
Group 12 As Carton
...in the Packaging Location Logic.
Now suppose that once your Carton Entities reach your Store Location, you want to ungroup some of them so that the Egg Entities can be used as samples in your Store. To ungroup the Carton Entities back into individual Egg Entities, define the statement...
Ungroup
...in the Store Location Logic.
Remarks
When using a Group statement, the individual Entities comprising the group retain their identities, Attributes, and Resources, and are divided from the group when an Ungroup statement is encountered. The first Entity processed from the group takes any Resources the group owns. Entities in a group can be grouped into a larger group at another Location.
Group may not be used in combination with Combine, Create, Load, Unload, Split As, other Group statements in the same processing logic, or with conveyors. An exception to this rule is that an Ungroup statement may follow a Group statement in the same process.