Package org.jbpm.api

Examples of org.jbpm.api.TaskService


  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      TaskService taskService = this.processEngine.get(TaskService.class);
      List<TaskRef> results = new ArrayList<TaskRef>();

      List<Task> assignedTasks = taskService.findPersonalTasks(idRef);
      adoptTasks(assignedTasks, results);

      return results;
    }
    finally
View Full Code Here


  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      TaskService taskService = this.processEngine.get(TaskService.class);
      List<TaskRef> results = new ArrayList<TaskRef>();

      if(null==participationType || participationType.equals(Participation.CANDIDATE))
      {
        List<Task> groupTasks = taskService.findGroupTasks(idRef);
        adoptTasks(groupTasks, results);
      }
      else
      {
        throw new IllegalArgumentException("Unknown participation type: " +participationType);
View Full Code Here

  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      TaskService taskService = this.processEngine.get(TaskService.class);
      Task t0 = taskService.getTask(Long.toString(taskId));
      return ModelAdaptor.adoptTask(t0);
    }
    finally{
      env.close();
    }
View Full Code Here

  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      TaskService taskService = this.processEngine.get(TaskService.class);
      taskService.assignTask(Long.toString(taskId), idRef);
    }
    finally{
      env.close();
    }
  }
View Full Code Here

  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      TaskService taskService = this.processEngine.get(TaskService.class);
      taskService.assignTask(Long.toString(taskId), null);
    }
    finally{
      env.close();
    }
  }
View Full Code Here

  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      TaskService taskService = this.processEngine.get(TaskService.class);
      if(data!=null)
        taskService.setVariables(Long.toString(taskId), data);

      taskService.completeTask(Long.toString(taskId));
    }
    finally{
      env.close();
    }
  }
View Full Code Here

  {
    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      TaskService taskService = this.processEngine.get(TaskService.class);
      if(data!=null)
        taskService.setVariables(Long.toString(taskId), data);

      taskService.completeTask(Long.toString(taskId), outcome);
    }
    finally
    {
      env.close();
    }
View Full Code Here

    }

    private void fillProcessAssignmentData(final ProcessEngine processEngine, final ProcessInstance pi, ProcessToolContext ctx) {
        Set<String> assignees = new HashSet<String>();
        Set<String> queues = new HashSet<String>();
        TaskService taskService = processEngine.getTaskService();
        List<BpmTask> processTasks = findProcessTasks(pi, null, null, ctx);
        for (BpmTask t : processTasks) {
            if (t.getAssignee() != null) {
                assignees.add(t.getAssignee());
            } else { //some optimization could be possible
                for (Participation participation : taskService.getTaskParticipations(t.getInternalTaskId())) {
                    if ("candidate".equals(participation.getType())) {
                        queues.add(participation.getGroupId());
                    }
                }
            }
View Full Code Here

            loger.severe("User: " + user.getLogin() + " attempting to reassign task " + bpmTask.getInternalTaskId() + " for process: " + pi.getInternalId() + " to user: " + userLogin);

            ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
            pi = getProcessData(pi.getInternalId(), ctx);
            ProcessEngine processEngine = getProcessEngine(ctx);
            TaskService ts = processEngine.getTaskService();
            Task task = ts.getTask(bpmTask.getInternalTaskId());
            if (nvl(userLogin,"").equals(nvl(task.getAssignee(),""))) {
                loger.severe("User: " + user.getLogin() + " has not reassigned task " + bpmTask.getInternalTaskId() + " for process: " + pi.getInternalId() + " as the user is the same: " + userLogin);
                return;
            }
            //this call should also take care of swimlanes
            ts.assignTask(bpmTask.getInternalTaskId(), userLogin);
            fillProcessAssignmentData(processEngine, pi, ctx);
            loger.info("Process.running:" + pi.getRunning());
            ctx.getProcessInstanceDAO().saveProcessInstance(pi);
            loger.severe("User: " + user.getLogin() + " has reassigned task " + bpmTask.getInternalTaskId() + " for process: " + pi.getInternalId() + " to user: " + userLogin);
View Full Code Here

TOP

Related Classes of org.jbpm.api.TaskService

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.