8 Replies Latest reply on Jun 14, 2010 10:56 PM by rebody

    Trigger timer every 1st day of the month

    dbht

      HI all,

       

      How can I trigger a timer at first day every month at 4am?

       

      It seems the timer is configured to trigger Process deploy date + X time in the future but I really need to trigger timer in specific dates and hours regardless when the process has been deployed or the applications server has been started.

       

      Thanks,

       

      Davi

        • 1. Re: Trigger timer every 1st day of the month
          swiderski.maciej

          Hi,

           

          it depends what you want to do when timer expires. In general you could use duedatetime attribute of timer node:

           

          <timer duedatetime='21:49 07/06/2010' />
          

          The default date format is as follows:

          HH:mm dd/MM/yyyy

           

          It has some limitations, for example if you want to set such a timer on transition with repeat enabled it will not work properly. But if you use such timer together with event listeners it works properly because it reuses the timer.

           

          Another thing could be to use cron based expressions but it requires a bit of development, If you would like to have cron expression support please file a jira issue for that. By cron expression here I mean Quartz cron expressions.

           

          HTH

          Maciej

          1 of 1 people found this helpful
          • 2. Re: Trigger timer every 1st day of the month
            dbht

            Hi Maciej,

             

            Thank you for your clarification! Awezome!

             

            Of course cron expressions are so good but there is no hurry for now....

             

            BTW: How can I contribute (with coding) to this project? I'm a very interested in this process engine and I'm thinking of start contributing!

             

            Regards,

             

            Davi.

            • 3. Re: Trigger timer every 1st day of the month
              rebody

              Hi Davi,

               

              Glad to hear that you are interesting in contributing, please sign http://www.jboss.org/contributor first, and Alejandro will reply you later.  As you see, he is the Chief.

               

              And for CRON, I just find there is an org.jbpm.pvm.internal.cal.CronExpression in the trunk.  Not sure how to use it. I think I should do some test for it.  If I got any result, I will reply here.

              • 4. Re: Trigger timer every 1st day of the month
                swiderski.maciej

                HuiSheng Xu wrote:

                 

                And for CRON, I just find there is an org.jbpm.pvm.internal.cal.CronExpression in the trunk.  Not sure how to use it. I think I should do some test for it.  If I got any result, I will reply here.

                Yes, you are right. It is partially implemented. I have tested that yesterday and with quite small adds it can be achieved. I think it was mainly introduced for BPMN support. If you are interested I could provide you with a patch for this later today.

                • 5. Re: Trigger timer every 1st day of the month
                  rebody

                  Hi Maciej,

                   

                  Thank you very much.  Maybe we could add the feature into userguide or developer guide.

                  • 6. Re: Trigger timer every 1st day of the month
                    swiderski.maciej

                    I think we don't have any jira for cron feature for JPDL.

                     

                    Either way I will create a patch for that with some unit tests. If it comes to documentation for that it is definitely a good idea.

                    • 7. Re: Trigger timer every 1st day of the month
                      aguizar
                      I think we don't have any jira for cron feature for JPDL.

                       

                      Either way I will create a patch for that with some unit tests. If it comes to documentation for that it is definitely a good idea.

                      This would make great material for a 4.5 release. Could any of you create the JIRA issue?

                      • 8. Re: Trigger timer every 1st day of the month
                        rebody

                        Hi Alejandro,

                         

                        New issue on JIRA: JBPM-2889.