Join
Entity-Related Operation Statement
The Join statement identifies a base Entity and joins a specified Entity type quantity to the base Entity to create a new Entity. The Entity at the Location where the Join statement is executed becomes the base Entity, and the joining Entities must be routed to this Location using the If Join Routing Rule.
Syntax
Join <expression> <entity name> {,<priority>}
Syntax Examples
Join 4 EntA
Join Var1 EntA, 1
Parameters
<expression>
The Entity count to be joined. ProModel ignores a zero value and a negative value generates an error. ProModel evaluates this expression when each Entity first encounters it, but is not re-evaluated as the requested Entities are joined.
<entity name>
The Entity type to be joined to the base Entity. Joining Entities must come from a Join routing and they lose their identity once joined.
{,<priority>}
ProModel joins arriving Entities to an Entity with a higher priority before one with a lower priority. This expression should be a number between 0 and 999.
Parameter Examples
Suppose you have a car factory model where the car base and the car doors are manufactured separately before being joined together at the end of the process. Because the parts are created separately, you need two separate Entities on two different Flow branches: the Entity CarBase and the Entity CarDoor. Once the CarBase Entity is finished and reached an assembly Location, you need to define the statement...
Join 4 CarDoor
...in the assembly Location to indicate that the car base needed four car doors attached to it. You then need to make sure that the CarDoor Entities are routed to the assembly Location using the If Join Routing Rule. The CarBase Entity then waits at the assembly Location until four CarDoor Entities have been completed and travel to the assembly Location. The CarDoor Entities are join onto the CarBase Entity, and the completed car travels to the end of the system.
Additionally, suppose you upgrade to a bigger factory where you create both two-door and four-door models of the same car. The four-door models are more popular, so you want to make sure that they are completed first, but you still only have one part of your factory creating doors. To make sure that the four-door models have the higher priority, define the statement...
Join 2 CarDoor, 1
...at the two-door assembly Location, and the statement...
Join 4 CarDoor, 2
...at the four-door assembly Location. These statements ensure that a CarDoor Entity always tries to go to the four-door assembly Location first if it is able to, and only travels to the two-door assembly Location if there is no CarBase waiting for doors at the four-door assembly Location.
Remarks
When the Join statement is executed, the base Entity waits at its current Location until the joining Entities have reached the specified count. The joining Entities are then joined with the base Entity to create a new Entity. The new Entity retains the Attributes of the base Entity, and so the Attributes of the joining Entities are lost. Any Resources owned by the joining Entities are transferred to the new Entity.
Join is valid in operation logic.