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

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3945002#3945002

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3945002


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to