1 Reply Latest reply on Feb 18, 2008 5:43 AM by manjula_athani

    jbpm 3.2.2

    manjula_athani

      Hi all,

      I'm using jboss jbpm 3.2.2. using graphical tool created my application in which I want embed an action on a particular event/ transition. when that action class is invoked I get this exception :

      Error signalling token: An exception of type "org.jbpm.graph.def.DelegationException" was thrown.

      -------processdefinition.xml-----------

      <process-definition xmlns="" name="Hello2">


      <start-state name="start">






      </start-state>


      <task-node name="process">








      </task-node>

      <task-node name="show sum">











      </task-node>


      <end-state name="end"></end-state>


      </process-definition>
      --------------------------------------------------------
      MyAction is available in the same package as that of processDefinition.xml

      MyAction.java
      _______________
      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 getnum1 = (String)contextInstance.getVariable("num1");
      String getnum2 = (String) contextInstance.getVariable("num2");


      String sum = getnum1 + getnum2;
      contextInstance.setVariable("sum",sum);

      }

      }
      ________________

      kindly help.
      Manjula

        • 1. Re: jbpm 3.2.2
          manjula_athani

          please note: processdefinition.xml is as follows
          _________________________________
          processdefinition.xml
          _____________________

          <process-definition xmlns="" name="Hello2">


          <start-state name="start">






          </start-state>


          <task-node name="process">









          </task-node>

          <task-node name="show sum">











          </task-node>


          <end-state name="end"></end-state>


          </process-definition>

          Thanks and Regards
          Manjula