use of org.camunda.bpm.engine.impl.pvm.PvmActivity in project camunda-bpm-platform by camunda.
the class FoxAtomicOperationDeleteCascadeFireActivityEnd method eventNotificationsCompleted.
@Override
protected void eventNotificationsCompleted(PvmExecutionImpl execution) {
PvmActivity activity = execution.getActivity();
if ((execution.isScope()) && (activity != null) && (!activity.isScope())) {
execution.setActivity((PvmActivity) activity.getFlowScope());
execution.performOperation(this);
} else {
if (execution.isScope()) {
execution.destroy();
}
execution.remove();
}
}
use of org.camunda.bpm.engine.impl.pvm.PvmActivity in project camunda-bpm-platform by camunda.
the class PvmAtomicOperationActivityInitStack method execute.
public void execute(PvmExecutionImpl execution) {
ExecutionStartContext executionStartContext = execution.getExecutionStartContext();
InstantiationStack instantiationStack = executionStartContext.getInstantiationStack();
List<PvmActivity> activityStack = instantiationStack.getActivities();
PvmActivity currentActivity = activityStack.remove(0);
PvmExecutionImpl propagatingExecution = execution;
if (currentActivity.isScope()) {
propagatingExecution = execution.createExecution();
execution.setActive(false);
propagatingExecution.setActivity(currentActivity);
propagatingExecution.initialize();
} else {
propagatingExecution.setActivity(currentActivity);
}
// notify listeners for the instantiated activity
propagatingExecution.performOperation(operationOnScopeInitialization);
}
use of org.camunda.bpm.engine.impl.pvm.PvmActivity in project camunda-bpm-platform by camunda.
the class PvmAtomicOperationTransitionNotifyListenerStart method eventNotificationsCompleted.
protected void eventNotificationsCompleted(PvmExecutionImpl execution) {
super.eventNotificationsCompleted(execution);
TransitionImpl transition = execution.getTransition();
PvmActivity destination;
if (transition == null) {
// this is null after async cont. -> transition is not stored in execution
destination = execution.getActivity();
} else {
destination = transition.getDestination();
}
execution.setTransition(null);
execution.setActivity(destination);
ExecutionStartContext executionStartContext = execution.getExecutionStartContext();
if (executionStartContext != null) {
executionStartContext.executionStarted(execution);
execution.disposeExecutionStartContext();
}
execution.dispatchDelayedEventsAndPerformOperation(ACTIVITY_EXECUTE);
}
use of org.camunda.bpm.engine.impl.pvm.PvmActivity in project camunda-bpm-platform by camunda.
the class ActivityBeforeInstantiationCmd method execute.
@Override
public Void execute(CommandContext commandContext) {
ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId);
ProcessDefinitionImpl processDefinition = processInstance.getProcessDefinition();
PvmActivity activity = processDefinition.findActivity(activityId);
// forbid instantiation of compensation boundary events
if (activity != null && "compensationBoundaryCatch".equals(activity.getProperty("type"))) {
throw new ProcessEngineException("Cannot start before activity " + activityId + "; activity " + "is a compensation boundary event.");
}
return super.execute(commandContext);
}
use of org.camunda.bpm.engine.impl.pvm.PvmActivity in project camunda-bpm-platform by camunda.
the class ActivityAfterInstantiationCmd method findTransition.
protected TransitionImpl findTransition(ProcessDefinitionImpl processDefinition) {
PvmActivity activity = processDefinition.findActivity(activityId);
EnsureUtil.ensureNotNull(NotValidException.class, describeFailure("Activity '" + activityId + "' does not exist"), "activity", activity);
if (activity.getOutgoingTransitions().isEmpty()) {
throw new ProcessEngineException("Cannot start after activity " + activityId + "; activity " + "has no outgoing sequence flow to take");
} else if (activity.getOutgoingTransitions().size() > 1) {
throw new ProcessEngineException("Cannot start after activity " + activityId + "; " + "activity has more than one outgoing sequence flow");
}
return (TransitionImpl) activity.getOutgoingTransitions().get(0);
}
Aggregations