I changed the title of the post before anyone responded because I think it better describes what what is needed. I also added the 3rd to last paragraph about possibly extending the Time Variable functionality to Dates.
I am thinking about how to best migrate over from ST where I have a number of date related actions being run by WebCore today.
In Rule Machine 4, can I have a rule that dynamically calculates and stores dates, in a variable, and can rule machine be triggered from a date stored in a variable?
For example, I would trigger a rule on the first day of each year that then calculates, for example, the 3rd Sunday of June, and store that date in a global variable. I see that triggers have the concept of triggering on a specific dynamically determined date, such as the 3rd Sunday of June, so this type of logic exists in Rule Machine, but I don't currently see any way to use this logic in an action to store such a dynamically calculated date into a variable, or to trigger form a variable containing a date.
Then I would like to use that stored date variable for any number of purposes.
For example, trigger a rule when the date is reached.
Or for example, calculate a countdown of the days to that stored date. I believe there is the concept of simple variable math, so maybe something like [%stored-date% - Now()] could determine the number of days until the stored date. Can this countdown be calculated in an action, and the result stored in a global variable?
I would then like to, for example, display the countdown on a dashboard.
I would also like to, for example, trigger another rule when the countdown is within X days.
I realize that I could just determine all the X day away trigger dates by hand and manually set individually triggered rules based on these manual calcs. For example if I wanted to do something 7 days prior, I could set a trigger for the 2nd Sunday of June. But then I wouldn't have the automatic countdown, and will have many, many rules that would have to be adjusted each time I changed the desired stored date, instead of just changing the rule that calculates the stored value. This seems all very manual, when the purpose of the platform is to automate things.
It looks like all these capabilities were added for Time variables a few releases ago. Right now I think the only explicit variable Date logic is to set a string variable to the current date with %date%, or to set a variable to Unix Time with Now(), however. I don't think we can do Math on a string variable, and it doesn't look like there is enough Math capability to calculate dates from a stored Unix Time variable, but maybe I just haven't pondered this enough. But the fundamental logic should already be in Rule Machine to use the Date portion of the Unix Time variable as it is likely used int eh Time variables. If the new Time variable functionality were extended to Dates, then I think we would just need to borrow the logic from periodic trigger determinations as one of the action options to set a date. I believe all the elements would then be there to do what I'm searching for, but I'll keep searching and thinking about it.
Is this possible in the way I am asking without extending the Time functionality to Dates, or is there a clever workaround that doesn't require manually calculating and entering all the dates etc?
Thanks in advance for the advice!