Creating a custom schedule for Visual Queries
To create a custom schedule to run the Visual Queries that are saved with alerting enabled, use a UNIX cron expression. The default schedule to run these Visual Queries is once every 24 hours, at 00:00 hours according to the server time.
About this task
You can create a custom schedule in the AlertScheduleExpression property. The AlertScheduleExpression property requires a value in UNIX cron expression format.
With the AlertScheduleExpression property, you can override the default daily schedule. By default, this property is not enabled. If the property is enabled, whenever the value of the expression matches the current date and time, i2 Analyze runs the Visual Queries that are saved with alerting enabled. For more information, see UNIX cron format.
When you enable the AlertScheduleExpression property, its value overrides the value of the default property, AlertScheduleTimeOfDay. For more information about AlertScheduleTimeOfDay, see Changing the daily schedule for Visual Queries.
If you follow this procedure in a deployment that provides high availability, you must complete each step on every Liberty server in your environment before you move to the next step.
Procedure
Using a text editor, open the DiscoServerSettingsCommon.properties file. You can find this file in the following location: toolkit\configuration\fragments\opal-services\WEB-INF\classes.
Uncomment AlertScheduleExpression.
When you uncomment the AlertScheduleExpression property, the value for this property is used instead of the value for the AlertScheduleTimeOfDay property.
Edit the value of AlertScheduleExpression.
For example, the value 0,4,16,20 * * * schedules the Visual Queries that are saved with alerting enabled to run every 4 hours. A short way of expressing this schedule is 0 */4 * * *.
Save and close the file.
Redeploy i2 Analyze to update the application with your changes:
In a command prompt, navigate to the toolkit\scripts directory.
Stop Liberty:
setup -t stopLiberty
Update the i2 Analyze application:
setup -t deployLiberty
Start Liberty:
setup -t startLiberty
After you deploy i2 Analyze, the updated schedule is applied to run Visual Queries that are saved with alerting enabled.