use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class DeleteHistoricDecisionInstanceByInstanceIdCmd method execute.
@Override
public Object execute(CommandContext commandContext) {
ensureNotNull("historicDecisionInstanceId", historicDecisionInstanceId);
HistoricDecisionInstance historicDecisionInstance = commandContext.getHistoricDecisionInstanceManager().findHistoricDecisionInstance(historicDecisionInstanceId);
ensureNotNull("No historic decision instance found with id: " + historicDecisionInstanceId, "historicDecisionInstance", historicDecisionInstance);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkDeleteHistoricDecisionInstance(historicDecisionInstance);
}
commandContext.getHistoricDecisionInstanceManager().deleteHistoricDecisionInstanceByIds(Arrays.asList(historicDecisionInstanceId));
return null;
}
use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class GetCaseExecutionVariablesCmd method execute.
public VariableMap execute(CommandContext commandContext) {
ensureNotNull("caseExecutionId", caseExecutionId);
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);
}
VariableMapImpl result = new VariableMapImpl();
// collect variables
caseExecution.collectVariables(result, variableNames, isLocal, deserializeValues);
return result;
}
use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class GetDeploymentCaseDiagramCmd method execute.
@Override
public InputStream execute(final CommandContext commandContext) {
CaseDefinitionEntity caseDefinition = Context.getProcessEngineConfiguration().getDeploymentCache().findDeployedCaseDefinitionById(caseDefinitionId);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadCaseDefinition(caseDefinition);
}
final String deploymentId = caseDefinition.getDeploymentId();
final String resourceName = caseDefinition.getDiagramResourceName();
InputStream caseDiagramStream = null;
if (resourceName != null) {
caseDiagramStream = commandContext.runWithoutAuthorization(new Callable<InputStream>() {
public InputStream call() throws Exception {
return new GetDeploymentResourceCmd(deploymentId, resourceName).execute(commandContext);
}
});
}
return caseDiagramStream;
}
use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class GetCaseExecutionVariableCmd method execute.
public Object 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);
}
Object value;
if (isLocal) {
value = caseExecution.getVariableLocal(variableName);
} else {
value = caseExecution.getVariable(variableName);
}
return value;
}
use of org.camunda.bpm.engine.impl.cfg.CommandChecker in project camunda-bpm-platform by camunda.
the class GetTaskFormCmd method execute.
public TaskFormData execute(CommandContext commandContext) {
TaskManager taskManager = commandContext.getTaskManager();
TaskEntity task = taskManager.findTaskById(taskId);
ensureNotNull("No task found for taskId '" + taskId + "'", "task", task);
for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
checker.checkReadTask(task);
}
if (task.getTaskDefinition() != null) {
TaskFormHandler taskFormHandler = task.getTaskDefinition().getTaskFormHandler();
ensureNotNull("No taskFormHandler specified for task '" + taskId + "'", "taskFormHandler", taskFormHandler);
return taskFormHandler.createTaskForm(task);
} else {
// Standalone task, no TaskFormData available
return null;
}
}
Aggregations