Search in sources :

Example 1 with MigrationPlanExecutionBuilderImpl

use of org.camunda.bpm.engine.impl.migration.MigrationPlanExecutionBuilderImpl 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);
}
Also used : MigrationPlanExecutionBuilderImpl(org.camunda.bpm.engine.impl.migration.MigrationPlanExecutionBuilderImpl) ByteArrayEntity(org.camunda.bpm.engine.impl.persistence.entity.ByteArrayEntity) MigrationPlanExecutionBuilder(org.camunda.bpm.engine.migration.MigrationPlanExecutionBuilder)

Aggregations

MigrationPlanExecutionBuilderImpl (org.camunda.bpm.engine.impl.migration.MigrationPlanExecutionBuilderImpl)1 ByteArrayEntity (org.camunda.bpm.engine.impl.persistence.entity.ByteArrayEntity)1 MigrationPlanExecutionBuilder (org.camunda.bpm.engine.migration.MigrationPlanExecutionBuilder)1