[jboss-user] [jBPM] New message: "JBPM 4.3 Why is taskService.addTaskComment() only allowed for completed tasks?"

Arjan Jonker do-not-reply at jboss.com
Mon Feb 1 10:20:48 EST 2010


User development,

A new message was posted in the thread "JBPM 4.3 Why is taskService.addTaskComment() only allowed for completed tasks?":

http://community.jboss.org/message/523396#523396

Author  : Arjan Jonker
Profile : http://community.jboss.org/people/ajonker

Message:
--------------------------------------------------------------
This is not what I was expecting. On an active task, I try the following on task completion:
 
taskService.addTaskComment(command.getTaskId(), command.getRemark());
taskService.completeTask(command.getTaskId(), command.getOutcome());
 
But I get a JBPMException:
 
24806 [btpool0-1] WARN root  - Nested in org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.jbpm.api.JbpmException: task 10 doesn't exist:
org.jbpm.api.JbpmException: task 10 doesn't exist
    at org.jbpm.pvm.internal.cmd.AddTaskCommentCmd.execute(AddTaskCommentCmd.java:51)
    at org.jbpm.pvm.internal.cmd.AddTaskCommentCmd.execute(AddTaskCommentCmd.java:35)
    at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
 
 
Searching a little in the sources showed me that adding comments to tasks is only allowed on HistoryTasks:
 
org.jbpm.pvm.internal.cmd.AddTaskCommentCmd:
    HistoryTaskImpl historyTask = dbSession.get(HistoryTaskImpl.class, taskDbid);
    if (historyTask==null) {
      throw new JbpmException("task "+taskDbid+" doesn't exist");
    }
 
Why can't I add comments to running tasks? When the task is completed, adding comments seems a bit silly since it's already completed.
 
Kind regards,
 
Arjan

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/523396#523396




More information about the jboss-user mailing list