Search in sources :

Example 1 with ModificationBatchConfiguration

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;
}
Also used : BatchEntity(org.camunda.bpm.engine.impl.batch.BatchEntity) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) ModificationBatchConfiguration(org.camunda.bpm.engine.impl.ModificationBatchConfiguration)

Aggregations

ModificationBatchConfiguration (org.camunda.bpm.engine.impl.ModificationBatchConfiguration)1 BatchEntity (org.camunda.bpm.engine.impl.batch.BatchEntity)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1