0 Replies Latest reply on Nov 17, 2006 7:21 AM by Prashanth Sukumaran

    JBPM Timer Action

    Prashanth Sukumaran Newbie

      Hi,

      I have written a JBPM Timer Action Handler.

      STEPS:
      1) Enable the JBPM Scheduler Servlet in web.xml
      2) In the process definition define the timer tag.

       <task-node name="First Task Task Task[9-1.1]">
       <task name="First Task Task Task[9-1.1]" duedate="1 business days">
       <assignment actor-id="jeromepater"/>
       <timer duedate="6 business hours">
       <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" name="tasktimer" config-type="bean">
       <targetBean>updateEscalationForActor</targetBean>
       <factoryKey>jbpmConfiguration</factoryKey>
       </action>
       </timer>
       </task>
       <event type="task-start">
       <action class="org.springmodules.workflow.jbpm31.JbpmHandlerProxy" name="taskstart" config-type="bean">
       <targetBean>taskStartEvent</targetBean>
       <factoryKey>jbpmConfiguration</factoryKey>
       </action>
       </event>
       <transition to="1-join"/>
       </task-node>
      


      3) In the ActionClass i am calling
       Timer timer = executionContext.getTimer();
       Date date = timer.getDueDate();
      


      Here i am getting a null pointer exception for timer. The timer object is not available to me. I looked at the classes in org.jbpm.scheduler.impl.*, but don't know where it fails. In Timer.execute see a call for action.execute(executionContext); Before that
       // first fire the event if there is a graph element specified
       if (graphElement!=null) {
       graphElement.fireAndPropagateEvent(Event.EVENTTYPE_TIMER, executionContext);
       }
      


      Is the timer Object for sure set in the Execution context when the fireAndPropogateEvent is called. Is there anything i am missing here.

      Please help.
      Thanks
      Prash