use of org.camunda.bpm.engine.impl.cmd.StartProcessInstanceAtActivitiesCmd in project camunda-bpm-platform by camunda.
the class ProcessInstantiationBuilderImpl method executeWithVariablesInReturn.
@Override
public ProcessInstanceWithVariables executeWithVariablesInReturn(boolean skipCustomListeners, boolean skipIoMappings) {
ensureOnlyOneNotNull("either process definition id or key must be set", processDefinitionId, processDefinitionKey);
if (isProcessDefinitionTenantIdSet && processDefinitionId != null) {
throw LOG.exceptionStartProcessInstanceByIdAndTenantId();
}
Command<ProcessInstanceWithVariables> command;
if (modificationBuilder.getModificationOperations().isEmpty()) {
if (skipCustomListeners || skipIoMappings) {
throw LOG.exceptionStartProcessInstanceAtStartActivityAndSkipListenersOrMapping();
}
// start at the default start activity
command = new StartProcessInstanceCmd(this);
} else {
// start at any activity using the instructions
modificationBuilder.setSkipCustomListeners(skipCustomListeners);
modificationBuilder.setSkipIoMappings(skipIoMappings);
command = new StartProcessInstanceAtActivitiesCmd(this);
}
return commandExecutor.execute(command);
}
Aggregations