use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class ParallelGatewayActivityBehavior method execute.
public void execute(ActivityExecution execution) throws Exception {
// Join
PvmActivity activity = execution.getActivity();
List<PvmTransition> outgoingTransitions = execution.getActivity().getOutgoingTransitions();
execution.inactivate();
lockConcurrentRoot(execution);
List<ActivityExecution> joinedExecutions = execution.findInactiveConcurrentExecutions(activity);
int nbrOfExecutionsToJoin = execution.getActivity().getIncomingTransitions().size();
int nbrOfExecutionsJoined = joinedExecutions.size();
if (nbrOfExecutionsJoined == nbrOfExecutionsToJoin) {
// Fork
LOG.activityActivation(activity.getId(), nbrOfExecutionsJoined, nbrOfExecutionsToJoin);
execution.leaveActivityViaTransitions(outgoingTransitions, joinedExecutions);
} else {
LOG.noActivityActivation(activity.getId(), nbrOfExecutionsJoined, nbrOfExecutionsToJoin);
}
}
use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class ExternalTaskEntity method bpmnError.
public void bpmnError(String errorCode) {
ensureActive();
ActivityExecution activityExecution = getExecution();
BpmnError bpmnError = new BpmnError(errorCode);
try {
ExternalTaskActivityBehavior behavior = ((ExternalTaskActivityBehavior) activityExecution.getActivity().getActivityBehavior());
behavior.propagateBpmnError(bpmnError, activityExecution);
} catch (Exception ex) {
throw ProcessEngineLogger.CMD_LOGGER.exceptionBpmnErrorPropagationFailed(errorCode, ex);
}
}
use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class ParallelMultiInstanceActivityBehavior method createConcurrentExecution.
protected ActivityExecution createConcurrentExecution(ActivityExecution scopeExecution) {
ActivityExecution concurrentChild = scopeExecution.createExecution();
scopeExecution.forceUpdate();
concurrentChild.setConcurrent(true);
concurrentChild.setScope(false);
return concurrentChild;
}
use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class ParallelMultiInstanceActivityBehavior method destroyInnerInstance.
@Override
public void destroyInnerInstance(ActivityExecution concurrentExecution) {
ActivityExecution scopeExecution = concurrentExecution.getParent();
concurrentExecution.remove();
scopeExecution.forceUpdate();
int nrOfActiveInstances = getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES);
setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfActiveInstances - 1);
}
use of org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution in project camunda-bpm-platform by camunda.
the class ParallelMultiInstanceActivityBehavior method createInnerInstance.
@Override
public ActivityExecution createInnerInstance(ActivityExecution scopeExecution) {
// even though there is only one instance, there is always a concurrent child
ActivityExecution concurrentChild = createConcurrentExecution(scopeExecution);
int nrOfInstances = getLoopVariable(scopeExecution, NUMBER_OF_INSTANCES);
setLoopVariable(scopeExecution, NUMBER_OF_INSTANCES, nrOfInstances + 1);
int nrOfActiveInstances = getLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES);
setLoopVariable(scopeExecution, NUMBER_OF_ACTIVE_INSTANCES, nrOfActiveInstances + 1);
setLoopVariable(concurrentChild, LOOP_COUNTER, nrOfInstances);
return concurrentChild;
}
Aggregations