9 Replies Latest reply on Feb 17, 2009 12:09 PM by rodosa

    Timer repetition problem

    rodosa

      Hello, I've a doubt. I would loke to build a timer. So I made a process definition and to try it I use a junit class. With the following code the action of the timer is executing:

      Token token=instance.getRootToken();
      CreateTimerAction createTimerAction = (CreateTimerAction) event.getActions().get(0);
      Action timerAction = createTimerAction.getTimerAction();
      ExecutionContext ex=new ExecutionContext(token);
      timerAction.execute(ex);
      


      I would like that my timer was executed each 10 seconds. But It is only executed once. How could I get timer were executed each 10 seconds??


      Thanks,

        • 1. Re: Timer repetition problem
          rodosa

          Somebody Knows where I can found jbpm timer documentation to understannd better timers????

          I've looking for sth but I didn't found anthing where I could find the solution for my problem.


          Thanks

          • 2. Re: Timer repetition problem
            rodrigorev

            hello, i have defined the timer in the processdefinition.xml instead of junit class.

            are you trying this?

            my timer never executed, i don't know better documentation about timer.

            
            <state name="state1">
             <timer duedate="20 seconds" name="imprimirMensaje">
             <action class="cinfo.proyecto.wf.modelo.handlers.ImprimirMensajeHandler"></action>
             </timer>
             <transition to="task-node1"></transition>
             </state>
            


            • 3. Re: Timer repetition problem
              rodosa

              Yes, I have a process definition where I've defined a simply timer like this:

               <state name="state1">
               <transition to="end-state1"></transition>
               <event type='node-enter' >
               <create-timer name='timeout' duedate='10 seconds' repeat='yes' >
               <script>System.out.println("I reset my timer!");</script>
               </create-timer> </event> <event type='node-leave' >
               <cancel-timer name='timeout' />
               </event>
               </state>
              


              And form a jUNIT I managed this, but It's only executed once. I don't know how it works. Because that the timer would be saved in the BD for its execution, but ... I dont know any documentation where specifies this.

              NOTE: I'm using jbpm 3.2.3



              • 4. Re: Timer repetition problem
                rodrigorev

                I have try this but it can't work.

                anything other solution?

                are you using tomcat?

                • 5. Re: Timer repetition problem
                  rodrigorev

                  rodosa, i have try your code in the jbpm-console and work!.

                  the timer repeat each 10 seconds but in my webapp deployed in tomcat still doesn't work.

                  I`m looking for documentation about the java technology that implements the jbpm's timer.

                  any idea?

                  • 6. Re: Timer repetition problem
                    rodosa

                    rodrigorev, you're right my timer work!! I had a configuration problem qith JBoss jBPM.


                    I don't know a good documentation about jbpm Timers. I've reading jbpm jdpl documentation and the spanish guide of jbpm ;) but .. in my opinion the documentation about timers is not too much.

                    Regards

                    • 7. Re: Timer repetition problem
                      rodosa
                      • 8. Re: Timer repetition problem

                        hi,

                        "rodrigorev" wrote:
                        rodosa, i have try your code in the jbpm-console and work!.

                        the timer repeat each 10 seconds but in my webapp deployed in tomcat still doesn't work.



                        is JobExecutorServlet configured in your webapp?

                        • 9. Re: Timer repetition problem
                          rodosa

                          Have you get to build a timer whose action was an action nor a script? I'm trying this but I doen't get it?

                          Thanks