Search in sources :

Example 1 with BatchJobHandler

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

Example 2 with BatchJobHandler

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);
        }
    }
}
Also used : DeleteProcessInstancesJobHandler(org.camunda.bpm.engine.impl.batch.deletion.DeleteProcessInstancesJobHandler) SetJobRetriesJobHandler(org.camunda.bpm.engine.impl.batch.job.SetJobRetriesJobHandler) MigrationBatchJobHandler(org.camunda.bpm.engine.impl.migration.batch.MigrationBatchJobHandler) ModificationBatchJobHandler(org.camunda.bpm.engine.impl.ModificationBatchJobHandler) UpdateProcessInstancesSuspendStateJobHandler(org.camunda.bpm.engine.impl.batch.update.UpdateProcessInstancesSuspendStateJobHandler) DeleteHistoricDecisionInstancesJobHandler(org.camunda.bpm.engine.impl.dmn.batch.DeleteHistoricDecisionInstancesJobHandler) DeleteHistoricProcessInstancesJobHandler(org.camunda.bpm.engine.impl.batch.deletion.DeleteHistoricProcessInstancesJobHandler) ModificationBatchJobHandler(org.camunda.bpm.engine.impl.ModificationBatchJobHandler) BatchJobHandler(org.camunda.bpm.engine.impl.batch.BatchJobHandler) MigrationBatchJobHandler(org.camunda.bpm.engine.impl.migration.batch.MigrationBatchJobHandler) SetExternalTaskRetriesJobHandler(org.camunda.bpm.engine.impl.batch.externaltask.SetExternalTaskRetriesJobHandler) RestartProcessInstancesJobHandler(org.camunda.bpm.engine.impl.RestartProcessInstancesJobHandler)

Example 3 with BatchJobHandler

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;
}
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

BatchJobHandler (org.camunda.bpm.engine.impl.batch.BatchJobHandler)3 BatchConfiguration (org.camunda.bpm.engine.impl.batch.BatchConfiguration)2 BatchEntity (org.camunda.bpm.engine.impl.batch.BatchEntity)2 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)2 ModificationBatchJobHandler (org.camunda.bpm.engine.impl.ModificationBatchJobHandler)1 RestartProcessInstancesJobHandler (org.camunda.bpm.engine.impl.RestartProcessInstancesJobHandler)1 DeleteHistoricProcessInstancesJobHandler (org.camunda.bpm.engine.impl.batch.deletion.DeleteHistoricProcessInstancesJobHandler)1 DeleteProcessInstancesJobHandler (org.camunda.bpm.engine.impl.batch.deletion.DeleteProcessInstancesJobHandler)1 SetExternalTaskRetriesJobHandler (org.camunda.bpm.engine.impl.batch.externaltask.SetExternalTaskRetriesJobHandler)1 SetJobRetriesJobHandler (org.camunda.bpm.engine.impl.batch.job.SetJobRetriesJobHandler)1 UpdateProcessInstancesSuspendStateBatchConfiguration (org.camunda.bpm.engine.impl.batch.update.UpdateProcessInstancesSuspendStateBatchConfiguration)1 UpdateProcessInstancesSuspendStateJobHandler (org.camunda.bpm.engine.impl.batch.update.UpdateProcessInstancesSuspendStateJobHandler)1 DeleteHistoricDecisionInstancesJobHandler (org.camunda.bpm.engine.impl.dmn.batch.DeleteHistoricDecisionInstancesJobHandler)1 MigrationBatchJobHandler (org.camunda.bpm.engine.impl.migration.batch.MigrationBatchJobHandler)1