8 Replies Latest reply on May 23, 2006 5:44 PM by kukeltje

    Process skipping Node during execution

    brado

      I have a simple process definition that looks like this:

      Start -> NodePingNode -> End

      The NodePingNode contains a custom handler, and I am trying to use a simple JUnit TestCase to trace through the execution of the process. During execution, the only nodes that appear to be executing are the Start and End nodes. The NodePingNode seems to be getting skipped entirely. I have used signal() and signal(TransitionName) methods to try to get a successful transition from Start to the NodePingNode, to no avail. Here is my process definition created using the designer:

      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition
      xmlns="" name="NodePing">
      <start-state name="start">

      </start-state>






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

      Here is my custom handler:

      public class NodePingActionHandler implements ActionHandler {
      String message;
      public void execute(ExecutionContext context) throws Exception {
      //get the engine state
      String status = "READY"; //Engine.getEngine().getStatus();
      context.getContextInstance().setVariable("node_status", status);
      }
      }

      Here is my Test class:

      public class NodePingProcessTest extends TestCase {

      public void testNodePingProcess() throws Exception {
      FileInputStream fis = new FileInputStream("processes/NodePing/processdefinition.xml");
      ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(fis);
      // Create an instance of the process definition.
      ProcessInstance instance = new ProcessInstance(processDefinition);
      System.out.println("Node name = " + instance.getRootToken().getNode().getName());
      System.out.println("Node status = " + instance.getContextInstance().getVariable("node_status"));

      instance.signal("toNodePingNode");
      System.out.println("Node name = " + instance.getRootToken().getNode().getName());
      System.out.println("Node status = " + instance.getContextInstance().getVariable("node_status"));

      instance.signal();
      System.out.println("Node name = " + instance.getRootToken().getNode().getName());
      System.out.println("Node status = " + instance.getContextInstance().getVariable("node_status"));
      }

      }


      Here is the output:

      Node name = start
      Node status = null
      Node name = end
      Node status = null

      I have also breakpointed the handler class, but it never is executed. What is going wrong?

      Thanks...

      Brad