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