i got a simple class implementing the actionhandler.

but when i try to execute it i got 

WaitAndSignal cannot be cast to org.jbpm.graph.def.ActionHandler

code is


  | 
  | import org.jbpm.graph.def.ActionHandler;
  | import org.jbpm.graph.exe.ExecutionContext;
  | 
  | 
  | public class WaitAndSignal   implements ActionHandler{
  | 
  |      private final static long serialVersionUID=1l;
  |      
  |      public void execute(ExecutionContext executionContext) throws 
Exception {
  |             // TODO Auto-generated method stub
  |             try { 
  |             System.out.println("Begin WaitAndSignal");
  |             long dauer = System.currentTimeMillis()% 100000;
  |             Thread.sleep(dauer);
  |             executionContext.getProcessInstance().signal();
  |             System.out.println("pid is = " 
+executionContext.getProcessInstance().getId() );
  |             }
  |             catch(Exception e  ) {
  |                     e.printStackTrace();
  |             }
  |             System.out.println("end WaitAndSignal");
  | 
  |     }
  |     
  |     int wait =100;
  | 
  |     public int getWait() {
  |             return wait;
  |     }
  | 
  |     public void setWait(int wait) {
  |             this.wait = wait;
  |     }
  | 
  | }
  | 


the processdefinition is


  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="autokette">
  | 
  | 
  |     <start-state name="start-state1">
  |             <transition to="node1"></transition>
  |             <event type="node-enter">
  |                     <action name="weiter" class="mypackage.WaitAndSignal" 
></action>
  |             </event>
  |     </start-state>
  | 
  | 
  |     <node name="node1">
  |             <transition to="node2"></transition>
  |             <event type="node-enter">
  |                     <action name="weiter" class="mypackage.WaitAndSignal" 
></action>
  |             </event>
  |             
  |     </node>
  | 
  |     <node name="node2">
  |             <transition to="node3"></transition>
  |             <event type="node-enter">
  |                     <action name="weiter" class="mypackage.WaitAndSignal" 
></action>
  |             </event>
  |             
  |     </node>
  | 
  |     <node name="node3">
  |             <transition to="end-state1">                    
  |             </transition>
  |             <event type="node-enter">
  |                     <action name="weiter" class="mypackage.WaitAndSignal" 
></action>
  |             </event>
  |             
  |     </node>
  | 
  | 
  |     <end-state name="end-state1"></end-state>
  | 
  | 
  | </process-definition>
  | 
  | 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170796
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to