use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class GetCaseExecutionVariableTypedCmd method execute.
public TypedValue execute(CommandContext commandContext) {
ensureNotNull("caseExecutionId", caseExecutionId);
ensureNotNull("variableName", variableName);
CaseExecutionEntity caseExecution = commandContext.getCaseExecutionManager().findCaseExecutionById(caseExecutionId);
ensureNotNull(CaseExecutionNotFoundException.class, "case execution " + caseExecutionId + " doesn't exist", "caseExecution", caseExecution);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadCaseInstance(caseExecution);
}
TypedValue value;
if (isLocal) {
value = caseExecution.getVariableLocalTyped(variableName, deserializeValue);
} else {
value = caseExecution.getVariableTyped(variableName, deserializeValue);
}
return value;
}
use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class UpdateCaseDefinitionHistoryTimeToLiveCmd method execute.
@Override
public Void execute(CommandContext commandContext) {
ensureNotNull(BadUserRequestException.class, "caseDefinitionId", caseDefinitionId);
if (historyTimeToLive != null) {
ensureGreaterThanOrEqual(BadUserRequestException.class, "", "historyTimeToLive", historyTimeToLive, 0);
}
CaseDefinitionEntity caseDefinitionEntity = commandContext.getCaseDefinitionManager().findLatestDefinitionById(caseDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkUpdateCaseDefinition(caseDefinitionEntity);
}
caseDefinitionEntity.setHistoryTimeToLive(historyTimeToLive);
return null;
}
use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class AbstractCorrelateMessageCmd method checkAuthorization.
protected void checkAuthorization(CorrelationHandlerResult correlation) {
CommandContext commandContext = Context.getCommandContext();
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
if (MessageCorrelationResultType.Execution.equals(correlation.getResultType())) {
ExecutionEntity execution = correlation.getExecutionEntity();
checker.checkUpdateProcessInstanceById(execution.getProcessInstanceId());
} else {
ProcessDefinitionEntity definition = correlation.getProcessDefinitionEntity();
checker.checkCreateProcessInstance(definition);
}
}
}
use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class DeleteUserOperationLogEntryCmd method execute.
public Void execute(CommandContext commandContext) {
ensureNotNull(NotValidException.class, "entryId", entryId);
UserOperationLogEntry entry = commandContext.getOperationLogManager().findOperationLogById(entryId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkDeleteUserOperationLog(entry);
}
commandContext.getOperationLogManager().deleteOperationLogEntryById(entryId);
return null;
}
use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class EvaluateStartConditionCmd method checkAuthorization.
protected void checkAuthorization(CommandContext commandContext, ConditionHandlerResult result) {
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
ProcessDefinitionEntity definition = result.getProcessDefinition();
checker.checkCreateProcessInstance(definition);
}
}
Aggregations