Search in sources :

Example 1 with UpdateJobDefinitionSuspensionStateBuilderImpl

use of org.camunda.bpm.engine.impl.management.UpdateJobDefinitionSuspensionStateBuilderImpl in project camunda-bpm-platform by camunda.

the class AbstractSetBatchStateCmd method createSetJobDefinitionStateCommand.

protected AbstractSetJobDefinitionStateCmd createSetJobDefinitionStateCommand(String jobDefinitionId) {
    AbstractSetJobDefinitionStateCmd suspendJobDefinitionCmd = createSetJobDefinitionStateCommand(new UpdateJobDefinitionSuspensionStateBuilderImpl().byJobDefinitionId(jobDefinitionId).includeJobs(true));
    suspendJobDefinitionCmd.disableLogUserOperation();
    return suspendJobDefinitionCmd;
}
Also used : UpdateJobDefinitionSuspensionStateBuilderImpl(org.camunda.bpm.engine.impl.management.UpdateJobDefinitionSuspensionStateBuilderImpl)

Example 2 with UpdateJobDefinitionSuspensionStateBuilderImpl

use of org.camunda.bpm.engine.impl.management.UpdateJobDefinitionSuspensionStateBuilderImpl in project camunda-bpm-platform by camunda.

the class AbstractSetProcessDefinitionStateCmd method updateSuspensionState.

@Override
protected void updateSuspensionState(final CommandContext commandContext, SuspensionState suspensionState) {
    ProcessDefinitionManager processDefinitionManager = commandContext.getProcessDefinitionManager();
    if (processDefinitionId != null) {
        processDefinitionManager.updateProcessDefinitionSuspensionStateById(processDefinitionId, suspensionState);
    } else if (isTenantIdSet) {
        processDefinitionManager.updateProcessDefinitionSuspensionStateByKeyAndTenantId(processDefinitionKey, tenantId, suspensionState);
    } else {
        processDefinitionManager.updateProcessDefinitionSuspensionStateByKey(processDefinitionKey, suspensionState);
    }
    commandContext.runWithoutAuthorization(new Callable<Void>() {

        public Void call() throws Exception {
            UpdateJobDefinitionSuspensionStateBuilderImpl jobDefinitionSuspensionStateBuilder = createJobDefinitionCommandBuilder();
            AbstractSetJobDefinitionStateCmd jobDefinitionCmd = getSetJobDefinitionStateCmd(jobDefinitionSuspensionStateBuilder);
            jobDefinitionCmd.disableLogUserOperation();
            jobDefinitionCmd.execute(commandContext);
            return null;
        }
    });
}
Also used : ProcessDefinitionManager(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionManager) UpdateJobDefinitionSuspensionStateBuilderImpl(org.camunda.bpm.engine.impl.management.UpdateJobDefinitionSuspensionStateBuilderImpl) ProcessEngineException(org.camunda.bpm.engine.ProcessEngineException)

Aggregations

UpdateJobDefinitionSuspensionStateBuilderImpl (org.camunda.bpm.engine.impl.management.UpdateJobDefinitionSuspensionStateBuilderImpl)2 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)1 ProcessDefinitionManager (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionManager)1