Package org.jbpm.pvm.internal.task

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


    TaskRef task = new TaskRef();
    task.setId( ((TaskImpl)t0).getDbid() );
    task.setName( t0.getName());
    task.setAssignee( t0.getAssignee() );

    TaskImpl cast = ((TaskImpl) t0);
    task.setSignalling( cast.isSignalling());

    ExecutionImpl execution = cast.getProcessInstance();
    task.setProcessInstanceId( cast.getProcessInstance().getId() );

    // TODO: weird API
    task.setProcessId( execution.getProcessInstance().getProcessDefinition().getId() );

    // participations
    for(Participation p0 : cast.getParticipations())
    {
      if(p0.getType().equals(Participation.CANDIDATE))
      {
        if(p0.getGroupId()!=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

  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.getFromCurrent(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

    this.outcome = outcome;
  }

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

    this.taskId = taskId;
  }

  public Set<String> 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+" doesn't exist");
    }
   
    Set<String> outcomes = new HashSet<String>();
    outcomes.add(Task.STATE_COMPLETED);

    ExecutionImpl execution = (task!=null ? task.getExecution() : null);
    ActivityImpl activity = (execution!=null ? execution.getActivity() : null);
    List<Transition> outgoingTransitions = (activity!=null ? activity.getOutgoingTransitions() : null);

    if (outgoingTransitions!=null) {
      for (Transition transition: outgoingTransitions) {
View Full Code Here

    this.taskId = taskId;
  }

  public Set<String> execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    return task.getVariableKeys();
  }
View Full Code Here

    this.deleteHistory = deleteHistory;
  }

  public Void execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = (TaskImpl) dbSession.get(TaskImpl.class, taskDbid);
    if (task!=null) {
      task.delete(reason);
      dbSession.delete(task);
      if (deleteHistory) {
        HistoryTaskImpl historyTask = (HistoryTaskImpl) dbSession.get(HistoryTaskImpl.class, taskDbid);
        if (historyTask!=null) {
          dbSession.delete(historyTask);
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

    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

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.