use of org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl in project camunda-bpm-platform by camunda.
the class PvmAtomicOperationActivityInstanceEnd method eventNotificationsStarted.
@Override
protected PvmExecutionImpl eventNotificationsStarted(PvmExecutionImpl execution) {
execution.incrementSequenceCounter();
// hack around execution tree structure not being in sync with activity instance concept:
// if we end a scope activity, take remembered activity instance from parent and set on
// execution before calling END listeners.
PvmExecutionImpl parent = execution.getParent();
PvmActivity activity = execution.getActivity();
if (parent != null && execution.isScope() && activity != null && activity.isScope() && (activity.getActivityBehavior() instanceof CompositeActivityBehavior || (CompensationBehavior.isCompensationThrowing(execution)) && !LegacyBehavior.isCompensationThrowing(execution))) {
LOG.debugLeavesActivityInstance(execution, execution.getActivityInstanceId());
// use remembered activity instance id from parent
execution.setActivityInstanceId(parent.getActivityInstanceId());
// make parent go one scope up.
parent.leaveActivityInstance();
}
return execution;
}
use of org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl in project camunda-bpm-platform by camunda.
the class PvmAtomicOperationDeleteCascade method execute.
public void execute(PvmExecutionImpl execution) {
PvmExecutionImpl nextLeaf;
do {
nextLeaf = findNextLeaf(execution);
// propagate skipCustomListeners property
PvmExecutionImpl deleteRoot = getDeleteRoot(execution);
if (deleteRoot != null) {
nextLeaf.setSkipCustomListeners(deleteRoot.isSkipCustomListeners());
nextLeaf.setSkipIoMappings(deleteRoot.isSkipIoMappings());
}
PvmExecutionImpl subProcessInstance = nextLeaf.getSubProcessInstance();
if (subProcessInstance != null) {
if (deleteRoot.isSkipSubprocesses()) {
subProcessInstance.setSuperExecution(null);
} else {
subProcessInstance.deleteCascade(execution.getDeleteReason(), nextLeaf.isSkipCustomListeners(), nextLeaf.isSkipIoMappings());
}
}
nextLeaf.performOperation(DELETE_CASCADE_FIRE_ACTIVITY_END);
} while (!nextLeaf.isDeleteRoot());
}
use of org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl in project camunda-bpm-platform by camunda.
the class PvmAtomicOperationInterruptScope method execute.
public void execute(PvmExecutionImpl execution) {
PvmActivity interruptingActivity = getInterruptingActivity(execution);
PvmExecutionImpl scopeExecution = !execution.isScope() ? execution.getParent() : execution;
if (scopeExecution != execution) {
// remove the current execution before interrupting and continuing executing the interrupted activity
// reason:
// * interrupting should not attempt to fire end events for this execution
// * the interruptingActivity is executed with the scope execution
execution.remove();
}
scopeExecution.interrupt("Interrupting activity " + interruptingActivity + " executed.");
scopeExecution.setActivity(interruptingActivity);
scopeExecution.setActive(true);
scopeExecution.setTransition(execution.getTransition());
scopeInterrupted(scopeExecution);
}
Aggregations