[jboss-user] [JBoss jBPM] - Re: Task nodes problem

Black83Angel do-not-reply at jboss.com
Sun Nov 2 06:26:37 EST 2008


Ok, no problem: I think I just solved the matter following a simple example I found browsing the net; the example manages different tasks by creating different task instances:


  | Token token = processInstance.getRootToken();
  | 
  | <some code that brings the process to task-node 1>
  | 
  | TaskInstance t1 = (TaskInstance) processInstance.getTaskMgmtInstance().getTaskInstances().iterator().next();            
  | t1.start();
  |  out.println("some feedback for task 1");
  | t1.end("task2");
  | 
  | token.signal();
  | 
  | TaskInstance t2 = (TaskInstance) processInstance.getTaskMgmtInstance().getUnfinishedTasks(token).iterator().next();
  | t2.start();
  | out.println("some fedback for task 2");
  | t2.end("end state");
  | 

I did not use the "getUnfinishedTasks(token)" function, now it seems to work: I assign actor to the task in a java class implementing AssignmentHandler.

If you don't mind, I have another question: on jBPM online documentation, cap 12 ("task management") I read that "Tasks can be defined in task-nodes and in the process-definition"; now I defined my task in the processdefinition.xml file:


  | <task-node name="task1">          
  |         <task name="task1">
  |             <assignment class="task1HandlerClass" />
  |         </task>        
  |         <transition name="follow" to="state2" />               
  | </task-node>
  | 

...but what about if I want to define tasks following another way? The docs say that "task instance creation might be based upon a runtime calculation. In that case, add an ActionHandler on the nodeenter event of the task-node and set the attribute create-tasks=false."; so, I guess something like:


  | <task-node name="task1" create-tasks="false">
  |         <event type="node-enter">
  |             <action class="createTask1" name="task1" />
  |         </event>
  | </task-node>
  | 

Getting to the point, what is the meaning of the "create-tasks=false" attribute? And, how can I assign the handler to a task created in such way? Do I simply introduce an  in the task node, as above?

Thanks...

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

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



More information about the jboss-user mailing list