10 Replies Latest reply on Oct 28, 2009 11:13 AM by nilspreusker

    [JBPM4 Error]Getting error while 2 tasks are created on same

      I have a process as below
      (Start -> Task-1(Assign it to User1) -> Task-2(Assign it to User2) -> Task-3 (Assign to User 3) -> End.
      I started the process instance and then signalled the it from Start to Task-1 a task is generated for User1 (checked in the database). Now I signalled the process again and the process got moved ahead to Task-2 and a new task is created for User2 now when I signalled the process instance again got the error org.hibernate.NonUniqueResultException: query did not return a unique result: 2. Below is the stack trace. Please let me know if this is a bug and when can we expect this to be fixed.

      ### EXCEPTION ###########################################
      17:56:46,189 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.SignalCmd@1971eb3
      org.hibernate.NonUniqueResultException: query did not return a unique result: 2
      at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
      at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
      at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findTaskByExecution(DbSessionImpl.java:382)
      at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:115)
      at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:101)
      at org.jbpm.pvm.internal.model.op.Signal.perform(Signal.java:68)
      at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
      at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:597)
      at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:398)
      at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61)
      at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35)
      at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
      at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:88)
      at ForkClass.main(ForkClass.java:45)
      ### EXCEPTION ###########################################
      Exception in thread "main" org.hibernate.NonUniqueResultException: query did not return a unique result: 2
      at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
      at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
      at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findTaskByExecution(DbSessionImpl.java:382)
      at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:115)
      at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:101)
      at org.jbpm.pvm.internal.model.op.Signal.perform(Signal.java:68)
      at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
      at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:597)
      at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:398)
      at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61)
      at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35)
      at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
      at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:88)
      at ForkClass.main(ForkClass.java:45)

        • 1. Re: [JBPM4 Error]Getting error while 2 tasks are created on
          tejjbpm

          How r u querying the database? is it your test case?

          Did you try querying the jbpm db directly and see whether the data is ok?

          • 3. Re: [JBPM4 Error]Getting error while 2 tasks are created on

            === Environment ==============================
            - jBPM Version : jBPM4.0
            - Database : Oracle 10g
            - JDK : jdk1.5.0_16
            - Container : jdk1.5.0_16
            - Configuration : No customization done
            - Libraries : libraries that comes with jBPM

            === Process ==================================
            <?xml version="1.0" encoding="UTF-8"?>

















            === API ===================================
            String processNameWV = "SimpleTaskCreation";
            String processName = processNameWV+"-1";
            String key = "MainProcess1.1";
            String executionId = processNameWV+"."+key;
            ProcessInstance processInstance = executionService.startProcessInstanceByKey(processNameWV,key );
            executionService.signalExecutionById(executionId);
            executionService.signalExecutionById(executionId);

            === Stacktrace ==============================
            16:01:24,379 INF | [Environment] Hibernate 3.3.1.GA
            16:01:24,379 INF | [Environment] hibernate.properties not found
            16:01:24,389 INF | [Environment] Bytecode provider name : javassist
            16:01:24,389 INF | [Environment] using JDK 1.4 java.sql.Timestamp handling
            16:01:24,459 INF | [Configuration] configuring from resource: jbpm.hibernate.cfg.xml
            16:01:24,459 INF | [Configuration] Configuration resource: jbpm.hibernate.cfg.xml
            16:01:24,559 INF | [Configuration] Reading mappings from resource : jbpm.repository.hbm.xml
            16:01:24,810 INF | [Configuration] Reading mappings from resource : jbpm.execution.hbm.xml
            16:01:25,000 INF | [Configuration] Reading mappings from resource : jbpm.history.hbm.xml
            16:01:25,130 INF | [Configuration] Reading mappings from resource : jbpm.task.hbm.xml
            16:01:25,180 INF | [Configuration] Reading mappings from resource : jbpm.identity.hbm.xml
            16:01:25,210 INF | [Configuration] Configured SessionFactory: null
            16:01:25,240 INF | [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
            16:01:25,250 INF | [DriverManagerConnectionProvider] Hibernate connection pool size: 20
            16:01:25,250 INF | [DriverManagerConnectionProvider] autocommit mode: false
            16:01:25,260 INF | [DriverManagerConnectionProvider] using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@172.18.17.40:1521:etv2
            16:01:25,260 INF | [DriverManagerConnectionProvider] connection properties: {user=jbpm4, password=****}
            16:01:25,621 INF | [Dialect] Using dialect: org.hibernate.dialect.Oracle9iDialect
            16:01:25,641 INF | [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
            16:01:25,641 INF | [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
            16:01:25,641 INF | [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
            16:01:25,711 INF | [SessionFactoryImpl] building session factory
            16:01:26,722 INF | [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
            16:01:27,774 FIN | [ProcessDefinitionImpl] creating new execution for process 'SimpleTaskCreation'
            16:01:27,804 FIN | [DefaultIdGenerator] generated execution id SimpleTaskCreation.MainProcess1.1
            16:01:27,804 FIN | [ExecuteActivity] executing activity(start1)
            16:01:27,814 FIN | [ExecuteActivity] executing activity(task1)
            16:01:27,884 FIN | [Signal] signalling activity(task1), signalName=null
            16:01:27,894 FIN | [ExecuteActivity] executing activity(task2)
            16:01:27,974 FIN | [Signal] signalling activity(task2), signalName=null
            ### EXCEPTION ###########################################
            16:01:27,984 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.SignalCmd@a166bd
            org.hibernate.NonUniqueResultException: query did not return a unique result: 2
            at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
            at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
            at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findTaskByExecution(DbSessionImpl.java:382)
            at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:115)
            at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:101)
            at org.jbpm.pvm.internal.model.op.Signal.perform(Signal.java:68)
            at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
            at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:597)
            at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:398)
            at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61)
            at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35)
            at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
            at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
            at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
            at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
            at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:84)
            at TechPoC.TestJBPM4.main(TestJBPM4.java:171)
            ### EXCEPTION ###########################################
            Exception in thread "main" org.hibernate.NonUniqueResultException: query did not return a unique result: 2
            at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
            at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
            at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findTaskByExecution(DbSessionImpl.java:382)
            at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:115)
            at org.jbpm.jpdl.internal.activity.TaskActivity.signal(TaskActivity.java:101)
            at org.jbpm.pvm.internal.model.op.Signal.perform(Signal.java:68)
            at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
            at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:597)
            at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:398)
            at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61)
            at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35)
            at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
            at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
            at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
            at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
            at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:84)
            at TechPoC.TestJBPM4.main(TestJBPM4.java:171)

            === Debug logs ==============================
            past debug logs here

            === Problem description =========================
            I started the process instance and then signalled it from Start to Task-1 a task is generated for User1 (checked in the database).
            Now I signalled the process again and the process got moved ahead to Task-2 and a new task is created for User2.
            Now when I signalled the process instance again got the error org.hibernate.NonUniqueResultException: query did not return a unique result: 2 . Below is the stack trace. Please let me know if this is a bug and when can we expect this to be fixed.

            • 4. Re: [JBPM4 Error]Getting error while 2 tasks are created on

               

              <?xml version="1.0" encoding="UTF-8"?>
              
              <process name="SimpleTaskCreation" xmlns="http://jbpm.org/4.0/jpdl">
               <start name="start1" g="292,97,48,48">
               <transition to="task1"/>
               </start>
               <end name="end1" g="272,471,48,48"/>
               <task name="task1" g="239,180,92,52">
               <transition to="task2"/>
               </task>
               <task name="task2" g="271,291,92,52">
               <transition to="task3"/>
               </task>
               <task name="task3" g="197,392,92,52">
               <transition to="end1"/>
               </task>
              </process>


              • 5. Re: [JBPM4 Error]Getting error while 2 tasks are created on
                nilspreusker

                @sushantgupta402: Did u find a solution to this yet? I have a similar problem and would be interested to know whether you found out what the issue was. Cheers, Nils

                • 6. Re: [JBPM4 Error]Getting error while 2 tasks are created on

                  Hi Nils,
                  I did not tried much to figure out a workaround for the problem as our client decided to go with an earlier version of JBPM. I will try to find a workaround by this weekend if it is too late do let me know and I may try too get it done earlier. I think one of the workaround would be to modify the query causing the exception.

                  • 7. Re: [JBPM4 Error]Getting error while 2 tasks are created on
                    nilspreusker

                    Sushant, don't worry, I'll dig deeper into this myself.

                    Cheers, Nils

                    • 8. Re: [JBPM4 Error]Getting error while 2 tasks are created on
                      nilspreusker

                      I've verified this problem, it occurs when two subsequent tasks are both assigned to the same person and the second one contains a notification node. When the first task is completed, the MailListener will use the findTaskByExecution method of DbSessionImpl.java, which in turn queries the database for tasks by execution. This causes the NonUniqueResult exception, as there are more tasks associated with the execution. See test case below:

                      === Environment ==============================
                      - jBPM Version : 4.1
                      - Database : MySQL 5 or HSQL
                      - JDK : Java 6 on Mac OS X Snow Leopard
                      - Container : java version "1.6.0_15"
                      Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
                      Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode)
                      - Configuration : standard config file
                      - Libraries : standard jbpm setup

                      === Process ==================================

                      <?xml version="1.0" encoding="UTF-8"?>
                      
                      <process name="MultipleTasks" xmlns="http://jbpm.org/4.0/jpdl">
                       <start name="start1" g="38,16,48,48">
                       <transition name="to task1" to="task1" g="-48,-19"/>
                       </start>
                       <task name="task1" g="16,96,92,52" assignee="johndoe">
                       <transition name="to task2" to="task2" g="-48,-19"/>
                       </task>
                       <task name="task2" g="16,180,92,52" assignee="johndoe">
                       <notification/>
                       <transition name="to end1" to="end1" g="-46,-19"/>
                       </task>
                       <end name="end1" g="38,264,48,48"/>
                      
                      </process>


                      === API ===================================
                      package org.jbpm.examples.task.multiple;
                      
                      import java.util.List;
                      
                      import org.jbpm.api.task.Task;
                      import org.jbpm.test.JbpmTestCase;
                      import org.subethamail.wiser.Wiser;
                      
                      public class MultipleTasksTest extends JbpmTestCase {
                      
                       Wiser wiser = new Wiser();
                       String deploymentId;
                      
                       protected void setUp() throws Exception {
                       super.setUp();
                      
                       // deploy the process definition
                       deploymentId = repositoryService.createDeployment()
                       .addResourceFromClasspath(
                       "org/jbpm/examples/task/multiple/process.jpdl.xml")
                       .deploy();
                      
                       // create actor
                       identityService.createUser("johndoe", "John", "Doe", "john@doe");
                      
                       // start mail server
                       wiser.setPort(2525);
                       wiser.start();
                       }
                      
                       protected void tearDown() throws Exception {
                       // stop mail server
                       wiser.stop();
                       repositoryService.deleteDeploymentCascade(deploymentId);
                       super.tearDown();
                       }
                      
                       public void testOltWorkflow() {
                       executionService.startProcessInstanceByKey("MultipleTasks");
                      
                       List<Task> taskList = taskService.findPersonalTasks("johndoe");
                       assertEquals(1, taskList.size());
                       Task task = taskList.get(0);
                       assertEquals("task1", task.getName());
                       assertEquals("johndoe", task.getAssignee());
                      
                       // submit the task
                       taskService.completeTask(task.getId(), "to task2"); /*This is where it goes wrong...*/
                      
                       // verify that the next task is active and has been assigned to
                       // 'johndoe'
                       taskList = taskService.findPersonalTasks("johndoe");
                       assertEquals(1, taskList.size());
                       task = taskList.get(0);
                       assertEquals("task2", task.getName());
                       assertEquals("johndoe", task.getAssignee());
                       }
                      
                      }


                      === Stacktrace ==============================
                      org.hibernate.NonUniqueResultException: query did not return a unique result: 2
                      at org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:844)
                      at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
                      at org.jbpm.pvm.internal.hibernate.DbSessionImpl.findTaskByExecution(DbSessionImpl.java:383)
                      at org.jbpm.jpdl.internal.activity.MailListener.notify(MailListener.java:50)
                      at org.jbpm.pvm.internal.model.op.ExecuteEventListener.perform(ExecuteEventListener.java:81)
                      at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperationSync(ExecutionImpl.java:637)
                      at org.jbpm.pvm.internal.model.ExecutionImpl.performAtomicOperation(ExecutionImpl.java:597)
                      at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:398)
                      at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:384)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:597)
                      at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
                      at org.jbpm.pvm.internal.model.ExecutionImpl_$$_javassist_4.signal(ExecutionImpl_$$_javassist_4.java)
                      at org.jbpm.pvm.internal.task.TaskImpl.complete(TaskImpl.java:194)
                      at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:60)
                      at org.jbpm.pvm.internal.cmd.CompleteTaskCmd.execute(CompleteTaskCmd.java:32)
                      at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
                      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
                      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:46)
                      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
                      at org.jbpm.pvm.internal.svc.TaskServiceImpl.completeTask(TaskServiceImpl.java:96)
                      at org.jbpm.examples.task.multiple.MultipleTasksTest.testOltWorkflow(MultipleTasksTest.java:47)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      at java.lang.reflect.Method.invoke(Method.java:597)
                      at junit.framework.TestCase.runTest(TestCase.java:164)
                      at org.jbpm.test.BaseJbpmTestCase.runTest(BaseJbpmTestCase.java:80)
                      at junit.framework.TestCase.runBare(TestCase.java:130)
                      at junit.framework.TestResult$1.protect(TestResult.java:106)
                      at junit.framework.TestResult.runProtected(TestResult.java:124)
                      at junit.framework.TestResult.run(TestResult.java:109)
                      at junit.framework.TestCase.run(TestCase.java:120)
                      at junit.framework.TestSuite.runTest(TestSuite.java:230)
                      at junit.framework.TestSuite.run(TestSuite.java:225)
                      at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
                      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

                      === Debug logs ==============================

                      === Problem description =========================
                      Problem occurs when two subsequent tasks are both assigned to the same person and the second one contains a notification node

                      • 9. Re: [JBPM4 Error]Getting error while 2 tasks are created on

                        Nils,
                        For me it happens even if the second task in not a notification node. Please see the process definition attached by me.

                        • 10. Re: [JBPM4 Error]Getting error while 2 tasks are created on
                          nilspreusker

                          Sushant, try this:

                          JUnit Test Case:

                          package org.jbpm.examples.task.multiple1;
                          
                          import java.util.List;
                          
                          import org.jbpm.api.ProcessInstance;
                          import org.jbpm.api.task.Task;
                          import org.jbpm.test.JbpmTestCase;
                          
                          public class MultipleTasksTest1 extends JbpmTestCase {
                          
                           String deploymentId;
                          
                           protected void setUp() throws Exception {
                           super.setUp();
                          
                           // deploy the process definition
                           deploymentId = repositoryService.createDeployment()
                           .addResourceFromClasspath(
                           "org/jbpm/examples/task/multiple1/process.jpdl.xml")
                           .deploy();
                          
                           // create actor
                           identityService.createUser("johndoe", "John", "Doe", "john@doe");
                           }
                          
                           protected void tearDown() throws Exception {
                          
                           }
                          
                           public void testMultipleTasks() {
                           ProcessInstance processInstance = executionService
                           .startProcessInstanceByKey("MultipleTasks");
                          
                           String processInstanceId = processInstance.getId();
                          
                           assertTrue(executionService.createProcessInstanceQuery()
                           .processInstanceId(processInstanceId).uniqueResult().isActive(
                           "task1"));
                          
                           List<Task> taskList = taskService.findPersonalTasks("johndoe");
                           assertEquals(1, taskList.size());
                           Task task = taskList.get(0);
                           assertEquals("task1", task.getName());
                           assertEquals("johndoe", task.getAssignee());
                          
                           // submit the task
                           taskService.completeTask(task.getId(), "to task2");
                          
                           // verify that the next task is active and has been assigned to
                           // 'johndoe'
                           taskList = taskService.findPersonalTasks("johndoe");
                           assertEquals(1, taskList.size());
                           task = taskList.get(0);
                           assertEquals("task2", task.getName());
                           assertEquals("johndoe", task.getAssignee());
                          
                           // submit the task
                           taskService.completeTask(task.getId(), "to task3");
                          
                           // verify that the next task is active and has been assigned to
                           // 'johndoe'
                           taskList = taskService.findPersonalTasks("johndoe");
                           assertEquals(1, taskList.size());
                           task = taskList.get(0);
                           assertEquals("task3", task.getName());
                           assertEquals("johndoe", task.getAssignee());
                           }
                          
                          }
                          


                          Process Definition (process.jpdl.xml):
                          <?xml version="1.0" encoding="UTF-8"?>
                          
                          <process name="MultipleTasks" xmlns="http://jbpm.org/4.0/jpdl">
                           <start g="38,16,48,48" name="start1">
                           <transition g="-48,-19" name="to task1" to="task1"/>
                           </start>
                           <task assignee="johndoe" g="16,96,92,52" name="task1">
                           <transition g="-48,-19" name="to task2" to="task2"/>
                           </task>
                           <task assignee="johndoe" g="16,180,92,52" name="task2">
                           <transition name="to task3" to="task3" g="-48,-19"/>
                           </task>
                           <task assignee="johndoe" name="task3" g="16,264,92,52"/>
                          
                          </process>