4 Replies Latest reply on May 10, 2007 7:55 AM by Naseem Khan

    Problem in adding Action  class

    Naseem Khan Newbie


      I am facing problem in executing a custom action class in jbpm 3.1

      Process is something like this...

      Now at state1, I have a action class at the time of node-enter.

      <state name="state1">
       <event type="node-enter">
       <action name="action1" class="com.sample.action.MessageActionHandler">
       <transition name="action is executed" to="end1">

      My MessageActionHandler class...

      package com.sample.action;
      import org.jbpm.graph.def.ActionHandler;
      import org.jbpm.graph.exe.ExecutionContext;
      public class MessageActionHandler implements ActionHandler {
       private static final long serialVersionUID = 1L;
       * The message member gets its value from the configuration in the
       * processdefinition. 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 {
       //context.getContextInstance().setVariable("message", message);
       //System.out.println("Message is>>>>>>>>>>>>> " + message);

      On the server console... I get this message...

      DEBUG [GraphElement] event 'node-enter' on 'State(state1)' for 'Token(/)'
      DEBUG [GraphElement] executing action 'action[action1]'

      But my action class execute method is not executed?

      My Action class is in the process project and I have selected java classes and resources. I deployed process definition on server-deployer /jbpm/upload

      My Action class is not in the jbpm.war. I am not sure where I should put my Action class.

      Please help me in this regard

      Thanks in advance