An Activity Partition is an element in an Activity diagram. It sets the boundary of simulation of an execution. If a Partition represents a property or a Classifier, all Actions and Activity calls inside the Partition will be run using the context of the property or the Classifier, which is represented on the Partition. 

If the Activity Partition represents a part/property, the object playing the Partition is the object playing a part/ property that is represented by the Partition. If the Partition represents an InstanceSpecification, the object which is initialized from such instance specification shall be the object playing the Partition (if there is no object initialized from such instance specification yet, Cameo Simulation toolkit shall initialized when the Behavior execution of the Activity is initialized. 

When there are multiple objects playing an Activity Partition, only the first object that is not busy shall be the one that performs the Action in the Partition and it shall be the context of the Behavior execution invoked by the Action. 

The following figure shows an example of the (Activity) system diagram on which a call Behavior Action is placed within an Activity Partition. The context of the Activity Partition is the runtime objects of workers. When the system model was run, the call Behavior Action was executed in the context of the Activity Partition: workers. But since there were more than one worker, the simulation searched for a worker that was not busy to perform the Behavior. If all the workers were busy, the simulation would wait until one of them was available. If the call Behavior Action were outside the Activity Partition, the context of the Behavior execution would be the system itself. The same also goes for an opaque Action. If it is in the Activity Partition, the simulation will run the opaque Action using the context of the property or the Classifier represented on the Partition. 

Activity Partition Simulation
Activity Partition simulation.

When a call Behavior Action is in an Activity Partition, the following conditions apply

  • If the Behavior of the Action belongs to a Classifier of the object playing the Partition (or super type of such Classifier), the context of the Behavior execution shall be the object playing the Partition.
  • If the Behavior does not belong to the Classifier of the object playing the Partition, but it belongs to the Classifier of the object that is the context of the Activity containing the Action (or super type of such Classifier), the Behavior execution shall be invoked in the context object of the Activity containing the Action.
  • For other cases that cannot be categorized to either (i) or (ii), for example, the Behavior is an OpaqueBehavior or an OpaqueFunction, the context of the Behavior execution shall be the object playing the Partition.