2 Replies Latest reply on Jul 7, 2008 11:02 AM by Ashish Chawla

    unable to execute a simple workflow

    Ashish Chawla Newbie

      Hi All,
      I am newbie to jBPM/JBoss and I created a simple workflow, but when i transition from the task-node to node to invoke an action class, i am getting an error

      error: [Delegation], could not instantiate delegation class, "com.sample.action.MessageActionHandler".

      Can anyone please provide your expert comments?

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="http-demo-process">
      
       <swimlane name="initiator">
       <assignment actor-id="manager" />
       </swimlane>
       <start-state name="start-state1">
       <task swimlane="initiator" />
       <transition to="task-node1"></transition>
       </start-state>
      
       <node name="node1">
       <action class="com.sample.action.MessageActionHandler">
       <message>Sending Message</message>
       </action>
       <transition to="join1"></transition>
       </node>
      
       <task-node name="task-node1">
       <task swimlane="initiator" />
       <transition to="node1"></transition>
       </task-node>
      
       <join name="join1">
       <transition to="end-state1"></transition>
       </join>
      
       <end-state name="end-state1"></end-state>
      
      </process-definition>



      and here is the message action handler class

      package com.sample.action;
      
      import org.jbpm.graph.def.ActionHandler;
      import org.jbpm.graph.exe.ExecutionContext;
      import org.apache.commons.logging.Log;
      import org.apache.commons.logging.LogFactory;
      
      
      public class MessageActionHandler implements ActionHandler {
      
       Log log = LogFactory.getLog(this.getClass());
       private static final long serialVersionUID = 1L;
      
       /**
       * The message member gets its value from the configuration in the
       * process definition. The value is injected directly by the engine.
       */
       String message;
      
       /**
       * A message process variable is assigned the value of the message
       * member. The process variable is created if it doesn't exist yet.
       */
       public void execute(ExecutionContext context) throws Exception {
       log.info("Inside execute: ");
       context.getContextInstance().setVariable("message", message);
       log.info("Printing message received: " + message);
      
       }
      
      }



      Please advise as this is very confusing to me