use of org.camunda.bpm.engine.migration.MigrationPlanExecutionBuilder in project camunda-bpm-platform by camunda.
the class MigrationRestServiceImpl method createMigrationPlanExecutionBuilder.
protected MigrationPlanExecutionBuilder createMigrationPlanExecutionBuilder(MigrationExecutionDto migrationExecution) {
MigrationPlan migrationPlan = createMigrationPlan(migrationExecution.getMigrationPlan());
List<String> processInstanceIds = migrationExecution.getProcessInstanceIds();
MigrationPlanExecutionBuilder executionBuilder = processEngine.getRuntimeService().newMigration(migrationPlan).processInstanceIds(processInstanceIds);
ProcessInstanceQueryDto processInstanceQueryDto = migrationExecution.getProcessInstanceQuery();
if (processInstanceQueryDto != null) {
ProcessInstanceQuery processInstanceQuery = processInstanceQueryDto.toQuery(getProcessEngine());
executionBuilder.processInstanceQuery(processInstanceQuery);
}
if (migrationExecution.isSkipCustomListeners()) {
executionBuilder.skipCustomListeners();
}
if (migrationExecution.isSkipIoMappings()) {
executionBuilder.skipIoMappings();
}
return executionBuilder;
}
use of org.camunda.bpm.engine.migration.MigrationPlanExecutionBuilder in project camunda-bpm-platform by camunda.
the class MigrationBatchJobHandler method execute.
@Override
public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) {
ByteArrayEntity configurationEntity = commandContext.getDbEntityManager().selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId());
MigrationBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes());
MigrationPlanExecutionBuilder executionBuilder = commandContext.getProcessEngineConfiguration().getRuntimeService().newMigration(batchConfiguration.getMigrationPlan()).processInstanceIds(batchConfiguration.getIds());
if (batchConfiguration.isSkipCustomListeners()) {
executionBuilder.skipCustomListeners();
}
if (batchConfiguration.isSkipIoMappings()) {
executionBuilder.skipIoMappings();
}
// uses internal API in order to skip writing user operation log (CommandContext#disableUserOperationLog
// is not sufficient with legacy engine config setting "restrictUserOperationLogToAuthenticatedUsers" = false)
((MigrationPlanExecutionBuilderImpl) executionBuilder).execute(false);
commandContext.getByteArrayManager().delete(configurationEntity);
}
Aggregations