Script Scheduler

Donate to this project

Development Project Status: Under Discussion

Due date for completion of this stage: 
10/12/2017
Release: 
Future
Project funding: 

You can donate money to this project by entering the amount above and clicking the 'Add to cart' button. In the Checkout process you can either choose to pay now (via Bank Transfer, Cheque or Pay Pal) or you can pledge the amount by choosing the 'Pledge a payment for a Development Project' method. If you make a pledge, then when we have 100% funding commitments, you will be notified by email and you can then action your payment. Note that development will not commence until all funds are received.

Project description: 

Background: A number of sites use either the Windows task scheduler, or the linux crontab system to run mysql and other scripts to do various housekeeping jobs (such as updating customer rankings, cleaning out $0 invoices, purging old document loader system messages, etc).

The problem is that since database updates are being done outside the OpenVPMS web application, the data that OpenVPMS holds in its caches (to optimise performance) may now be invalid. The only sure way to fix this is to restart Tomcat after having run the various scripts. However, in a 24/7 operational environment, this is not a good solution.

Note that clearing the caches is not always necessary - for example after running a non-MySQL script, or after running all but the last of the night's MySQL scripts.

Proposed Solution:

This project will enable scripts  to be scheduled to run automatically using the Quartz scheduling support.

This will be configured via the Administration|Organisation workspace, using a "Job Configuration: Script" configuration archetype.

This will use cron-like syntax to specify the day/time when the job should be run.

It will also include fields to specify the script to be executed, an option as to whether or not to clear the caches, and an option as to whether to log a system message on the successful dispatch of the script. Failures to dispatch the script will always be logged. In both cases the logging is via a system message to the Run As user.

Note that the user creating the script to be executed is responsible for generating any required/desired log files recording the outcome of the script. No support will be provided for injecting the contents of such log files into the OpenVPMS system message system.

 

Syndicate content