2 Replies Latest reply on Apr 2, 2009 1:38 PM by kukeltje

    jBPM timer and scheduler

    frinux

      Hi,
      I'm posting here because I can't find lot's of information about how to set up timers in jBPM.

      I've added a timer to my task :

      <timer name="waitForApproval"
       duedate="1 minute"
       transition="validee" >
       <script>
       System.out.println("Le valideur est trop lent : validée !!!");
       </script>
       </timer>


      It seems timers need what you call a scheduler service. After some researches, I find out that I must add this to my web.xml :
       <servlet>
       <servlet-name>JbpmThreadsServlet</servlet-name>
       <servlet-class>org.jbpm.web.JbpmThreadsServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
       <servlet-name>JbpmThreadsServlet</servlet-name>
       <url-pattern>/threads</url-pattern>
       </servlet-mapping>
      


      I did that, but I find an exception :
      java.lang.ClassNotFoundException: org.jbpm.web.JbpmThreadsServlet

      And surprise! There is no such class in my jbpm jar file. I took the last one from jbpm-installer-3.2.6.SP1.jar : jbpm-jpdl.jar

      On JarSearch, I found that the class is present only in version jbpm-3.1.4.jar and before.

      So what am I doing wrong, or what did I miss?

      Thanks

        • 1. Re: jBPM timer and scheduler
          frinux

          Ok maybe I've been too quick. I found on this forum that the class changed. Here is the code to add in the web.xml :

          <!-- This servlet serves the purpose of executing pending timer jobs. -->
           <!-- JbpmJobExecutorServlet BEGIN -->
           <servlet>
           <servlet-name>JobExecutorServlet</servlet-name>
           <servlet-class>org.jbpm.job.executor.JobExecutorServlet</servlet-class>
           <load-on-startup>1</load-on-startup>
           </servlet>
           <servlet-mapping>
           <servlet-name>JobExecutorServlet</servlet-name>
           <url-pattern>/jobs</url-pattern>
           </servlet-mapping>
           <!-- JbpmJobExecutorServlet END -->


          • 2. Re: jBPM timer and scheduler
            kukeltje

            :-)