[jboss-user] [JBoss jBPM] - Task Instances - How to mark as complete?
CatlinIT
do-not-reply at jboss.com
Tue Mar 27 09:06:20 EDT 2007
A simple process definition of a couple of tasks:
"<process-definition name='threeStep'>" +
| " <start-state name='start'>" +
| " <transition to='s1' />" +
| " </start-state>" +
| " <task-node name='s1'>" +
| " <task name='t1'/>" +
| " <transition to='s2' />" +
| " </task-node>" +
| " <task-node name='s2'>" +
| " <task name='t2'/>" +
| " <transition to='s3' />" +
| " </task-node>" +
| " <end-state name='s3' />" +
| "</process-definition>"
|
Create this as an instance and signal() to start. Then, using the following gives the outstanding task instance t1
processInstance.getTaskMgmtInstance().getUnfinishedTasks(processInstance.getRootToken())
|
Use signal() to continue and then pauses at the next task, the line above now show t1 & t2 as unfinished. How do you mark the first task as finished?
I've tried by obtaining the task instance and using end() but this complains
the task is already ended:
Collection c = processInstance.getTaskMgmtInstance().getUnfinishedTasks(processInstance.getRootToken());
| for (Iterator i = c.iterator(); i.hasNext(); ) {
| TaskInstance ti = (TaskInstance) i.next();
| ti.setEnd(now);
| ti.end(); // Mark complete
| }
|
What is the correct way to interact with a task instance to ensure the state is set correctly before transitioning?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032012#4032012
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032012
More information about the jboss-user
mailing list