How to check (in a Rule) if a Scheduler job is running?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2455
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

How to check (in a Rule) if a Scheduler job is running?

Post by Jaymer »

If I have a rule that says "Don't do this if LIRU.AccessLevel='Janitor' "
How do I also exclude that rule when being run by a timed schedule process.

There is no concept of LIRU in that case, yet I need to add some condition to keep a rule from firing.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: How to check (in a Rule) if a Scheduler job is running?

Post by PointsWell »

This is not an answer but may send you in the direction of one.

When you use PROTECT and READ PROTECT you are able to exclude or include SYSTEM as an option, is there a way to identify that SYSTEM is invoking the rule?
rocketman
Posts: 1252
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Re: How to check (in a Rule) if a Scheduler job is running?

Post by rocketman »

I have several scheduled email reminders that go out overnight and have set up some SystemSettings yes/no attributes that an admin can switch on or off at will

So the scheduled event starts with IF SystemSettings.SomeAttribute= 'Yes' AND [all the date/time parameters hold true] THEN
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
BobK
Posts: 545
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: How to check (in a Rule) if a Scheduler job is running?

Post by BobK »

Jaymer wrote:If I have a rule that says "Don't do this if LIRU.AccessLevel='Janitor' "
How do I also exclude that rule when being run by a timed schedule process.

There is no concept of LIRU in that case, yet I need to add some condition to keep a rule from firing.
There is a LIRU for the system. It might be limited, but you can do the following:
if LoggedInRegularUser.AccessLevel='System'
Bob
Jaymer
Posts: 2455
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: How to check (in a Rule) if a Scheduler job is running?

Post by Jaymer »

BobK wrote:There is a LIRU for the system. It might be limited, but you can do the following:
if LoggedInRegularUser.AccessLevel='System'
BobK - perfect !!!!!
thats exactly what I was needing.

Added that to many rules to keep them from running when not needed. Thanks so much!
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
gernotlg
Posts: 80
Joined: Fri Aug 27, 2021 1:24 am

Re: How to check (in a Rule) if a Scheduler job is running?

Post by gernotlg »

BTW... you should use ...

Code: Select all

LoggedInSystemUser.AccessLevel = 'System'
Because if you have other userBO's (for eg. ClientUser) then LoggedInRegularUser wont work if you have a LoggedInClientUser
V8.8 / Windows / MySQL
BobK
Posts: 545
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Re: How to check (in a Rule) if a Scheduler job is running?

Post by BobK »

gernotlg wrote: Thu Jan 11, 2024 3:35 pm BTW... you should use ...

Code: Select all

LoggedInSystemUser.AccessLevel = 'System'
Because if you have other userBO's (for eg. ClientUser) then LoggedInRegularUser wont work if you have a LoggedInClientUser
You can certainly use LoggedInSystemUser.AccessLevel and that might even be the better option. But, I would guess that a process running from the scheduler would use the default user (RegularUser) instead of some other BO the system admin added to the SystemUser group.
Bob
Post Reply