Search in sources :

Example 11 with TransitionImpl

use of org.camunda.bpm.engine.impl.pvm.process.TransitionImpl 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);
}
Also used : TransitionImpl(org.camunda.bpm.engine.impl.pvm.process.TransitionImpl) PvmActivity(org.camunda.bpm.engine.impl.pvm.PvmActivity) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Aggregations

TransitionImpl (org.camunda.bpm.engine.impl.pvm.process.TransitionImpl)11 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)8 PvmActivity (org.camunda.bpm.engine.impl.pvm.PvmActivity)4 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)3 PvmTransition (org.camunda.bpm.engine.impl.pvm.PvmTransition)3 CoreModelElement (org.camunda.bpm.engine.impl.core.model.CoreModelElement)2 AsyncContinuationConfiguration (org.camunda.bpm.engine.impl.jobexecutor.AsyncContinuationJobHandler.AsyncContinuationConfiguration)2 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)2 ProcessDefinitionImpl (org.camunda.bpm.engine.impl.pvm.process.ProcessDefinitionImpl)2 ExecutionStartContext (org.camunda.bpm.engine.impl.pvm.runtime.ExecutionStartContext)2 NotValidException (org.camunda.bpm.engine.exception.NotValidException)1 ActivityExecutionTreeMapping (org.camunda.bpm.engine.impl.ActivityExecutionTreeMapping)1 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)1 CommandExecutor (org.camunda.bpm.engine.impl.interceptor.CommandExecutor)1 MigratingJobInstance (org.camunda.bpm.engine.impl.migration.instance.MigratingJobInstance)1 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)1 PvmScope (org.camunda.bpm.engine.impl.pvm.PvmScope)1 ActivityExecution (org.camunda.bpm.engine.impl.pvm.delegate.ActivityExecution)1 ModificationObserverBehavior (org.camunda.bpm.engine.impl.pvm.delegate.ModificationObserverBehavior)1 ActivityStartBehavior (org.camunda.bpm.engine.impl.pvm.process.ActivityStartBehavior)1