public Object execute(CommandContext commandContext) {
    if (taskId == null) {
      throw new ActivitiIllegalArgumentException("taskId is null");
    }
    if (variableName == null) {
      throw new ActivitiIllegalArgumentException("variableName is null");
    }

    TaskEntity task = commandContext.getTaskEntityManager().findTaskById(taskId);

    if (task == null) {
      throw new ActivitiObjectNotFoundException("task " + taskId + " doesn't exist", Task.class);
    }

    Object value;

    if (isLocal) {
      value = task.getVariableLocal(variableName, false);
    } else {
      value = task.getVariable(variableName, false);
    }

    return value;
  }
Example #2
0
 public long executeCount(CommandContext commandContext) {
   ensureVariablesInitialized();
   checkQueryOk();
   return commandContext.getTaskEntityManager().findTaskCountByQueryCriteria(this);
 }
Example #3
0
 public List<Task> executeList(CommandContext commandContext, Page page) {
   ensureVariablesInitialized();
   checkQueryOk();
   return commandContext.getTaskEntityManager().findTasksByQueryCriteria(this);
 }