Hi Daryl
You could introduce a second sync object. So you would have a SYNC.EOD and a SYNC.TIME.
SYNC.EOD you use with the setting "wait" in case the start action can not be executed.
SYNC.TIME you use with the setting "abort" in case the start action can not be executed.
Using a scheduled SCRI you can open / close the SYNC.TIME to "mark" the valid execution start - period. I tried it and to me it seemed to work. It waits if the SYNC.EOD action can't be executed. If it's executeable, it will try to execute the SYNC.TIME action and act accordingly (start or abort).
Preconditions are often a bit "hidden" to operation teams. The same could apply to my described SYNC solution as well. So another alternative might be to put a specific time-check SCRI task in the workflow that does the check using AE script. You could also name the object to it's clear what it does. It could then cancel the parent workflow execution, if the expected time-constraints are not fulfilled.
------------------------------
☎️ Swisscom Automation Engineer & 🧙 PE Membership Creator
Automic Kurse, Tutorials, Tools und mehr auf:
https://membership.philippelmer.com/Zwei Wochen kostenlos testen!
------------------------------
Original Message:
Sent: Sep 27, 2024 05:08 PM
From: Daryl Brown
Subject: Sync & preconditions
I haven't experimented much with preconditions in my workflows, but I suspect this scenario is something other folks have had to contend with, and might have some good suggestions...
We have an EOD (end of day) workflow that kicks off at 1am, but can run for many hours (especially if problems are encountered along the way).
There's also an intraday workflow that's scheduled for 10am, but we don't want it to run if that EOD workflow is still running.
So right now, we just have a sync object associated with both of these workflows; the EOD workflow will wait if if the sync object is in use, whereas the intraday workflow will skip.
This all works fine, but the business is now pointing out that on days when that intraday workflow get skipped, they invariably want it to run anyway once the EOD workflow completes, so long as it wouldn't mean starting later than 9pm (which could end up causing the next EOD workflow to start late).
So what I'm thinking is to first update the sync object on the intraday workflow and change it to 'wait' instead of 'skip'. Next, I would add a precondition within the intraday workflow that checks to make sure the current time < 21:00, else skip it.
My concern with that approach is what happens if that EOD workflow in question doesn't finish until, say, 00:30 the next morning. If the intraday workflow precondition were to evaluate at 00:30, it would think it was < 21:00, and proceed to let the workflow run, thereby causing delays with our soon-to-run EOD workflow.
So now I'm wondering if I'd need to change the precondition to be a user_defined one that factors in the activation date of the intraday workflow, and not merely the current time.
Has anyone else had to deal with a scenario like this? Am I on the right track?
Thanks in advance!
-- Daryl