Package pl.net.bluesoft.rnd.processtool.model.nonpersistent

Examples of pl.net.bluesoft.rnd.processtool.model.nonpersistent.MutableBpmTask


       @Override
       public BpmTask getPastEndTask(ProcessInstanceLog log, ProcessToolContext ctx) {
           final ProcessInstance pi = log.getOwnProcessInstance();
           String endTaskName = findEndActivityName(pi, ctx);
           if (Strings.hasText(endTaskName)) {
               MutableBpmTask t = new MutableBpmTask();
               t.setProcessInstance(pi);
               t.setAssignee(user.getLogin());
               t.setOwner(user);
               t.setTaskName(endTaskName);
               t.setFinished(true);
               return t;
           }
           return null;
       }
View Full Code Here


       List<HistoryActivityInstance> tasks = getProcessEngine(ctx).execute(cmd);
           if (tasks.isEmpty()) {
               return null;
           }
           MutableBpmTask task = collectHistoryActivity(tasks.get(0), pi, user, ctx);
           String endTaskName = findEndActivityName(pi, ctx);
           if (Strings.hasText(endTaskName)) {
               task.setTaskName(endTaskName);
           }
           return task;
     }
View Full Code Here

         }
       }.go();
     }

     private MutableBpmTask collectHistoryActivity(HistoryActivityInstance task, ProcessInstance pi, UserData user, ProcessToolContext ctx) {
       MutableBpmTask t = new MutableBpmTask();
       t.setProcessInstance(pi);
       t.setAssignee(user.getLogin());
       t.setOwner(user);
       t.setTaskName(task.getActivityName());
       t.setInternalTaskId(null);
       t.setExecutionId(task.getExecutionId());
       t.setCreateDate(task.getStartTime());
       t.setFinishDate(task.getEndTime());
       t.setFinished(task.getEndTime() != null);
       return t;
     }
View Full Code Here

        }
        return null;
    }

    private MutableBpmTask collectTask(Task task, ProcessInstance pi, ProcessToolContext ctx) {
       MutableBpmTask t = new MutableBpmTask();
       t.setProcessInstance(pi);
       t.setAssignee(task.getAssignee());
       UserData ud = ctx.getUserDataDAO().loadUserByLogin(task.getAssignee());
       if (ud == null) {
         ud = new UserData();
         ud.setLogin(task.getAssignee());
       }
       t.setOwner(ud);
       t.setTaskName(task.getActivityName());
       t.setInternalTaskId(task.getId());
       t.setExecutionId(task.getExecutionId());
       t.setCreateDate(task.getCreateTime());
       t.setFinished(false);
       return t;
     }
View Full Code Here

       return bpmTasks;
     }

     @Override
     public BpmTask refreshTaskData(BpmTask task, ProcessToolContext ctx) {
       MutableBpmTask bpmTask = task instanceof MutableBpmTask ? (MutableBpmTask) task : new MutableBpmTask(task);
       bpmTask.setProcessInstance(getProcessData(task.getProcessInstance().getInternalId(), ctx));
       List<Task> tasks = getProcessEngine(ctx).getTaskService().createTaskQuery()
           .notSuspended()
           .activityName(task.getTaskName())
           .executionId(task.getExecutionId())
           .assignee(user.getLogin())
           .page(0, 1)
           .list();
       if (tasks.isEmpty()) {
         loger.warning("Task " + task.getExecutionId() + " not found");
         bpmTask.setFinished(true);
       }
       return bpmTask;
     }
View Full Code Here

             /* Get task assigned to queues */
             Collection<BpmTask> queueTasks = getProcessTaskInQueues(ctx, processInstance);
            
             for(BpmTask queueTask: queueTasks)
             {
               MutableBpmTask mutableTask = new MutableBpmTask(queueTask);
               mutableTask.setAssignee(task.getAssignee());
               mutableTask.setProcessInstance(processInstance);
              
               /* Inform queue manager about task assigne */
               ctx.getUserProcessQueueManager().onQueueAssigne(mutableTask);
             }
            
               MutableBpmTask mutableTask = new MutableBpmTask(task);
               mutableTask.setFinished(true);
               mutableTask.setProcessInstance(processInstance);
               userTask = mutableTask;
           }

           broadcastEvent(ctx, new ViewEvent(ViewEvent.Type.ACTION_COMPLETE));
          
View Full Code Here

            if (task.getEndTime() != null && task.getEndTime().compareTo(minDate.getTime()) > 0) {
                pastTasks.add(task);
            }
        }
        if (pastTasks.isEmpty()) return null;
        MutableBpmTask task = collectHistoryActivity(pastTasks.get(0), pi, user);
        String endTaskName = findEndActivityName(pi, ctx);
        if (Strings.hasText(endTaskName)) {
            task.setTaskName(endTaskName);
        }
        return task;
    }
View Full Code Here

           });
       return result;
     }

    private MutableBpmTask collectTask(Task task, ProcessInstance pi, ProcessToolContext ctx) {
        MutableBpmTask t = new MutableBpmTask();
        t.setProcessInstance(pi);
        t.setAssignee(task.getAssignee());
        UserData ud = ctx.getUserDataDAO().loadUserByLogin(task.getAssignee());
        if (ud == null) {
            ud = new UserData();
            ud.setLogin(task.getAssignee());
        }
        t.setOwner(ud);
        t.setTaskName(task.getName());
        t.setInternalTaskId(task.getId());
        t.setExecutionId(task.getExecutionId());
        t.setCreateDate(task.getCreateTime());
        t.setFinished(false);
        return t;
    }
View Full Code Here

        return t;
    }

     @Override
     public BpmTask refreshTaskData(BpmTask task, ProcessToolContext ctx) {
       MutableBpmTask bpmTask = task instanceof MutableBpmTask ? (MutableBpmTask) task : new MutableBpmTask(task);
       bpmTask.setProcessInstance(getProcessData(task.getProcessInstance().getInternalId(), ctx));

       List<Task> tasks = getProcessEngine().getTaskService().createTaskQuery()
//           .notSuspended()
           .taskName(task.getTaskName())
           .executionId(task.getExecutionId())
           .taskAssignee(user.getLogin())
           .listPage(0, 1);
       if (tasks.isEmpty()) {
         log.warning("Task " + task.getExecutionId() + " not found");
         bpmTask.setFinished(true);
       }
       return bpmTask;
     }
View Full Code Here

        }
        return null;
    }

    private MutableBpmTask collectHistoryActivity(HistoricTaskInstance task, ProcessInstance pi, UserData user) {
        MutableBpmTask t = new MutableBpmTask();
        t.setProcessInstance(pi);
        t.setAssignee(user.getLogin());
        t.setOwner(user);
        t.setTaskName(task.getName());
        t.setInternalTaskId(null);
        t.setExecutionId(task.getExecutionId());
        t.setCreateDate(task.getStartTime());
        t.setFinishDate(task.getEndTime());
        t.setFinished(task.getEndTime() != null);
        return t;
    }
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.processtool.model.nonpersistent.MutableBpmTask

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.