Customizing the email scheduler
The Email Scheduling Wizard that displays when the Schedule link is clicked in the Email activity is implemented as an interview script named CreateSchedule.mdd. The script is in this folder:
[INSTALL_FOLDER]\IBM\SPSS\DataCollection\<version>\Interviewer Server\ FMRoot\Shared\Config
The default CreateSchedule.mdd script creates a single schedule that provides options for specifying the email schedule start and end time, the interval between batches, and the size of each batch. The script can be modified to create an email scheduler that meets specific business requirements.
A custom email scheduler script might include the following steps:
▪Read existing schedules.
▪Display existing schedules, if they exist, and allow users to add new schedules.
▪Write or update schedules.
Changing the email scheduler requires an understanding of the
SQL scheduling tables, and basic knowledge of interview scripting and templates.
Two email schedule examples are provided. They use different methods for updating the SQL tables.
▪CreateSchedule.mdd: The default script that is delivered with UNICOM Intelligence Interviewer.
▪CreateSchedule_MultiCountry.mdd: The script is in the UNICOM Intelligence Developer Documentation Library.
CreateSchedule.mdd example
The default CreateSchedule.mdd script can create, modify, or delete a single schedule.
The ScheduleLayout.htm layout template organizes the items on the page and contains JavaScript and CSS that sets up the calendar and time controls. The template also sets up the Delete and Save controls.
The CreateSchedule.mdd script contains a page that can be used to define the project, job, and connection string (for debugging purposes). These items are normally passed into the interview as IOM.Properties.
The script uses the ReadScheduleData function and the SchedGetScheduleTask stored procedure to retrieve an existing schedule (if it exists). The stored procedure relies on the fact that there is only one schedule per project and email job for this version of the scheduler.
The SaveScheduleData function uses the EmailUpdateScheduleTask stored procedure to insert a single schedule.
CreateSchedule_MultiCountry.mdd example
The CreateSchedule_MultiCountry.mdd script is in the UNICOM Intelligence Developer Documentation Library in:
[INSTALL_FOLDER]\IBM\SPSS\DataCollection\<version>\DDL\Scripts\
Interview\Sample Management - Scripts\Interview\Utilities\CreateSchedule
The scheduler provides options for defining a separate email schedule for each country and language pair.
The ScheduleLayout.htm is based on the default ScheduleLayout.htm, but also supports multiple schedules in a grid.
The ReadScheduleData function demonstrates how to use a SQL statement to retrieve the schedules (instead of a stored procedure).
The SaveScheduleData function uses the InsertScheduleRow,InsertSendEmailTaskRow and InsertScheduleTaskRow functions to insert SQL data into the three scheduling tables. The functions can be used in custom scripts to create more complex schedules.
See also