Scheduled Process: Check if system email is operating

Contains tips for configurators working with Aware IM
Post Reply
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Scheduled Process: Check if system email is operating

Post by tford »

Thanks to BobK for his post at http://www.awareim.com/forum/viewtopic.php?t=5056 explaining how to perform a process every minute.

I built on that idea to ensure build a process that ensures that my AwareIM server is up and running and email is properly operating.

1- Make SystemSettings BO an intelligent BO & set the email address to send to where you want to be alerted of system being up.

2- Create a process that will create and send email to the SystemSettings BO. (Name: Email_Test_ToSystemSettingsAdmin_Scheduled)

3- Create calculated attribute: SystemSettings.Email_Test_Last_Run_Timestamp

4) Create SystemSettings attributes:

Email_Test_Schedule_Hours: # of hours between emails

Email_Test_Schedule_Flag: Turns the test email system On or Off

5) Create a scheduled event which uses all the above:


If CURRENT_TIMESTAMP>TIME_ADD(SystemSettings.Email_Test_Last_Run_Timestamp,SystemSettings.Email_Test_Schedule_Hours)
AND SystemSettings.Email_Test_Schedule_Flag='Yes'
Then
Email_Test_ToSystemSettingsAdmin_Scheduled
Tom - V8.8 build 3137 - MySql / PostGres
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Re: Scheduled Process: Check if system email is operating

Post by rbross »

Tom,

I know your post was several years ago but I am hoping you can guide me through as I need to create a scheduled event as well. My first question is how and where do you set up a scheduled event?

2nd Like you have shared in the past I have an app that accesses an external SQL DB as well.
What I need to do is setup an event that will update the attribute InventoryValue.TotalInvValue

This value needs to be calculated from one of the external SQL tables. qtyOnHand*MovingAverageCost. about 138k records
I want to use the SUM function for this but it appears you cannot use BO.atribute=SUM qtyOnHand*MovingAverageCost where(inv_loc.loc_id=1.00) AIM does not like this.

I do not want to have to run a query to find all the inv_loc records everytime i need to update the inv value. So I thought a scheduled process running in the background every few minutes would be best.

I can change the InventoryValues BO from non-persistent to persistent and just update the values.

So what would be the best way to handle something like this?

Thanks

Roger
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: Scheduled Process: Check if system email is operating

Post by tford »

My first question is how and where do you set up a scheduled event?
In the Configuration Tool, look for scheduling icon toward the bottom.
Tom - V8.8 build 3137 - MySql / PostGres
rbross
Posts: 441
Joined: Wed Nov 19, 2014 4:13 am
Location: Coventry, Connecticut USA

Re: Scheduled Process: Check if system email is operating

Post by rbross »

1. Why does the Scheduling Tab go away after you save the new scheduled event?
What if you need to change the scheduling details of the event?

2. How does the scheduled event get started? Will it start automatically once you go in to test mode and run the app?
Also your example shows how to run an event ever minutes with 1/60
What if you needed the event to run every 5 minutes?
It looks like the TIME_ADD function only lets you add hours what if you want to add minutes can you do something like this: TIME_ADD(LastRunTime,0,2/60)

Roger
Roger Ross
AwareIM 8.7 (build 3025) ~ MS-SQL ~ Windows 10 ~
AwareIM 8.5 (build 2828) ~ MS-SQL ~ Windows 10 ~
Post Reply