Wrong Timer Execution

1
0
-1

Good morning ,

Let me make the issue clear , well I have a timer that should be executed from 28th to 2nd working day of each month (without considering weekends).

I made a certain logic to calculate business days and then used this CRON expression that I have built .

00 00 12 28,29,30,31,3,4 * ? * (3,4 are the business days of May ).

Logically, on the 1st and 2nd day of the month ( which are Saturday and Sunday) , the timer shouldn't be executed , but I got totally the opposite, I don't know what's going on in the background .

Can any one Help me with that

Regards,

1 answer

1
0
-1

Hello,

According to https://www.freeformatter.com/cron-expression-generator-quartz.html, your cron expression reads: "At 12:00:00pm, on the 28th, 29th, 30th, 31st, 3rd and 4th day, every month", which seems to correspond to your description.

That being said, can you check in your process that there is no negate operator somewhere that could explain the opposite values you observe!? For instance, the timer triggers and take the wrong branch in your process because of the boolean value of the transition on your branch...

Regards,
Emmanuel

Comments

Submitted by FatmaGh on Fri, 05/07/2021 - 14:45

Well I didn't understand the second part of your answer concerning the branch issue , but I don't know what's wrong with the execution on the 1st and 2nd day ( which are not included in the CRON expression) .

Other thing I wanna ask about , is there a way to make the process always watching the change of the day once it's deployed and execute the timer ? (because when I used that cron espression I ve already given above , it's executed on the wrong days).

And I wanna make a clarification about using a cycle and a fixed date , what's the difference between both of em ?

Regards,

Submitted by emmanuel.duchas... on Mon, 05/31/2021 - 16:48

To execute something every time the day changes, just set up a CRON expression that executes all days:

Something like 00 00 00 * * ? * should do the trick, no?

A cycle will executes several times, with a certain periodicity, a "fixed date" will execute only once, at a pre-determined date, which is often irrealistic, as it is generally difficult to schedule at design-time something that will trigger in production once and never again.

Submitted by FatmaGh on Thu, 06/03/2021 - 10:53

In Fact , i've used this cron expression for my timer 00 00 12 1,2,28,29,30,31 * ? * -> I want my process to be enabled from 28th of the month to the 2nd working day of the next month , but I've realised that this process has launched on production environment from 28th to 31th of May but it doesn't on the 1st and 2nd day of juin , I don't know what went wrong exactly ?

Actually,I thought about two things : Maybe I should have used this cron exp instead : 00 00 12 28,29,30,31,1,2 * ? *

Or this one maybe 00 00 12 28,29,30,31,01,02 * ? *

Do you have any idea about the issue ?

Regards,

Submitted by emmanuel.duchas... on Fri, 06/04/2021 - 09:49

Bonita rely on Quartz Scheduler to handle cron trigger.

Have a look at Quartz doc on Cron triggers: http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/cro...

and http://www.quartz-scheduler.org/documentation/quartz-2.3.0/tutorials/tut...

to make sure your pattern is supported.

Notifications