protected void postTransitionNotification(CmmnExecution execution) {
if (!execution.isCaseInstanceExecution()) {
execution.remove();
} else {
CmmnExecution superCaseExecution = execution.getSuperCaseExecution();
TransferVariablesActivityBehavior behavior = null;
if (superCaseExecution != null) {
behavior = (TransferVariablesActivityBehavior) getActivityBehavior(superCaseExecution);
behavior.transferVariables(execution, superCaseExecution);
superCaseExecution.complete();
}
}
CmmnExecution parent = execution.getParent();
if (parent != null) {
CmmnActivityBehavior behavior = getActivityBehavior(parent);
if (behavior instanceof CompositeActivityBehavior) {
CompositeActivityBehavior compositeBehavior = (CompositeActivityBehavior) behavior;
compositeBehavior.handleChildCompletion(parent, execution);