Search in sources :

Example 26 with CommandChecker

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;
}
Also used : CaseExecutionEntity(org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker) TypedValue(org.camunda.bpm.engine.variable.value.TypedValue)

Example 27 with CommandChecker

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;
}
Also used : CaseDefinitionEntity(org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker)

Example 28 with CommandChecker

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);
        }
    }
}
Also used : CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext) ExecutionEntity(org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity) ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker)

Example 29 with CommandChecker

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;
}
Also used : UserOperationLogEntry(org.camunda.bpm.engine.history.UserOperationLogEntry) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker)

Example 30 with CommandChecker

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);
    }
}
Also used : ProcessDefinitionEntity(org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity) CommandChecker(org.camunda.bpm.engine.impl.cfg.CommandChecker)

Aggregations

CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)59 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)14 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)10 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)8 ExecutionEntity (org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity)7 CaseDefinitionEntity (org.camunda.bpm.engine.impl.cmmn.entity.repository.CaseDefinitionEntity)6 JobEntity (org.camunda.bpm.engine.impl.persistence.entity.JobEntity)6 InputStream (java.io.InputStream)5 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)5 CaseExecutionEntity (org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity)4 BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)3 DecisionDefinitionEntity (org.camunda.bpm.engine.impl.dmn.entity.repository.DecisionDefinitionEntity)3 TaskFormHandler (org.camunda.bpm.engine.impl.form.handler.TaskFormHandler)3 ExternalTaskEntity (org.camunda.bpm.engine.impl.persistence.entity.ExternalTaskEntity)3 JobDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.JobDefinitionEntity)3 JobDefinitionManager (org.camunda.bpm.engine.impl.persistence.entity.JobDefinitionManager)3 PropertyChange (org.camunda.bpm.engine.impl.persistence.entity.PropertyChange)3 TaskEntity (org.camunda.bpm.engine.impl.persistence.entity.TaskEntity)3 TaskManager (org.camunda.bpm.engine.impl.persistence.entity.TaskManager)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2