use of org.camunda.bpm.engine.rest.dto.runtime.modification.ProcessInstanceModificationInstructionDto in project camunda-bpm-platform by camunda.
the class ProcessDefinitionResourceImpl method startProcessInstanceAtActivities.
protected ProcessInstanceWithVariables startProcessInstanceAtActivities(StartProcessInstanceDto dto) {
Map<String, Object> processInstanceVariables = VariableValueDto.toMap(dto.getVariables(), engine, objectMapper);
String businessKey = dto.getBusinessKey();
String caseInstanceId = dto.getCaseInstanceId();
ProcessInstantiationBuilder instantiationBuilder = engine.getRuntimeService().createProcessInstanceById(processDefinitionId).businessKey(businessKey).caseInstanceId(caseInstanceId).setVariables(processInstanceVariables);
if (dto.getStartInstructions() != null && !dto.getStartInstructions().isEmpty()) {
for (ProcessInstanceModificationInstructionDto instruction : dto.getStartInstructions()) {
instruction.applyTo(instantiationBuilder, engine, objectMapper);
}
}
return instantiationBuilder.executeWithVariablesInReturn(dto.isSkipCustomListeners(), dto.isSkipIoMappings());
}
Aggregations