2 Replies Latest reply on Feb 20, 2008 7:14 AM by manjula_athani

    "org.jbpm.graph.def.DelegationException"

    manjula_athani

      Hi All,


      I'm invoking an ActionHandler on some event (node-enter), but it is giving
      this exception : "org.jbpm.graph.def.DelegationException".
      Here I'm giving code for action handler class and processdefinition.xml

      MyAction.java
      __________

      package Hello4;
      
      import org.jbpm.context.exe.ContextInstance;
      import org.jbpm.graph.def.ActionHandler;
      import org.jbpm.graph.def.ProcessDefinition;
      import org.jbpm.graph.exe.ExecutionContext;
      import org.jbpm.graph.exe.ProcessInstance;
      
      
      public class MyAction implements ActionHandler {
       private static final long serialVersionUID = 1L;
      
       public void execute(ExecutionContext executionContext) throws Exception {
       // TODO Auto-generated method stub
       ProcessDefinition processDefinition = ProcessDefinition.parseXmlString("processdefinition.xml");
      
       ProcessInstance processInstance = new ProcessInstance(processDefinition);
      
       ContextInstance contextInstance = processInstance.getContextInstance();
      
      
       String sum="test";
      
       contextInstance.setVariable("sum",sum);
      
       }
      
      }
      


      __________
      processdefinition.xml
      ________________
      <process-definition xmlns="" name="Hello4">
      
       <start-state name="start">
       <event type='node-leave'>
       <action class='MyAction' />
       </event>
       </start-state>
      
      <end-state name="end1">
       </end-state>
      
      </process-definition>
      


      ___________

      Thanks & Regards
      Manjula

        • 1. Re:
          sgrassie

          Make sure you are setting the handler correctly in your process definition. Also I'd give the action a name. If you go onto the events tab in the graphical designer and go onto the details tab, you can search for the class to use as the handler.


          <action name='myActionName' class='Hello4.MyAction' />


          • 2. Re:
            manjula_athani

            Hi,

            I modified the <action ...> as per ur suggestion, now the delegation exception is not there. However I'm getting another exception
            "UnsupportedVersionException".

            What I know is , when u compile a file on higher version of jdk and run it on lower version jre, this exception is thrown.

            Here i'm using jbpm-suite-3.2.2 and eclipse3.3, how do i resolve this problem.

            I checked on my cmd prompt for

            >javac -version
            >jdk1.5.7
            >java -version
            >jre1.6


            Thanx & Regards
            Manjula