Ejemplo n.º 1
0
  /** Add Task Instance Comment */
  public static void addTaskInstanceComment(String user, long taskInstanceId, String message)
      throws WorkflowException {
    log.debug("addTaskInstanceComment({}, {}, {})", new Object[] {user, taskInstanceId, message});
    JbpmContext jbpmContext = JBPMUtils.getConfig().createJbpmContext();

    try {
      TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
      org.jbpm.taskmgmt.exe.TaskInstance ti = taskMgmtSession.getTaskInstance(taskInstanceId);
      ti.addComment(new org.jbpm.graph.exe.Comment(user, message));
      jbpmContext.getSession().flush();
    } catch (JbpmException e) {
      throw new WorkflowException(e.getMessage(), e);
    } finally {
      jbpmContext.close();
    }
  }
Ejemplo n.º 2
0
 public void addComment(String message) {
   addComment(new Comment(message));
 }
 @Override
 public void initializeTaskVariables(
     TaskInstance taskInstance, ContextInstance contextInstance, Token token) {
   taskInstance.addComment((Comment) token.getComments().get(token.getComments().size() - 1));
   taskInstance.setVariableLocally("directive", WORKFLOW_DIRECTIVE_TASK_REJECTED);
 }