Search in sources :

Example 1 with RestartProcessInstanceBuilder

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;
}
Also used : RuntimeService(org.camunda.bpm.engine.RuntimeService) RestartProcessInstanceBuilder(org.camunda.bpm.engine.runtime.RestartProcessInstanceBuilder)

Aggregations

RuntimeService (org.camunda.bpm.engine.RuntimeService)1 RestartProcessInstanceBuilder (org.camunda.bpm.engine.runtime.RestartProcessInstanceBuilder)1