3 Replies Latest reply on Feb 8, 2008 12:17 PM by Mike Osganian

    Problem with nodes with async=

    Mike Osganian Newbie

      Hi i have the following process def:

       <process-definition>
       <start-state name='start-state1'>
       <description>start of the process</description>
       <transition name='start-to-check' to='One' />
       </start-state>
       <node name='One' async='true'>
       <script name='script_filecheck'>
       System.out.println(1);
       executionContext.leaveNode();
       </script>
       <transition name='check-to-fork' to='End'></transition>
       </node>
       <end-state name='End' />
       </process-definition>
      


      And the following java test code:

       ProcessDefinition processDefinition = saveAndReload(processDefinition);
      
       ProcessInstance processInstance = new ProcessInstance(processDefinition);
       processInstance.signal();
       jbpmContext.save(processInstance);
      
       assertEquals(processDefinition.getNode("One"),
       processInstance.getRootToken().getNode());
      


      The process gets to the "One" node but I don't know how to signal it to continue. If I start a new transaction nothing happens and if I try and signal again I get " org.jbpm.JbpmException: this token is locked by job[8]"

      What am I doing wrong?

      Thanks for any help

        • 1. Re: Problem with nodes with async=
          Mike Osganian Newbie

          Does anybody know if ansyc nodes are supported in 3.2.2? The user guide mentions classes that don't exist in the 3.2.2 distribution like CommandExecutor, ExecuteNodeCommand and ExecuteActionCommand. Also the AsynchronousCommand's execute method throws a UnsupportedOperationException. Also the 3.2.2 user guide mentions the JBPM_MESSAGE table but this table isn't part of that distribution but a previous 3.1 distribution.

          Can anybody shed any light on this for me?

          Thanks.

          • 2. Re: Problem with nodes with async=
            Ronald van Kuijk Master

            yes, the are supported. I have no examples at hand, but in CVS are a lot of unit tests. Also ones for this.

            • 3. Re: Problem with nodes with async=
              Mike Osganian Newbie

              Thanks for you reply. I'm alittle further now. The user guide is wrong. The class that runs the async nodes is called JobExecutor and you have to call the startJobExecutor method on the JBPM configuration to start it up. The problem I have now is that my Job gets persisted and its associated Token but in the Token table the ProcessInstance_ is set to NULL even though its non-null on the Token before its saved. So when the JobExecutor loads and run the Job I get this NullPointerException:

              12:12:18,140 [JbpmJobExector:192.168.100.109:1] DEBUG JobExecutorThread : exception while executing 'job[2]'
              org.jbpm.graph.def.DelegationException
               at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:387)
               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:585)
               at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
               at org.jbpm.graph.def.ProcessDefinition$$EnhancerByCGLIB$$d720fdf7.raiseException(<generated>)
               at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:378)
               at org.jbpm.graph.def.Node.execute(Node.java:344)
               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:585)
               at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
               at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$74685187.execute(<generated>)
               at org.jbpm.job.ExecuteNodeJob.execute(ExecuteNodeJob.java:27)
               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:585)
               at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
               at org.jbpm.job.Job$$EnhancerByCGLIB$$8e5776a.execute(<generated>)
               at org.jbpm.job.executor.JobExecutorThread.executeJob(JobExecutorThread.java:164)
               at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:64)
              Caused by: java.lang.NullPointerException
               at org.jbpm.graph.exe.Token.startCompositeLog(Token.java:377)
               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:585)
               at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
               at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$20f6f81b.startCompositeLog(<generated>)
               at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:240)
               at org.jbpm.graph.def.Node.execute(Node.java:339)
               ... 16 more
              


              How do I fix this?

              Thanks