3 Replies Latest reply on Mar 22, 2006 3:00 PM by Ronald van Kuijk

    Doubt regarding the Timer Task?

    Maran Rajan Newbie

      Hi

      Timer task executes based on business calendar properties file. Could you please tell me overridding the existing business calendar properties file is possible in jBPM and if so where I need to place the overridden business calendar properties file. Can I place business calendar properties file in the src/config.files location?

      <start-state name="start">
      <transition name="test_transition" to="init">
      <action name="SimpleTransitionTest" class="com.sample.TestTransition"></action>
      </transition>
      </start-state>
      
      <state name="init">
      <transition name="to_end" to="end"></transition>
      <timer duedate="1 business hours" name="TimerTest" repeat="2 minutes">
      <action name="MyTimerTask" class="com.sample.TestBean"/>
      </timer>
      
      </state>
      
      <end-state name="end">
      <event type="node-enter">
      <cancel-timer name="TimerTest"/>
      </event>
      </end-state>


      I implemented the Timer task. When I execute my code, the action class (com.sample.TestBean) associated with the timer never get executed? Could you please tell me what I am doing wrong?

      ProcessDefinition definition = ProcessDefinition.parseXmlResource("testtimer.par/processdefinition.xml");
      
      ProcessInstance instance = new ProcessInstance(definition);
      
      System.out.println("instance in start state = " + instance.getRootToken().getNode().getName()); // It prints "start"
      
      instance.signal();
      
      System.out.println("instance in initialize state = " + instance.getRootToken().getNode().getName()); // It prints "init"
      
      instance.signal();
      
      System.out.println("instance in end state = " + instance.getRootToken().getNode().getName()); // It prints "end"