use of org.camunda.bpm.engine.impl.batch.BatchJobHandler 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.BatchJobHandler in project camunda-bpm-platform by camunda.
the class ProcessEngineConfigurationImpl method initBatchHandlers.
// batch ///////////////////////////////////////////////////////////////////////
protected void initBatchHandlers() {
if (batchHandlers == null) {
batchHandlers = new HashMap<String, BatchJobHandler<?>>();
MigrationBatchJobHandler migrationHandler = new MigrationBatchJobHandler();
batchHandlers.put(migrationHandler.getType(), migrationHandler);
ModificationBatchJobHandler modificationHandler = new ModificationBatchJobHandler();
batchHandlers.put(modificationHandler.getType(), modificationHandler);
DeleteProcessInstancesJobHandler deleteProcessJobHandler = new DeleteProcessInstancesJobHandler();
batchHandlers.put(deleteProcessJobHandler.getType(), deleteProcessJobHandler);
DeleteHistoricProcessInstancesJobHandler deleteHistoricProcessInstancesJobHandler = new DeleteHistoricProcessInstancesJobHandler();
batchHandlers.put(deleteHistoricProcessInstancesJobHandler.getType(), deleteHistoricProcessInstancesJobHandler);
SetJobRetriesJobHandler setJobRetriesJobHandler = new SetJobRetriesJobHandler();
batchHandlers.put(setJobRetriesJobHandler.getType(), setJobRetriesJobHandler);
SetExternalTaskRetriesJobHandler setExternalTaskRetriesJobHandler = new SetExternalTaskRetriesJobHandler();
batchHandlers.put(setExternalTaskRetriesJobHandler.getType(), setExternalTaskRetriesJobHandler);
RestartProcessInstancesJobHandler restartProcessInstancesJobHandler = new RestartProcessInstancesJobHandler();
batchHandlers.put(restartProcessInstancesJobHandler.getType(), restartProcessInstancesJobHandler);
UpdateProcessInstancesSuspendStateJobHandler suspendProcessInstancesJobHandler = new UpdateProcessInstancesSuspendStateJobHandler();
batchHandlers.put(suspendProcessInstancesJobHandler.getType(), suspendProcessInstancesJobHandler);
DeleteHistoricDecisionInstancesJobHandler deleteHistoricDecisionInstancesJobHandler = new DeleteHistoricDecisionInstancesJobHandler();
batchHandlers.put(deleteHistoricDecisionInstancesJobHandler.getType(), deleteHistoricDecisionInstancesJobHandler);
}
if (customBatchJobHandlers != null) {
for (BatchJobHandler<?> customBatchJobHandler : customBatchJobHandlers) {
batchHandlers.put(customBatchJobHandler.getType(), customBatchJobHandler);
}
}
}
use of org.camunda.bpm.engine.impl.batch.BatchJobHandler 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;
}
Aggregations