Search in sources :

Example 1 with BatchManager

use of org.camunda.bpm.engine.impl.persistence.entity.BatchManager in project camunda-bpm-platform by camunda.

the class AbstractSetBatchStateCmd method execute.

public Void execute(CommandContext commandContext) {
    ensureNotNull(BadUserRequestException.class, "Batch id must not be null", "batch id", batchId);
    BatchManager batchManager = commandContext.getBatchManager();
    BatchEntity batch = batchManager.findBatchById(batchId);
    ensureNotNull(BadUserRequestException.class, "Batch for id '" + batchId + "' cannot be found", "batch", batch);
    checkAccess(commandContext, batch);
    setJobDefinitionState(commandContext, batch.getSeedJobDefinitionId());
    setJobDefinitionState(commandContext, batch.getMonitorJobDefinitionId());
    setJobDefinitionState(commandContext, batch.getBatchJobDefinitionId());
    batchManager.updateBatchSuspensionStateById(batchId, getNewSuspensionState());
    logUserOperation(commandContext);
    return null;
}
Also used : BatchEntity(org.camunda.bpm.engine.impl.batch.BatchEntity) BatchManager(org.camunda.bpm.engine.impl.persistence.entity.BatchManager)

Aggregations

BatchEntity (org.camunda.bpm.engine.impl.batch.BatchEntity)1 BatchManager (org.camunda.bpm.engine.impl.persistence.entity.BatchManager)1