Hi Team,
I have a requirement where the email needs to be triggered on specific date and time.
For ex. User is raising a request initially. While raising the request he can set the remainder date. This date I am storing in DB. Email needs to be triggered for the remainder dates. What is the best practice to do this?Thanks!!
Discussion posts and replies are publicly visible
Run a process in a short interval which then checks whether to manage any reminders configured.
Timer Event:Create a process model with a start event set to a timer event.Configure the timer to "Delay until the date and time specified by an expression."Use an expression that calculates the reminder date based on the date stored in the database. You can use built-in functions like addDays or addHours to manipulate the date.
Unknown said:Configure the timer to "Delay until the date and time specified by an expression."Use an expression that calculates the reminder date based on the date stored in the database.
I'm not sure this will work for a Start Process timer. As far as I know, the starting time is calculated at publish time (or import time) and not re-calculated dynamically again until re-publishing - the assumption being that the start time will be some static value stored in the "Delay until the date and time specified by this expression:" configuration, then a static interval (if any) for the "recurrence" configuration.
So, the process model should run continiously? Will it cause any memory consumption?
No - he means to kick off a fresh instance every so often (once or twice daily perhaps), query the DB to see whether any notifications fall into that time range, and if so, send them. Then that instance will end. It won't consume any (or much) extra memory, as it'll be short-lived.
What you describe does not work this way. Can you share a working example of this?
You're correct that for Start Process timers, the starting time is typically calculated at publish or import time, based on the static value provided in the configuration. However, if you need dynamic recalculations based on database values, you might need to explore other event types(ex. rule event) after starting a process at some interval.
Got it! I'll whip up a working example over the weekend and get back to you.
Unknown said:However, if you need dynamic recalculations based on database values, you might need to explore other event types
I'm really not following what you're trying to say here. We're talking about Start Process nodes, not other event types. As Stefan also mentioned, what you've described here originally, as far as I can tell, just doesn't work the way you described. If I'm missing something I hope you can clarify.
One of the Best way would be to Use Parent Process as Scheduler and Capture all the Process of that day and Run an MNI orve then .
In Sub Process Also Add an XOR Gateway to Check if the Process had Been Triggered Or Not So in case of Failure Also Non Triggered Instances will Be triggered .