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

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


        cancelButton = createActionButton(getCancelButtonCaption())
    };
  }

  protected Form getCommentDetailsForm() {
    BeanItem<ProcessComment> bi = new BeanItem<ProcessComment>(processComment = new ProcessComment());

    Form f = new Form();
    f.setWriteThrough(false);
    f.setInvalidCommitted(false);
    f.setFormFieldFactory(new DefaultFieldFactory() {
View Full Code Here


    final Button addCommentButton = new Button(getMessage("processdata.comments.comment.add"));
        addCommentButton.addStyleName("default");
    addCommentButton.addListener(new Button.ClickListener() {
      @Override
      public void buttonClick(Button.ClickEvent event) {
        ProcessComment pc = new ProcessComment();
                ProcessToolContext ctx = ProcessToolContext.Util.getThreadProcessToolContext();
        pc.setAuthor(bpmSession.getUser(ctx));
                pc.setAuthorSubstitute(bpmSession.getSubstitutingUser(ctx));
        pc.setCreateTime(new Date());
        pc.setProcessState(processState);

        final BeanItem<ProcessComment> bi = new BeanItem<ProcessComment>(pc);
        displayCommentDetails(addCommentButton, bi);
      }
    });
View Full Code Here

    }

  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();
            }
          })
          .first();
      return comment.getBody();
    }
    return null;
  }
View Full Code Here

    }

  @Override
  protected AddCommentDialog createAddCommentDialog(ProcessComment processComment) {
    PropertyAutoWiring.autowire(this, getAutowiredProperties());
    return dialog = new AssignUserTaskDialog(new ProcessComment(), roleName);
  }
View Full Code Here

      showAddCommentDialog(params);
    }
  }

  protected void showAddCommentDialog(final PerformedActionParams params) {
    dialog = showDialog(createAddCommentDialog(new ProcessComment()));
    dialog.addListener(new AddCommentDialog.AddCommentListener() {
      @Override
      public void onCommentAdded() {
        handleAddComment(params);
      }
View Full Code Here

    private void saveComment() {
    if (skipAddingComment) {
      return;
    }
        ProcessToolContext ctx = getCurrentContext();
    ProcessComment pc = dialog.getProcessComment();
        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.ProcessComment

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.