3 Replies Latest reply on Oct 31, 2010 7:26 AM by mwohlf

    jbpm4.4 timer trigerring problem

    parvathy

      hi i have a jpdl.xml file where i have configured a timer in one transition    

       

       

      <?xml version="1.0" encoding="UTF-8"?>

       

      <process name="TimerBusinessTime" xmlns="http://jbpm.org/4.4/jpdl">

        <start g="19,50,48,48">
          <transition to="first state" />
        </start>


         <state name="first state" g="283,46,83,53" >
          <transition name="to_guardedWait" to="guardedWait" g="-16,-17" />
         </state>

       

        <state name="guardedWait" g="98,46,127,52">
          <transition name="timeout" to="escalation" g="-43,-16">
            <timer duedate="2 minutes" />
          </transition>
        </state>

       

        <state name="next step" g="118,140,88,52" />
        <state name="escalation" g="118,140,88,52" />

      </process>

       

       

       

      and i have impoted <import resource="jbpm.jobexecutor.cfg.xml" /> tis in jbpm.cfg.xml file...

       

      Now in my  test case. i deploy the jpdl.xml file and start it..so it will reach the first state and then i will signal it to the second state where the timer is specified...so it must fire after 5 minutes automatically..

      This is my test case

      String   deploymentId = repositoryService.createDeployment()
              .addResourceFromClasspath("org/jbpm/examples/timer/businesstime/process.jpdl.xml")
              .deploy();

      ProcessInstance processInstance = executionService.startProcessInstanceByKey("TimerBusinessTime");

      String executionId = processInstance.findActiveExecutionIn("first state").getId();

       

      processInstance = executionService.signalExecutionById(executionId);

       

      but its not happening..i dunno if i have gone wrong somewhere...There is an entry in JBPM_JOB table...Should i add any extra line in my test case??

       

      Plz guide me

      Thanks in advance

      Parvathy                           

        • 1. Re: jbpm4.4 timer trigerring problem
          mwohlf

          I think the job executor is not booted automatically if you extend JbpmTestCase for implementing your tests,

          you might want to manually run the jobs:

           

          List<Job> job = managementService.createJobQuery()
                .processInstanceId(processInstance.getId())
                .list();

          managementService.executeJob(job.get(0).getId())

          • 2. Re: jbpm4.4 timer trigerring problem
            parvathy

            But i dont want to do manually..i want the job executor to do the job..if it is not possible in test case..could you tell me a solution to test this...i mean in which environment  can i test if its working automatically..

            • 3. Re: jbpm4.4 timer trigerring problem
              mwohlf

              the JobExecutor has start() stop() and isActive() methods, so it should be possible to get it running in whatever testframework you are using