use of org.camunda.bpm.engine.runtime.RestartProcessInstanceBuilder in project camunda-bpm-platform by camunda.
the class ProcessDefinitionResourceImpl method createRestartProcessInstanceBuilder.
private RestartProcessInstanceBuilder createRestartProcessInstanceBuilder(RestartProcessInstanceDto restartProcessInstanceDto) {
RuntimeService runtimeService = engine.getRuntimeService();
RestartProcessInstanceBuilder builder = runtimeService.restartProcessInstances(processDefinitionId);
if (restartProcessInstanceDto.getProcessInstanceIds() != null) {
builder.processInstanceIds(restartProcessInstanceDto.getProcessInstanceIds());
}
if (restartProcessInstanceDto.getHistoricProcessInstanceQuery() != null) {
builder.historicProcessInstanceQuery(restartProcessInstanceDto.getHistoricProcessInstanceQuery().toQuery(engine));
}
if (restartProcessInstanceDto.isInitialVariables()) {
builder.initialSetOfVariables();
}
if (restartProcessInstanceDto.isWithoutBusinessKey()) {
builder.withoutBusinessKey();
}
if (restartProcessInstanceDto.isSkipCustomListeners()) {
builder.skipCustomListeners();
}
if (restartProcessInstanceDto.isSkipIoMappings()) {
builder.skipIoMappings();
}
restartProcessInstanceDto.applyTo(builder, engine, objectMapper);
return builder;
}
Aggregations