Search in sources :

Example 1 with UpdateProcessInstancesSuspendStateBatchConfiguration

use of org.camunda.bpm.engine.impl.batch.update.UpdateProcessInstancesSuspendStateBatchConfiguration in project camunda-bpm-platform by camunda.

the class UpdateProcessInstancesSuspendStateBatchCmd method createBatch.

protected BatchEntity createBatch(CommandContext commandContext, Collection<String> processInstanceIds) {
    ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration();
    BatchJobHandler batchJobHandler = getBatchJobHandler(processEngineConfiguration);
    BatchConfiguration configuration = getAbstractIdsBatchConfiguration(new ArrayList<String>(processInstanceIds));
    BatchEntity batch = new BatchEntity();
    batch.setType(batchJobHandler.getType());
    batch.setTotalJobs(calculateSize(processEngineConfiguration, (UpdateProcessInstancesSuspendStateBatchConfiguration) configuration));
    batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed());
    batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob());
    batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration));
    commandContext.getBatchManager().insert(batch);
    return batch;
}
Also used : UpdateProcessInstancesSuspendStateBatchConfiguration(org.camunda.bpm.engine.impl.batch.update.UpdateProcessInstancesSuspendStateBatchConfiguration) BatchJobHandler(org.camunda.bpm.engine.impl.batch.BatchJobHandler) UpdateProcessInstancesSuspendStateBatchConfiguration(org.camunda.bpm.engine.impl.batch.update.UpdateProcessInstancesSuspendStateBatchConfiguration) BatchConfiguration(org.camunda.bpm.engine.impl.batch.BatchConfiguration) BatchEntity(org.camunda.bpm.engine.impl.batch.BatchEntity) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)

Aggregations

BatchConfiguration (org.camunda.bpm.engine.impl.batch.BatchConfiguration)1 BatchEntity (org.camunda.bpm.engine.impl.batch.BatchEntity)1 BatchJobHandler (org.camunda.bpm.engine.impl.batch.BatchJobHandler)1 UpdateProcessInstancesSuspendStateBatchConfiguration (org.camunda.bpm.engine.impl.batch.update.UpdateProcessInstancesSuspendStateBatchConfiguration)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1