Hi,
I would start timer on every Tuesday, I saw same another topic for a monthly start and there was the answer PT1M
So will it be work something like PT2D ?
Thank you!
Hi,
I would start timer on every Tuesday, I saw same another topic for a monthly start and there was the answer PT1M
So will it be work something like PT2D ?
Thank you!
I would suggest a feel expression where you calculate the duration to the next tuesday.
Greets
Chris
Any hints on what that looks like?
Currently can’t give more input sorry. I’m not on my pc to try it out.
I can try in the evening.
Correct. Use R/P7D
to schedule the timer every week.
The interesting questing is how to configure the start time to run on Tuesdays.
We have an open issue that addresses the problem: Feature Request: On Timer events add scheduling at specific time · Issue #3038 · camunda/zeebe · GitHub
Nice idea
I crafted a FEEL expression to calculate the duration until the next Tuesday at 08:00:00.
(for x in 1..7 return date and time(today(),time("08:00:00Z")) + duration("P"+string(x)+"D"))[day of week(item) = "Tuesday"][1] - now()
You could use the expression for a timer in the workflow and then loop back to the timer to wait until the next Tuesday. Or, use it in front of the cycle timer that runs every 7 days.
In more detail:
for x in 1..7 return date and time(today(),time("08:00:00Z")) + duration("P"+string(x)+"D")
// List(2020-12-19T08:00Z, 2020-12-20T08:00Z, 2020-12-21T08:00Z, 2020-12-22T08:00Z, 2020-12-23T08:00Z, 2020-12-24T08:00Z, 2020-12-25T08:00Z)
(for x in 1..7 return date and time(today(),time("08:00:00Z")) + duration("P"+string(x)+"D"))[day of week(item) = "Tuesday"]
// List(2020-12-22T08:00Z)
(for x in 1..7 return date and time(today(),time("08:00:00Z")) + duration("P"+string(x)+"D"))[day of week(item) = "Tuesday"][1]
// 2020-12-22T08:00Z
(for x in 1..7 return date and time(today(),time("08:00:00Z")) + duration("P"+string(x)+"D"))[day of week(item) = "Tuesday"][1] - now()
// PT81H55M39.422615S
Does this help you?
Hi, Thanks for your answers!
Could you recommend me some environment to test and debug the similar expressions? Maybe some online editor?
Thanks!
The easiest way to test FEEL expressions is the FEEL REPL. See here: https://github.com/camunda/feel-scala#feel-repl