Class GetActivityInstanceCmd

All Implemented Interfaces:

public class GetActivityInstanceCmd extends Object implements Command<ActivityInstance>

Creates an activity instance tree according to the following strategy:

  • Event scope executions are not considered at all
  • For every leaf execution, generate an activity/transition instance; the activity instance id is set in the leaf execution and the parent instance id is set in the parent execution
  • For every non-leaf scope execution, generate an activity instance; the activity instance id is always set in the parent execution and the parent activity instance id is always set in the parent's parent (because of tree compactation, we ensure that an activity instance id for a scope activity is always stored in the corresponding scope execution's parent, unless the execution is a leaf)
  • Compensation is an exception to the above procedure: A compensation throw event is not a scope, however the compensating executions are added as child executions of the (probably non-scope) execution executing the throw event. Logically, the compensating executions are children of the scope execution the throwing event is executed in. Due to this oddity, the activity instance id are stored on different executions
Thorben Lindhauer