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

Examples of pl.net.bluesoft.rnd.processtool.model.processdata.ProcessComments


  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) {
          return -o1.getCreateTime().compareTo(o2.getCreateTime());
        }
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 STATUS_OK;
    }

  private Object getLatestComment(ProcessInstance processInstance) {
    ProcessComments comments = processInstance.findAttributeByClass(ProcessComments.class);
    if (comments != null && !comments.getComments().isEmpty()) {
      ProcessComment comment = from(comments.getComments())
          .orderByDescending(new F<ProcessComment, Date>() {
            @Override
            public Date invoke(ProcessComment x) {
              return x.getCreateTime();
            }
View Full Code Here

                showContent = false;
            }
        }

        bic.removeAllItems();
    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) {
                    return o2.getCreateTime().compareTo(o1.getCreateTime());
                }
View Full Code Here

        pc.setAuthor(ctx.getUserDataDAO().loadOrCreateUserByLogin(loggedUser));
        pc.setAuthorSubstitute(substitutingUser != null ? ctx.getUserDataDAO().loadOrCreateUserByLogin(substitutingUser) : null);
        pc.setCreateTime(new Date());
        pc.setProcessState(task.getTaskName());
        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.getComments().add(pc);
        pc.setComments(comments);
        pi.setSimpleAttribute("commentAdded", "true");
    }
View Full Code Here

TOP

Related Classes of pl.net.bluesoft.rnd.processtool.model.processdata.ProcessComments

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.