[
http://jira.jboss.com/jira/browse/JBPM-590?page=all ]
Ronald van Kuijk resolved JBPM-590.
-----------------------------------
Resolution: Duplicate Issue
Active tasks after process termination
--------------------------------------
Key: JBPM-590
URL:
http://jira.jboss.com/jira/browse/JBPM-590
Project: JBoss jBPM
Issue Type: Bug
Components: Core Engine
Affects Versions: jBPM 3.1
Environment: Win XP SP2
Reporter: Alexey Kakunin
Assigned To: Tom Baeyens
I found that after terminating process with method ProcessInstance::end() there are still
task assigned to the users.
Here is simple TestCase for demonstating (I just change little bit
org.jbpm.taskmgmt.exe.TaskAssignmentDBTest):
package com.sample;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.db.AbstractDbTestCase;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.taskmgmt.def.AssignmentHandler;
import org.jbpm.taskmgmt.exe.Assignable;
import org.jbpm.taskmgmt.exe.TaskInstance;
import junit.framework.TestCase;
public class ProcessTerminationTestCase extends AbstractDbTestCase {
public static class JohnAssignmentHandler implements AssignmentHandler {
private static final long serialVersionUID = 1L;
public void assign(Assignable assignable, ExecutionContext executionContext)
throws Exception {
assignable.setActorId("john");
}
}
public void testPersonalTasklist() {
ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
"<process-definition>" +
" <start-state>" +
" <transition to='work' />" +
" </start-state>" +
" <task-node name='work'>" +
" <task name='feed the chickens'>" +
" <assignment
class='com.sample.ProcessTerminationTestCase$JohnAssignmentHandler' />" +
" </task>" +
" <task name='walk the dog'>" +
" <assignment
class='com.sample.ProcessTerminationTestCase$JohnAssignmentHandler' />" +
" </task>" +
" <task name='play with wife'>" +
" <assignment
class='com.sample.ProcessTerminationTestCase$JohnAssignmentHandler' />" +
" </task>" +
" </task-node>" +
"</process-definition>"
);
graphSession.saveProcessDefinition(processDefinition);
ProcessInstance processInstance = new ProcessInstance(processDefinition);
processInstance.signal();
jbpmContext.save(processInstance);
newTransaction();
List taskInstances = taskMgmtSession.findTaskInstances("john");
assertNotNull(taskInstances);
assertEquals(3, taskInstances.size());
// now, terminate the process
processInstance.end();
//check that process was ended
assertTrue("Process should be ended",
processInstance.hasEnded());
// so, people should have no any tasks related to this process
taskInstances = taskMgmtSession.findTaskInstances("john");
assertNotNull(taskInstances);
assertEquals("John should have no tasks in finished process",
0,
taskInstances.size());
}
}
As we will see from test execution - after termination of the process John still has 3
opened task - that is not very correct
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira