[jBPM 4.2] Problem completing a Task
xalperte Nov 15, 2009 12:42 AMError when we try to complete a Task and the next activity is also a Task Activity with the "notification" tag set.
Something wrong happens in the MailListener during the process.
Without the "" tag the test runs without errors.
I'm using MySQL (with org.hibernate.dialect.MySQLInnoDBDialect configured).
The process definition is this:
<?xml version="1.0" encoding="UTF-8"?> <process description="This is a test process to test: task, swimlines, reminder/notifications, timers." name="Test Websale" xmlns="http://jbpm.org/4.2/jpdl"> <swimlane candidate-groups="sales" name="Sales Representative"/> <start g="265,19,48,48" name="Create new web sale order"> <transition g="14,-11" name="Start web sale" to="Evaluate web order"/> </start> <task form="tasks/form.evaluate.xhtml" g="213,110,153,57" name="Evaluate web order" swimlane="Sales Representative"> <transition g="14,-10" name="More info needed" to="Fix web order data"/> </task> <task assignee="rex" form="tasks/form.fix.xhtml" g="207,218,169,43" name="Fix web order data"> <notification /> <transition g="11,-10" name="End Process" to="To end"/> </task> <end g="270,303,48,48" name="To end" state="completed"/> </process>
And the Test Case used to force the error is this:
public class SimpleTestCase extends JbpmTestCase { String deploymentId; String salesDept; String clients; protected void setUp() throws Exception { super.setUp(); // create identities salesDept = identityService.createGroup("sales"); clients = identityService.createGroup("clients"); identityService.createUser("joe", "Joe", "Smoe", "joe@smoe"); identityService.createMembership("joe", salesDept, "sales-repre"); identityService.createUser("rex", "Rex", "Frez", "rex@frez"); identityService.createMembership("rex", clients, "client"); // deploy process deploymentId = repositoryService.createDeployment() .addResourceFromClasspath("test-simple-websale.jpdl.xml") .deploy(); // the tearDown of the parent class will dispose the registered deployments registerDeployment(deploymentId); } protected void tearDown() throws Exception { // delete identities identityService.deleteUser("joe"); identityService.deleteUser("rex"); identityService.deleteGroup(salesDept); identityService.deleteGroup(clients); super.tearDown(); } public void testWebSaleProcess() throws Throwable { // Starting a new instance of the process ProcessInstance instance = executionService.startProcessInstanceByKey("Test_Websale"); String processInstanceId = instance.getId(); // Looking for the group tasks List<Task> taskList = taskService.findGroupTasks("joe"); Task task = taskList.get(0); // lets assume that joe takes the task taskService.takeTask(task.getId(), "joe"); // looking for the new personal task taskList = taskService.findPersonalTasks("joe"); task = taskList.get(0); // Completing Task. taskService.completeTask(task.getId()); } }