use of org.camunda.bpm.engine.impl.ModificationBatchConfiguration 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;
}
Aggregations