[jboss-user] [JBoss Seam] - Re: Seam jBPM: use annotation or pages.xml to get next task?

avbentem do-not-reply at jboss.com
Fri Mar 30 09:48:55 EDT 2007


"petemuir" wrote : Then wire it up
  | <page view-id="/assignTask.xhtml" action="#{taskFinder.autoStart()}">
  |   |    <navigation>
  |   |        ...
  |   |    </navigation>
  |   | </page>

This works great for some process definitions, but I cannot get this to work with sub-processes. 

When I start some process that immediately delegates to some sub-process, then a ProcessInstance is injected, but TaskMgmtInstance#getTaskInstances() returns zero elements in the getSingleTaskInstance I posted earlier:
@In ProcessInstance processInstance;
  | 
  | public TaskInstance getSingleTaskInstance() {
  |     // BEWARE: THIS IS WRONG. This returns all the taskInstances
  |     // for the process instance, which includes task instances 
  |     // that have already been completed previously.
  |     Collection<TaskInstance> taskInstances =
  |         processInstance.getTaskMgmtInstance().getTaskInstances();
  | 
  |     if (taskInstances.size() != 1) {
  |         log.error("Expected single task, found #0", taskInstances.size());
  |         return null;
  |     }
  |     return taskInstances.iterator().next();
  | }

So I guess jBPM simply has not created the sub-process yet. Debugging shows that the process instance is indeed the parent process instance at that point.

As for the warning in the code above: I guess I should use getUnfinishedTasks(Token), or discard the finished tasks that getTaskInstances() returns.

Arjan.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033174#4033174

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033174



More information about the jboss-user mailing list