use of org.camunda.bpm.engine.impl.pvm.PvmActivity in project camunda-bpm-platform by camunda.
the class AbstractBpmnActivityBehavior method createCompensateEventSubscription.
protected void createCompensateEventSubscription(ActivityExecution execution, ActivityImpl compensationHandler) {
// the compensate event subscription is created at subprocess or miBody of the the current activity
PvmActivity currentActivity = execution.getActivity();
ActivityExecution scopeExecution = execution.findExecutionForFlowScope(currentActivity.getFlowScope());
EventSubscriptionEntity.createAndInsert((ExecutionEntity) scopeExecution, EventType.COMPENSATE, compensationHandler);
}
use of org.camunda.bpm.engine.impl.pvm.PvmActivity 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.PvmActivity in project camunda-bpm-platform by camunda.
the class PvmAtomicOperationActivityStartInterruptEventScope method getInterruptingActivity.
protected PvmActivity getInterruptingActivity(PvmExecutionImpl execution) {
PvmActivity nextActivity = execution.getNextActivity();
execution.setNextActivity(null);
return nextActivity;
}
use of org.camunda.bpm.engine.impl.pvm.PvmActivity 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