Package org.jbpm.pvm.internal.task

Examples of org.jbpm.pvm.internal.task.TaskImpl


  public Object execute(Environment environment) throws Exception {
    Session session = environment.get(Session.class);
   
    if (taskId!=null) {
      TaskImpl task = (TaskImpl) session.get(TaskImpl.class, Long.parseLong(taskId));
      if (task==null) {
        throw new JbpmException("task "+taskId+" was not found");
      }

      task.addParticipation(userId, groupId, type);
    }

    /*
    if (swimlaneDbid!=null) {
      SwimlaneImpl swimlane = (TaskImpl) session.get(SwimlaneImpl.class, swimlaneDbid);
View Full Code Here


    }
  }

  public Task execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = (TaskImpl) dbSession.createTask();
    task.setSuperTaskDbid(parentTaskDbid);
    return task;
  }
View Full Code Here

    this.take = take;
  }

  public Void execute(Environment environment) {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    if (task==null) {
      throw new JbpmException("task "+taskId+" does not exist");
    }
    if (take) {
      task.take(userId);
    } else {
      task.setAssignee(userId, true);
    }
   
    HistoryEvent.fire(new TaskAssign(task, userId));

    return null;
View Full Code Here

    this.taskId = taskId;
  }

  public Void execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    task.setVariables(variables);
  
    return null;
  }
View Full Code Here

  public String execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);

    if (task.isNew()) {
      if (task.getSuperTaskDbid()!=null) {
        TaskImpl parentTask = (TaskImpl) dbSession.get(TaskImpl.class, task.getSuperTaskDbid());
        parentTask.addSubTask(task);
        task.setSuperTaskDbid(null);
      }
     
      dbSession.save(task);
     
View Full Code Here

      historyProcessInstance = (HistoryProcessInstanceImpl)
          dbSession.get(HistoryProcessInstanceImpl.class, processInstanceDbid);
    }
   
    HistoryTaskImpl historyTask = null;
    TaskImpl task = variable.getTask();
    if (task!=null) {
      long taskDbid = task.getDbid();
      historyTask = (HistoryTaskImpl)
          dbSession.get(HistoryTaskImpl.class, taskDbid);
    }
   
    HistoryVariableImpl historyVariable = new HistoryVariableImpl(historyProcessInstance, historyTask, variable);
View Full Code Here

  public Map<String, Object> execute(Environment environment) throws Exception {
    Map<String, Object> variables = new HashMap<String, Object>();

    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    for (String variableName : variableNames) {
      Object value = task.getVariable(variableName);
      variables.put(variableName, value);
    }

    return variables;
  }
View Full Code Here

  public Object execute(Environment environment) throws Exception {
    Session session = environment.get(Session.class);

    if (taskDbid!=null) {
      TaskImpl task = (TaskImpl) session.get(TaskImpl.class, taskDbid);
      if (task==null) {
        throw new JbpmException("task "+taskDbid+" was not found");
      }

      Set<ParticipationImpl> participations = new HashSet<ParticipationImpl>(task.getParticipations());
      for (ParticipationImpl participation : participations) {
        boolean userMatch = userId!=null ? userId.equals(participation.getUserId()) : false;
        boolean groupMatch = groupId!=null ? groupId.equals(participation.getGroupId()) : false;
        if ( ( userMatch || groupMatch )
             && participation.getType().equals(participationType)
           ) {
          task.removeParticipant(participation);
        }
      }
    }

    return null;
View Full Code Here

      task.resume();
    }
  }

  public TaskImpl createTask() {
    TaskImpl task = newTask();
    task.setCreateTime(Clock.getCurrentTime());
    return task;
  }
View Full Code Here

    task.setCreateTime(Clock.getCurrentTime());
    return task;
  }

  protected TaskImpl newTask() {
    TaskImpl task = new TaskImpl();
    long dbid = EnvironmentImpl.getFromCurrent(DbidGenerator.class).getNextId();
    task.setDbid(dbid);
    task.setNew(true);
    return task;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.task.TaskImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.