6 Replies Latest reply on Nov 29, 2005 11:49 AM by sateesh kumar

    token.signal() throwing DelegationException

    sateesh kumar Newbie

      Hi,

      I have a Simple ProcessDefinition . I have loaded the Process Definition into the DB and when i created a process Instance and called the token.signal() it is throwing this Exception..


      ProcessInstance processInstance = new ProcessInstance(processDefinition);
      
       processInstance.getContextInstance().setVariable("UserId",((UserInfoBean)this.getSession().getValue("User")).getUserId());
      
       Token token = processInstance.getRootToken();
       System.out.println("Root Node Name :"+token.getNode().getName());
      
       token.signal();
      


      And my Process Definition looks like..

      <process-definition name="DispAgreement">
      
       <start-state name="Start">
       <transition name="start" to="Draft Disp Agreement"></transition>
       </start-state>
      
       <task-node name="Draft Disp Agreement">
       <task name="Create Draft">
       <assignment class="DraftAssignmentHandler"></assignment>
       </task>
       <transition to="Request Comments">
       </transition>
       </task-node>
      
       ....
      
      </process-definition>
      


      Root Node Name :Start
      [/jBPMWeb] Unhandled exception caught in Global.app:
      org.jbpm.graph.def.DelegationException
      at org.jbpm.graph.def.GraphElement.raiseException(Ljava.lang.Throwable;L
      org.jbpm.graph.exe.ExecutionContext;)V(GraphElement.java:299)
      at org.jbpm.graph.def.GraphElement.raiseException(Ljava.lang.Throwable;L
      org.jbpm.graph.exe.ExecutionContext;)V(GraphElement.java:293)
      at org.jbpm.graph.def.GraphElement.raiseException(Ljava.lang.Throwable;L
      org.jbpm.graph.exe.ExecutionContext;)V(GraphElement.java:293)
      at org.jbpm.taskmgmt.exe.TaskMgmtInstance.invokeAssignmentHandler(Lorg.j
      bpm.instantiation.Delegation;Lorg.jbpm.taskmgmt.exe.Assignable;Lorg.jbpm.graph.e
      xe.ExecutionContext;)V(TaskMgmtInstance.java:149)
      at org.jbpm.taskmgmt.exe.TaskInstance.assign(Lorg.jbpm.graph.exe.Executi
      onContext;)V(TaskInstance.java:138)
      at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(Lorg.jbpm.t
      askmgmt.def.Task;Lorg.jbpm.graph.exe.ExecutionContext;)Lorg.jbpm.taskmgmt.exe.Ta
      skInstance;(TaskMgmtInstance.java:102)
      at org.jbpm.graph.node.TaskNode.execute(Lorg.jbpm.graph.exe.ExecutionCon
      text;)V(TaskNode.java:136)
      at org.jbpm.graph.def.Node.enter(Lorg.jbpm.graph.exe.ExecutionContext;)V
      (Node.java:284)
      at org.jbpm.graph.def.Transition.take(Lorg.jbpm.graph.exe.ExecutionConte
      xt;)V(Transition.java:92)
      at org.jbpm.graph.def.Node.leave(Lorg.jbpm.graph.exe.ExecutionContext;Lo
      rg.jbpm.graph.def.Transition;)V(Node.java:349)
      at org.jbpm.graph.node.StartState.leave(Lorg.jbpm.graph.exe.ExecutionCon
      text;Lorg.jbpm.graph.def.Transition;)V(StartState.java:73)
      at org.jbpm.graph.exe.Token.signal(Lorg.jbpm.graph.def.Transition;)V(Tok
      en.java:127)
      at org.jbpm.graph.exe.Token.signal()V(Token.java:92)
      at Controller.createDispositionAgreement()Lcom.bea.wlw.netui.pageflow.Fo
      rward;(Controller.jpf:276)
      at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.
      lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.l
      ang.Object;)Ljava.lang.Object;(Unknown Source)
      at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[
      Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;
      I)Ljava.lang.Object;(Unknown Source)
      at com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(Ljava.la
      ng.reflect.Method;Lorg.apache.struts.action.ActionForm;Ljavax.servlet.http.HttpS
      ervletRequest;Lorg.apache.struts.action.ActionMapping;)Lorg.apache.struts.action
      .ActionForward;(FlowController.java:1519)
      at com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(Ljav
      a.lang.String;Lorg.apache.struts.action.ActionForm;Ljavax.servlet.http.HttpServl
      etRequest;Ljavax.servlet.http.HttpServletResponse;Lorg.apache.struts.action.Acti
      onMapping;)Lorg.apache.struts.action.ActionForward;(FlowController.java:1445)
      at com.bea.wlw.netui.pageflow.FlowController.internalExecute(Lorg.apache
      .struts.action.ActionMapping;Lorg.apache.struts.action.ActionForm;Ljavax.servlet
      .http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)Lorg.apache.st
      ruts.action.ActionForward;(FlowController.java:776)
      at com.bea.wlw.netui.pageflow.PageFlowController.internalExecute(Lorg.ap
      ache.struts.action.ActionMapping;Lorg.apache.struts.action.ActionForm;Ljavax.ser
      vlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)Lorg.apach
      e.struts.action.ActionForward;(PageFlowController.java:211)
      at com.bea.wlw.netui.pageflow.FlowController.execute(Lorg.apache.struts.
      action.ActionMapping;Lorg.apache.struts.action.ActionForm;Ljavax.servlet.http.Ht
      tpServletRequest;Ljavax.servlet.http.HttpServletResponse;)Lorg.apache.struts.act
      ion.ActionForward;(FlowController.java:606)
      at org.apache.struts.action.RequestProcessor.processActionPerform(Ljavax
      .servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;Lorg.ap
      ache.struts.action.Action;Lorg.apache.struts.action.ActionForm;Lorg.apache.strut
      s.action.ActionMapping;)Lorg.apache.struts.action.ActionForward;(RequestProcesso
      r.java:484)
      at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processActionPerf
      orm(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletRespon
      se;Lorg.apache.struts.action.Action;Lorg.apache.struts.action.ActionForm;Lorg.ap
      ache.struts.action.ActionMapping;)Lorg.apache.struts.action.ActionForward;(PageF
      lowRequestProcessor.java:1354)
      at org.apache.struts.action.RequestProcessor.process(Ljavax.servlet.http
      .HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(RequestProcessor.
      java:274)
      at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(Ljavax.se
      rvlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(PageFlo
      wRequestProcessor.java:650)
      at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(Ljavax.s
      ervlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(AutoRe
      gisterActionServlet.java:527)
      at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(Ljavax.servl
      et.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(PageFlowAc
      tionServlet.java:152)
      at org.apache.struts.action.ActionServlet.doGet(Ljavax.servlet.http.Http
      ServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(ActionServlet.java:507
      )
      at javax.servlet.http.HttpServlet.service(Ljavax.servlet.http.HttpServle
      tRequest;Ljavax.servlet.http.HttpServletResponse;)V(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(Ljavax.servlet.ServletRequest;
      Ljavax.servlet.ServletResponse;)V(HttpServlet.java:853)
      Caused by: java.lang.NullPointerException
      at org.jbpm.taskmgmt.exe.TaskMgmtInstance.invokeAssignmentHandler(Lorg.j
      bpm.instantiation.Delegation;Lorg.jbpm.taskmgmt.exe.Assignable;Lorg.jbpm.graph.e
      xe.ExecutionContext;)V(TaskMgmtInstance.java:143)
      at org.jbpm.taskmgmt.exe.TaskInstance.assign(Lorg.jbpm.graph.exe.Executi
      onContext;)V(TaskInstance.java:138)
      at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(Lorg.jbpm.t
      askmgmt.def.Task;Lorg.jbpm.graph.exe.ExecutionContext;)Lorg.jbpm.taskmgmt.exe.Ta
      skInstance;(TaskMgmtInstance.java:102)
      at org.jbpm.graph.node.TaskNode.execute(Lorg.jbpm.graph.exe.ExecutionCon
      text;)V(TaskNode.java:136)
      at org.jbpm.graph.def.Node.enter(Lorg.jbpm.graph.exe.ExecutionContext;)V
      (Node.java:284)
      at org.jbpm.graph.def.Transition.take(Lorg.jbpm.graph.exe.ExecutionConte
      xt;)V(Transition.java:92)
      at org.jbpm.graph.def.Node.leave(Lorg.jbpm.graph.exe.ExecutionContext;Lo
      rg.jbpm.graph.def.Transition;)V(Node.java:349)
      at org.jbpm.graph.node.StartState.leave(Lorg.jbpm.graph.exe.ExecutionCon
      text;Lorg.jbpm.graph.def.Transition;)V(StartState.java:73)
      at org.jbpm.graph.exe.Token.signal(Lorg.jbpm.graph.def.Transition;)V(Tok
      en.java:127)
      at org.jbpm.graph.exe.Token.signal()V(Token.java:92)
      at Controller.createDispositionAgreement()Lcom.bea.wlw.netui.pageflow.Fo
      rward;(Controller.jpf:276)
      at jrockit.reflect.NativeMethodInvoker.invoke0(Ljava.lang.Object;ILjava.
      lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.l
      ang.Object;)Ljava.lang.Object;(Unknown Source)
      at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[
      Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
      at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;
      I)Ljava.lang.Object;(Unknown Source)
      at com.bea.wlw.netui.pageflow.FlowController.invokeActionMethod(Ljava.la
      ng.reflect.Method;Lorg.apache.struts.action.ActionForm;Ljavax.servlet.http.HttpS
      ervletRequest;Lorg.apache.struts.action.ActionMapping;)Lorg.apache.struts.action
      .ActionForward;(FlowController.java:1519)
      at com.bea.wlw.netui.pageflow.FlowController.getActionMethodForward(Ljav
      a.lang.String;Lorg.apache.struts.action.ActionForm;Ljavax.servlet.http.HttpServl
      etRequest;Ljavax.servlet.http.HttpServletResponse;Lorg.apache.struts.action.Acti
      onMapping;)Lorg.apache.struts.action.ActionForward;(FlowController.java:1445)
      at com.bea.wlw.netui.pageflow.FlowController.internalExecute(Lorg.apache
      .struts.action.ActionMapping;Lorg.apache.struts.action.ActionForm;Ljavax.servlet
      .http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)Lorg.apache.st
      ruts.action.ActionForward;(FlowController.java:776)
      at com.bea.wlw.netui.pageflow.PageFlowController.internalExecute(Lorg.ap
      ache.struts.action.ActionMapping;Lorg.apache.struts.action.ActionForm;Ljavax.ser
      vlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)Lorg.apach
      e.struts.action.ActionForward;(PageFlowController.java:211)
      at com.bea.wlw.netui.pageflow.FlowController.execute(Lorg.apache.struts.
      action.ActionMapping;Lorg.apache.struts.action.ActionForm;Ljavax.servlet.http.Ht
      tpServletRequest;Ljavax.servlet.http.HttpServletResponse;)Lorg.apache.struts.act
      ion.ActionForward;(FlowController.java:606)
      at org.apache.struts.action.RequestProcessor.processActionPerform(Ljavax
      .servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;Lorg.ap
      ache.struts.action.Action;Lorg.apache.struts.action.ActionForm;Lorg.apache.strut
      s.action.ActionMapping;)Lorg.apache.struts.action.ActionForward;(RequestProcesso
      r.java:484)
      at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.processActionPerf
      orm(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletRespon
      se;Lorg.apache.struts.action.Action;Lorg.apache.struts.action.ActionForm;Lorg.ap
      ache.struts.action.ActionMapping;)Lorg.apache.struts.action.ActionForward;(PageF
      lowRequestProcessor.java:1354)
      at org.apache.struts.action.RequestProcessor.process(Ljavax.servlet.http
      .HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(RequestProcessor.
      java:274)
      at com.bea.wlw.netui.pageflow.PageFlowRequestProcessor.process(Ljavax.se
      rvlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(PageFlo
      wRequestProcessor.java:650)
      at com.bea.wlw.netui.pageflow.AutoRegisterActionServlet.process(Ljavax.s
      ervlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(AutoRe
      gisterActionServlet.java:527)
      at com.bea.wlw.netui.pageflow.PageFlowActionServlet.process(Ljavax.servl
      et.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(PageFlowAc
      tionServlet.java:152)
      at org.apache.struts.action.ActionServlet.doGet(Ljavax.servlet.http.Http
      ServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(ActionServlet.java:507
      )
      at javax.servlet.http.HttpServlet.service(Ljavax.servlet.http.HttpServle
      tRequest;Ljavax.servlet.http.HttpServletResponse;)V(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(Ljavax.servlet.ServletRequest;
      Ljavax.servlet.ServletResponse;)V(HttpServlet.java:853)
      at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
      ()Ljava.lang.Object;(ServletStubImpl.java:1006)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servle
      t.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.Filte
      rChainImpl;)V(ServletStubImpl.java:419)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servle
      t.ServletRequest;Ljavax.servlet.ServletResponse;)V(ServletStubImpl.java:315)

      Thanks
      Sateesh

        • 1. Re: token.signal() throwing DelegationException
          sateesh kumar Newbie

          Hi,

          I used the same Process Definition and ran it without DB Persistence and it ran successfully. So it has some thing to do with the way i am persisting the Process Definition....

          In my Code i am deloying the same ProcessDefinition (as i am running the same Page FLow again and again) and hence it is getting stored in the DB multiple times ..

          And interestingly the following method

          
          processDefinition = jbpmSession.getGraphSession().findLatestProcessDefinition(processDefName);
          
          


          is not returning the most recently stored ProcessDefinition !!!

          The Process Definition i loaded when i ran my application for the first time had the invalid Assignment Handler ClassName and hence the exception..

          Now tried to delete the Old Process Definitions first using the following Command

          
          SQL> delete from JBPM_PROCESSDEFINITION;
          delete from JBPM_PROCESSDEFINITION
          *
          ERROR at line 1:
          ORA-02292: integrity constraint (JBPM.FK_DELEGATION_PRCD) violated - child
          record found
          
          


          i am able to delete all the old process definitions ( not only process Definitions but also all the other details that are stored in other tables..) using the script

          
          sql > @oralce.clean.sql;
          
          



          Thanks
          ~Sateesh



          • 2. Re: token.signal() throwing DelegationException
            Alejandro Guizar Master

             

            So it has some thing to do with the way i am persisting the Process Definition....

            Probably, but you don't specify how you do it. If you use GraphSession::saveProcessDefinition(), jBPM won't increase the version number. You ought to use any of the ProcessArchiveDeployer.deployXXX() methods.

            • 3. Re: token.signal() throwing DelegationException
              sateesh kumar Newbie

              Hi,

              I Used the following Code to Store the Process Definition..

              new DeployProcessDefinitions().deployProcessDefinition(processDefinition);
              
              


              Thanks
              Sateesh

              • 4. Re: token.signal() throwing DelegationException
                sateesh kumar Newbie

                Hi,

                Yes i was using the savePorcessDefinition() of GraphSession..

                DeployProcessDefinitions() is the Custom Class i wrote ..

                Thanks
                Sateesh

                "kls_kumar" wrote:
                Hi,

                I Used the following Code to Store the Process Definition..

                new DeployProcessDefinitions().deployProcessDefinition(processDefinition);
                
                


                Thanks
                Sateesh


                • 5. Re: token.signal() throwing DelegationException
                  Subhasish Choudhury Newbie

                  I am also facing the same error.

                  I have used the following code to to deploy the processdefinition.

                  jbpmSession.getGraphSession().saveProcessDefinition(processDefinition);


                  And using the following code to load the processdefinition.

                  ProcessDefinition processDefinition =
                  jbpmSession.getGraphSession().loadProcessDefinition(processDefId);

                  Following is the code where the error is coming from.

                  ProcessInstance processInstance = new ProcessInstance(processDefinition);
                  Token token = processInstance.getRootToken();
                  processInstance.getContextInstance().createVariable("executionDirection","reply");
                  token.signal();

                  First few lines of the error stack is:

                  [exec] 17:50:03,677 INFO [STDOUT] *****In getJbpmSessionFactory
                  [exec] 17:50:03,677 INFO [STDOUT] *****Returning from getJbpmSessionFactory
                  [exec] 17:50:03,957 INFO [STDOUT] org.jbpm.graph.def.DelegationException
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:299)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:293)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:293)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.taskmgmt.exe.TaskMgmtInstance.invokeAssignmentHandler(TaskMgmtInstance.java:149)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.taskmgmt.exe.TaskInstance.assign(TaskInstance.java:137)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.taskmgmt.exe.TaskMgmtInstance.createTaskInstance(TaskMgmtInstance.java:102)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.graph.node.TaskNode.execute(TaskNode.java:136)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.graph.def.Node.enter(Node.java:284)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.graph.def.Transition.take(Transition.java:92)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.graph.def.Node.leave(Node.java:349)
                  [exec] 17:50:03,957 INFO [STDOUT] at org.jbpm.graph.node.StartState.leave(StartState.java:73)
                  [exec] 17:50:03,967 INFO [STDOUT] at org.jbpm.graph.exe.Token.signal(Token.java:127)
                  [exec] 17:50:03,967 INFO [STDOUT] at org.jbpm.graph.exe.Token.signal(Token.java:92)

                  • 6. Re: token.signal() throwing DelegationException
                    sateesh kumar Newbie

                    Hi,

                    Make sure that the Token hasn't reached the End State..

                    Try to print the State of the Token..

                    Sateesh