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

Examples of pl.net.bluesoft.rnd.processtool.model.ProcessInstance


        if (task == null) {
            return null;
        }
        ts.setAssignee(task.getId(), user.getLogin());

        ProcessInstance pi2 = ctx.getProcessInstanceDAO().getProcessInstanceByInternalId(task.getProcessInstanceId());
        if (pi2 == null) {
            if (pi == null)
                return assignTaskFromQueue(pq, ctx);
            else
                return null;
        }
        if (!user.getLogin().equals(ts.createTaskQuery().taskId(task.getId()).singleResult().getAssignee())) {
            if (pi == null)
                return assignTaskFromQueue(pq, ctx);
            else
                return null;
        }
        pi2.setTaskId(task.getId());
        pi2.setState(task.getName());

        ProcessInstanceLog log = new ProcessInstanceLog();
        log.setLogType(ProcessInstanceLog.LOG_TYPE_CLAIM_PROCESS);
        log.setState(ctx.getProcessDefinitionDAO().getProcessStateConfiguration(pi));
        log.setEntryDate(Calendar.getInstance());
        log.setEventI18NKey("process.log.process-assigned");
        log.setLogValue(pq.getName());
        log.setUser(ctx.getUserDataDAO().findOrCreateUser(user));
        log.setAdditionalInfo(pq.getDescription());
        pi2.addProcessLog(log);

        fillProcessAssignmentData(pi2, ctx);
        ctx.getProcessInstanceDAO().saveProcessInstance(pi2);

        eventBusManager.publish(new BpmEvent(BpmEvent.Type.ASSIGN_TASK,
View Full Code Here


    private Date dateFrom;
    private Date dateTo;

    @Override
    public void loadData(BpmTask task) {
        ProcessInstance pi = task.getProcessInstance();
        user = pi.getCreator();
        String userSubstituteLogin = pi.getSimpleAttributeValue(USER_SUBSTITUTE_LOGIN, null);
        dateFrom = parseShortDate(pi.getSimpleAttributeValue(DATE_FROM, null));
        dateTo = parseShortDate(pi.getSimpleAttributeValue(DATE_TO, null));
        usersMap = Maps.collectionToMap(LiferayBridge.getAllUsersByCurrentUser(pi.getCreator()), "login");
        usersMap.remove(user.getLogin());
        if (Strings.hasText(userSubstituteLogin)) {
            userSubstitute = usersMap.get(userSubstituteLogin);
        }
    }
View Full Code Here

        }
    }

    @Override
    public void saveData(BpmTask task) {
        ProcessInstance pi = task.getProcessInstance();
        pi.setSimpleAttribute(USER_SUBSTITUTE_LOGIN, userSubstitute.getLogin());
        pi.setSimpleAttribute(DATE_FROM, formatShortDate(dateFrom));
        pi.setSimpleAttribute(DATE_TO, formatShortDate(dateTo));
//        if (user.getSuperior() != null && user.getSuperior().length() > 0) {
//            processInstance.setSimpleAttribute("superior", user.getSuperior());
//        }
//        else {
//            processInstance.setSimpleAttribute("superior", user.getLogin());
View Full Code Here

    @Override
    public ProcessInstance getProcessInstanceByInternalId(String internalIds) {
       long start = System.currentTimeMillis();
     
      ProcessInstance pi = (ProcessInstance) getSession().createCriteria(ProcessInstance.class)
                .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY)
                .add(eq("internalId", internalIds))
                .uniqueResult();
       long duration = System.currentTimeMillis() - start;
      logger.severe("getProcessInstanceByInternalId: " +  duration);
View Full Code Here

           List<Object[]> list = criteria.list();
             Collection<ProcessInstance> collect = Collections.collect(list, new Transformer<Object[], ProcessInstance>() {
                @Override
                public ProcessInstance transform(Object[] row) {
                    ProcessInstance pi = new ProcessInstance();
                    pi.setId((Long) row[0]);
                    pi.setInternalId((String) row[1]);
                    return pi;
                }
            });
           
             long duration = System.currentTimeMillis() - start;
View Full Code Here

  private String processState = null;
  private Panel commentsPanel;

  @Override
  public void loadData(BpmTask task) {
        ProcessInstance pi = task.getProcessInstance().getRootProcessInstance();
    ProcessComments comments = pi.findAttributeByClass(ProcessComments.class);
    if (comments != null) {
      List<ProcessComment> lst = new ArrayList<ProcessComment>(comments.getComments());
      Collections.sort(lst, new Comparator<ProcessComment>() {
        @Override
        public int compare(ProcessComment o1, ProcessComment o2) {
View Full Code Here

  }

  @Override
  public void saveData(BpmTask task) {
        ProcessInstance pi = task.getProcessInstance().getRootProcessInstance();
    ProcessComments comments = pi.findAttributeByClass(ProcessComments.class);
    if (comments == null) {
      comments = new ProcessComments();
      comments.setProcessInstance(pi);
      comments.setKey(ProcessComments.class.getName());
      pi.getProcessAttributes().add(comments);
    }
    comments.setComments(new HashSet());
    for (ProcessComment pc : bic.getItemIds()) {
      comments.getComments().add(pc);
      pc.setComments(comments);
View Full Code Here

    return null; //nothing to validate
  }

  @Override
  public void saveData(BpmTask task) {
        ProcessInstance pi = task.getProcessInstance();
    setSimpleAttribute(localeKey, nvl(lbl.getApplication().getLocale(), Locale.getDefault()).toString(), pi);
  }
View Full Code Here

    //nothing
  }

  @Override
  public void loadData(BpmTask task) {
        ProcessInstance pi = task.getProcessInstance().getRootProcessInstance();
    List<ProcessInstanceLog> processLogs = new ArrayList(pi.getProcessLogs());
    Collections.sort(processLogs, ProcessInstanceLog.DEFAULT_COMPARATOR);
    for (ProcessInstanceLog pl : processLogs) {
      logInfos.add(getProcessLogInfo(pl));
    }
  }
View Full Code Here

    }

    @Override
    protected Component getTaskItem(final TaskTableItem tti) {
        ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        ProcessInstance pi = tti.getTask().getProcessInstance();
        TaskItemProviderBase tip = getTaskItemProvider(ctx, pi);
        TaskItemProviderParams params = getTaskItemProviderParams(ctx, tti);
        params.setQueue(queue);
        return tip.getQueuePane(params);
    }
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.processtool.model.ProcessInstance

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.