use of org.camunda.bpm.engine.impl.pvm.runtime.ExecutionStartContext in project camunda-bpm-platform by camunda.
the class PvmAtomicOperationActivityInitStackNotifyListenerReturn method eventNotificationsCompleted.
protected void eventNotificationsCompleted(PvmExecutionImpl execution) {
super.eventNotificationsCompleted(execution);
ExecutionStartContext startContext = execution.getExecutionStartContext();
InstantiationStack instantiationStack = startContext.getInstantiationStack();
// if the stack has been instantiated
if (instantiationStack.getActivities().isEmpty()) {
// done
return;
} else {
// else instantiate the activity stack further
execution.setActivity(null);
execution.performOperation(ACTIVITY_INIT_STACK_AND_RETURN);
}
}
use of org.camunda.bpm.engine.impl.pvm.runtime.ExecutionStartContext in project camunda-bpm-platform by camunda.
the class PvmAtomicOperationActivityStart method eventNotificationsCompleted.
@Override
protected void eventNotificationsCompleted(PvmExecutionImpl execution) {
super.eventNotificationsCompleted(execution);
ExecutionStartContext executionStartContext = execution.getExecutionStartContext();
if (executionStartContext != null) {
executionStartContext.executionStarted(execution);
execution.disposeExecutionStartContext();
}
execution.dispatchDelayedEventsAndPerformOperation(ACTIVITY_EXECUTE);
}
use of org.camunda.bpm.engine.impl.pvm.runtime.ExecutionStartContext 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.runtime.ExecutionStartContext in project camunda-bpm-platform by camunda.
the class PvmAtomicOperationActivityInitStackNotifyListenerStart method eventNotificationsCompleted.
protected void eventNotificationsCompleted(PvmExecutionImpl execution) {
super.eventNotificationsCompleted(execution);
execution.activityInstanceStarted();
ExecutionStartContext startContext = execution.getExecutionStartContext();
InstantiationStack instantiationStack = startContext.getInstantiationStack();
PvmExecutionImpl propagatingExecution = execution;
ActivityImpl activity = execution.getActivity();
if (activity.getActivityBehavior() instanceof ModificationObserverBehavior) {
ModificationObserverBehavior behavior = (ModificationObserverBehavior) activity.getActivityBehavior();
List<ActivityExecution> concurrentExecutions = behavior.initializeScope(propagatingExecution, 1);
propagatingExecution = (PvmExecutionImpl) concurrentExecutions.get(0);
}
// if the stack has been instantiated
if (instantiationStack.getActivities().isEmpty() && instantiationStack.getTargetActivity() != null) {
// as if we are entering the target activity instance id via a transition
propagatingExecution.setActivityInstanceId(null);
// execute the target activity with this execution
startContext.applyVariables(propagatingExecution);
propagatingExecution.setActivity(instantiationStack.getTargetActivity());
propagatingExecution.performOperation(ACTIVITY_START_CREATE_SCOPE);
} else if (instantiationStack.getActivities().isEmpty() && instantiationStack.getTargetTransition() != null) {
// as if we are entering the target activity instance id via a transition
propagatingExecution.setActivityInstanceId(null);
// execute the target transition with this execution
PvmTransition transition = instantiationStack.getTargetTransition();
startContext.applyVariables(propagatingExecution);
propagatingExecution.setActivity(transition.getSource());
propagatingExecution.setTransition((TransitionImpl) transition);
propagatingExecution.performOperation(TRANSITION_START_NOTIFY_LISTENER_TAKE);
} else {
// else instantiate the activity stack further
propagatingExecution.setActivity(null);
propagatingExecution.performOperation(ACTIVITY_INIT_STACK);
}
}
use of org.camunda.bpm.engine.impl.pvm.runtime.ExecutionStartContext 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);
}
Aggregations