예제 #1
0
 public void addComment(Comment comment) {
   if (comment != null) {
     if (comments == null) comments = new ArrayList();
     comments.add(comment);
     comment.setTaskInstance(this);
     if (token != null) {
       comment.setToken(token);
       token.addComment(comment);
     }
   }
 }
예제 #2
0
  /** Add Token Comment */
  public static void addTokenComment(String user, long tokenId, String message)
      throws WorkflowException {
    log.debug("addTokenComment({}, {}, {})", new Object[] {user, tokenId, message});
    JbpmContext jbpmContext = JBPMUtils.getConfig().createJbpmContext();

    try {
      org.jbpm.graph.exe.Token t = jbpmContext.getToken(tokenId);
      t.addComment(new org.jbpm.graph.exe.Comment(user, message));
      jbpmContext.getSession().flush();
    } catch (JbpmException e) {
      throw new WorkflowException(e.getMessage(), e);
    } finally {
      jbpmContext.close();
    }

    log.debug("addTokenComment: void");
  }