Create a script batch job
You can create a batch job for running a script on a regular schedule that you define.
To create a script batch job
-
From the Administration menu, select System tools > Batch engine.
-
Select New.
-
Complete the following fields:
Field Action Name Enter an intuitive name for the batch job. Description Enter a brief description of the batch job. Email Enter the email address where you want Civic Platform to send emails after job completion, regardless if the job is successful or not.
You can configure the email template named NOTICE_OF_BATCH_JOB_COMPLETED to customize the notification. For information about how to edit an email notification template, see Communication manager.
Job type Select Script from this menu. Script code From the list, select the script that you want to associate with the batch job.
For information on creating a script, see Events and scripts overview.
-
Select Submit.
-
Specify the job schedule to run the batch job as follows:
-
Select the Job schedule tab.
-
Complete the following fields:
Field name Action Start time Determine the time of day at which the batch job begins running by selecting hour, minute, and am/pm from menus.
Note: If you set a batch job Schedule status to Active but do not specify a Start Time, an error message displays when you try to save the batch job.Schedule status Use this menu to turn a batch job on and off. Select Active to activate the batch job. Select On hold to deactivate the batch job and save its information. Start date Enter the date on which the batch job starts or select a date by selecting the data picker beside the field.
Note: If you set a batch job Schedule status to Active but do not specify a Start date, an error message displays when you try to save the batch job.Time out (seconds) Enter the number of seconds a batch job attempts to run before timing out. End date This field is active only if you select a value other than Once in the Frequency field. Enter the date on which the batch job stops running or select a date by selecting the data picker
beside the field.Frequency Select the frequency with which the batch job runs from this menu. The options are Once, Daily, Weekly, Monthly, or Yearly. PM generate (Required) This field enables you to specify how far in advance the batch job generates work orders.
Note: This field only displays if you selected PM schedule as the Service category during the creation of the batch job.Enter a number in the first field, then select Days, Weeks, Months, or Years from the menu in the second field.
Example: To generate work orders two weeks in advance of the PM Schedule batch job, enter 2 in the numeric field and select Weeks from the menu. Or, enter 15 in the numeric field and select Days from the menu. -
Select Save.
-
-
Specify the default values of the parameters required to run the script as follows:
-
Select the Parameters tab.
-
Select New.
-
Complete the following fields:
Field Action Parameter name (Required) Enter the name of the parameter. Data type (Required) Enter the data type of the parameter.
Note: The data type must correspond to the data type defined for the parameter in the script.Required flag (Required) Select the required flag as Yes. Default value Assign a value to the parameter for the script to run. Status (Required) Use this menu to select if the parameter record is Active or Inactive for the script. Description Enter a description for the parameter. Display order Not applicable. -
Select Submit.
-