How to know when ALL the Automation Rules have finished ?

Questions about and code samples for automation process code snippets within Select.
Post Reply
toddsou
Posts: 66
Joined: Wed Jul 25, 2012 9:39 am

How to know when ALL the Automation Rules have finished ?

Post by toddsou »

Hi-

If I have authored and enabled a bunch of Automation Rules, I'd like to programmatically know when the entire set has finished running. As you probably know, they run in random order, so it's not like I can simply add some sort of event notification to the last one and wait to receive that event.

What do you recommend?

I see from the SPAdmin/Automation/Monitoring module that the administrator can monitor when these Automation Rules run, and eventually finish. Is this information also available via SPS SDK? (or, perhaps certain table(s) within the SPS db ?)

Regards,
Todd
BobRichards
Posts: 1229
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: How to know when ALL the Automation Rules have finished ?

Post by BobRichards »

Followup: Do you want to ensure all automation snippets have run for a specific order or all orders?
Bob Richards, Senior Software Developer, SoftPro
toddsou
Posts: 66
Joined: Wed Jul 25, 2012 9:39 am

Re: How to know when ALL the Automation Rules have finished ?

Post by toddsou »

Specific order.

Thanks.
BobRichards
Posts: 1229
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: How to know when ALL the Automation Rules have finished ?

Post by BobRichards »

R&D has provided a solution that uses direct access to the Select SQL database. The script aggregates the automation snippet information and in the final "where" clause you provide the integer value of the order identifier (query RootID in pf.Order).

Code: Select all

SELECT TOP (1000)
	O.Number as 'File Number'
	,AI.ExecutionCorrelation as 'Automation Instance'
	,AI.QueuedOn as 'Automation Queued On'
	, AI.LastRunOn as 'Automation Last Run On'
	, AI.Reason as 'Auotmation Message'
	,[Level]
	,[User]
	,[Message]
	FROM [SelectDb].[pf].[OrderLog] as OL
	Left Join pf.[Order] as O on OL.RootID = O.RootID
	Left Join [SelectDb].core.AutomationInstance as AI on O.Guid = AI.ExecutionCorrelation
	Where OL.RootID = '-2147483639'
2022-08-22_10-59-52.png
2022-08-22_10-59-52.png (148.84 KiB) Viewed 41 times
Bob Richards, Senior Software Developer, SoftPro
Post Reply