Re: How to know when ALL the Automation Rules have finished ?
Posted: Wed Oct 26, 2022 1:39 pm
Perfect, thank you.
As mentioned earlier, we can query and identify those AutomationInstance records where their QueuedOn field has been set, thereby indicating they've been placed on the queue for later execution of the "THEN" part of the Process. Now we're questioning the timing of our query. That is, who's to say if there are more records yet to be queued for the targeted Order by the time our query executes? (race condition)
One thought was to re-query until we see one of the records' Status field goes to a value other than 1 (Created) or 4 (Waiting/Idle). This is based on my blind assumption that the execution of any Process's THEN part would not begin until ALL Process' criteria (aka "IF" part) have been evaluated. But maybe that assumption is incorrect? Please confirm.
Alternative guidance appreciated, too.
Regards-
As mentioned earlier, we can query and identify those AutomationInstance records where their QueuedOn field has been set, thereby indicating they've been placed on the queue for later execution of the "THEN" part of the Process. Now we're questioning the timing of our query. That is, who's to say if there are more records yet to be queued for the targeted Order by the time our query executes? (race condition)
One thought was to re-query until we see one of the records' Status field goes to a value other than 1 (Created) or 4 (Waiting/Idle). This is based on my blind assumption that the execution of any Process's THEN part would not begin until ALL Process' criteria (aka "IF" part) have been evaluated. But maybe that assumption is incorrect? Please confirm.
Alternative guidance appreciated, too.
Regards-