use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class ProcessInstanceModificationBatchCmd method createBatch.
protected BatchEntity createBatch(CommandContext commandContext, List<AbstractProcessInstanceModificationCommand> instructions, Collection<String> processInstanceIds, ProcessDefinitionEntity processDefinition) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
BatchJobHandler<ModificationBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration);
ModificationBatchConfiguration configuration = new ModificationBatchConfiguration(new ArrayList<String>(processInstanceIds), builder.getProcessDefinitionId(), instructions, builder.isSkipCustomListeners(), builder.isSkipIoMappings());
BatchEntity batch = new BatchEntity();
batch.setType(batchJobHandler.getType());
batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration));
batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
batch.setTenantId(processDefinition.getTenantId());
commandContext.getBatchManager().insert(batch);
return batch;
}
use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class SetExternalTasksRetriesBatchCmd method execute.
@Override
public Batch execute(CommandContext commandContext) {
List<String> externalTaskIds = collectExternalTaskIds();
ensureNotEmpty(BadUserRequestException.class, "externalTaskIds", externalTaskIds);
commandContext.getAuthorizationManager().checkAuthorization(Permissions.CREATE, Resources.BATCH);
writeUserOperationLog(commandContext, builder.getRetries(), externalTaskIds.size(), true);
BatchEntity batch = createBatch(commandContext, externalTaskIds);
batch.createSeedJobDefinition();
batch.createMonitorJobDefinition();
batch.createBatchJobDefinition();
batch.fireHistoricStartEvent();
batch.createSeedJob();
return batch;
}
use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class SetExternalTasksRetriesBatchCmd method createBatch.
protected BatchEntity createBatch(CommandContext commandContext, Collection<String> processInstanceIds) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
BatchJobHandler<SetRetriesBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration);
SetRetriesBatchConfiguration configuration = new SetRetriesBatchConfiguration(new ArrayList<String>(processInstanceIds), builder.getRetries());
BatchEntity batch = new BatchEntity();
batch.setType(batchJobHandler.getType());
batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration));
batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
commandContext.getBatchManager().insert(batch);
return batch;
}
use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class AbstractIDBasedBatchCmd method createBatch.
protected BatchEntity createBatch(CommandContext commandContext, List<String> ids) {
ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
BatchJobHandler batchJobHandler = getBatchJobHandler(processEngineConfiguration);
BatchConfiguration configuration = getAbstractIdsBatchConfiguration(ids);
BatchEntity batch = new BatchEntity();
batch.setType(batchJobHandler.getType());
batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration));
batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
commandContext.getBatchManager().insert(batch);
return batch;
}
use of org.camunda.bpm.engine.impl.batch.BatchEntity in project camunda-bpm-platform by camunda.
the class DeleteProcessInstanceBatchCmd method execute.
@Override
public Batch execute(CommandContext commandContext) {
List<String> processInstanceIds = collectProcessInstanceIds();
ensureNotEmpty(BadUserRequestException.class, "processInstanceIds", processInstanceIds);
checkAuthorizations(commandContext);
writeUserOperationLog(commandContext, deleteReason, processInstanceIds.size(), true);
BatchEntity batch = createBatch(commandContext, processInstanceIds);
batch.createSeedJobDefinition();
batch.createMonitorJobDefinition();
batch.createBatchJobDefinition();
batch.fireHistoricStartEvent();
batch.createSeedJob();
return batch;
}
Aggregations