Setting up scheduled forecasts

When using a live forecasting system, a scheduled forecast can be established simply through using the Manual Forecast display in the Operator Client.

DELFT-FEWS will, however, not allow a manually submitted forecast to be set as the "current" forecast. Scheduling of Current forecast should be only done by suitably authorised users, and follow a carefully defined scheduling plan. These users must have access to the admin interface tool (see Admin Interface manual).

The procedure for establishing a schedule current forecast is;

Setting up scheduled forecasts (Windows Stand Alone)

Some simpler forecasting systems use a single computer and a Windows Stand Alone client. It is also possible to schedule tasks for these systems. 

  1. Add a folder to your trunk called "WindowsTaskScheduling"
  2. For each task you plan to schedule, you'll need to add a taskProperties file and a batch file to this folder. Examples of each of these files are given below. Test the batch file before commencing with step 3 (simply double clicking it). If the FEWS client is already open, then you should see some logging. If FEWS is not already open, it should open the SA client and log messages should appear, inidicating that the workflow ran.  (This was tested and implemented in 2017.02. In 2017.01.1 it does not create a new task, but instead gives an error message regarding multiple Delft-FEWS instances.)
  3. Once the .bat file is working, schedule the task in Windows Task Scheduler:
    1. Open Windows Task Scheduler (Search for Task Scheduler in the start menu)
    2. Make a new folder under Task Scheduler Library to organize your FEWS tasks
    3. Click "Create Task..." in the right hand panel
    4. Give the task a logical name (e.g. same as Workflow)
    5. Select "Run whether user is logged on or not" (and do not store password)
    6. Under "Triggers," click "New..." and schedule the task (e.g. One time with "Start:" at the correct start time in the computer's time zone. Repeat task every 6 hours for a duration of: Indefinitely) Make sure the trigger is enabled!
    7. Under "Actions," click "New..." and select "Start a program" and browse to/open the correct batch file. Click "OK". Under "Start in (optional):" paste the path to the .bat file. 
    8. No need to change anything in the Conditions or Settings. 
    9. Click OK

Some additional comments:

Example taskProperties file: TaskRun_Import_NOAAGFS.xml. Note: %TIME0%, below, will pass the current FEWS system time to the module instance.

<?xml version="1.0" encoding="UTF-8"?>
<taskProperties xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/taskProperties.xsd" xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<description>ImportNOAAGFSdata_scheduled</description>
	<userId>fews</userId>
	<workflowId>Import_GFS_0.25_Schedule</workflowId>
	<taskSelection>
		<singleTask>
			<time0>%TIME0%</time0>
		</singleTask>
	</taskSelection>
	<forecastPriority>Normal</forecastPriority>
	<makeForcastCurrent>true</makeForcastCurrent>
</taskProperties>

Example batch file (corresponding to taskProperties file above): run_Import_NOAA_GFS.bat

# %1: path to region home
# %2: task properties file

cd c:\FEWS-MOZ_new\
c:\FEWS-MOZ_new\bin\_MOZ_SA_x64.exe "runTask=c:\FEWS-MOZ_new\FEWS-MOZ\WindowsTaskScheduling\TaskRun_Import_NOAAGFS.xml"