ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Web-specific functions / WEBDEV scheduled task functions
  • Properties specific to appServerScheduledTask variables
  • List of functions that use the appServerScheduledTask type
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
appServerScheduledTask (Type of variable)
In french: serveurAppliTachePlanifiée
The appServerScheduledTask type is used to manage a scheduled task of WEBDEV Application Server through programming (for a site or a webservice).
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Programs the task so that it is run every hour
MyScheduledTask is appServerScheduledTask
MyScheduledTask.Name = "MyTask"
MyScheduledTask.Procédure = MyProc
MyScheduledTask.Month = "*"
MyScheduledTask.DayOfMonth = "*"
MyScheduledTask.DayOfWeek = "*"
MyScheduledTask.Hour = "*"
MyScheduledTask.Minute = "0"
 
IF NOT AppServerAddScheduledTask(MyScheduledTask) THEN
// Error case (if a task with the same name already exists for example)
END
Remarks

Properties specific to appServerScheduledTask variables

The following properties can be used to handle a scheduled task:
Property nameType usedEffect
DayOfMonthCharacter stringNumber of the day for which the scheduled task must be run ("31" for example). This number is included between 0 and 31.
This property can also correspond to:
  • a list of numbers separated by commas: used to specify several months.
  • an interval. For example, "9-13" (the task is scheduled from the 9th to the 13th of the month).
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task on every odd day of the month.
DayOfMonthOrDayOfWeekBooleanManaged the execution of a scheduled task by specifying the day number of the week or day number of the month.
Example: execution every Monday 1st day of month.
This property can correspond to:
  • True to run the scheduled task every Monday AND the first day of the month (cumulated conditions).
  • False to run the task on Monday 1st (exclusive conditions).
DayOfWeekCharacter stringNumber of the day for which the scheduled task must be run ("2" for example). This number is included between 1 and 7 (1 = Monday, 2 = Tuesday, ...).
This property can also correspond to:
  • a list of numbers separated by commas: used to specify several days.
  • an interval. For example, "1-3" (the task is scheduled for Monday, Tuesday and Wednesday).
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task on every even day of the week.
  • the day of the week in letters ("monday", "tuesday", "wednesday", "thursday", "friday").
EnabledBooleanIndicates whether the task is enabled or not:
  • True if the task scheduling is enabled.
  • False otherwise.
HourCharacter stringExecution time of scheduled task. If TimeUTC is set to True, this time will be in UTC.
The possible values are:
  • a digit included between 0 and 23.
  • a list of numbers separated by commas: used to specify several hours.
  • an interval. For example, "9-13".
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task at every even hour.
InProgressBooleanIndicates whether the task is currently run:
  • True if the task is currently run.
  • False otherwise.
This property is read-only.
This property is updated by AppServerInfoScheduledTask and AppServerListScheduledTask only. The value read reflects the status during the call to these functions (and not the status when reading the property).
MinuteCharacter stringMinutes of the execution time of the scheduled task. If TimeUTC is set to True, this time will be in UTC.
The possible values are:
  • a digit included between 0 and 59.
  • a list of numbers separated by commas: used to specify several minutes.
  • an interval. For example, "9-13".
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task at every even minute.
MonthCharacter stringNumber of the execution month of scheduled task ("11" for example).
The possible values are:
  • a digit included between 1 and 12
  • a list of numbers separated by commas: used to specify several months.
  • an interval. For example, "9-11".
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task on every odd month.
NameCharacter stringTask name.
This name is used to differentiate the tasks associated with the same procedure.
If this property is not filled, the name of the task will correspond to the full name of the procedure (for example: MySet.ProcedureName).
ParameterArrayParameters that will be transmitted to the scheduled task during its execution.
Each one of the parameters should be transformed by Serialize (binary serialization is used). The WEBDEV Application Server needs to keep the parameters to pass them at each call. To do so, the value of each parameter will be serialized.
Remark: When the scheduled task is run, the WEBDEV Application Server will automatically pass the parameters to the procedure. The same procedure can therefore be associated with multiple scheduled tasks that will pass different parameters.
PasswordCharacter stringUser password.
ProcedureProcedure nameProcedure that will be run by the scheduled task. This name has the following format:
  • for a procedure found in a set of procedures: <Name of set of procedures>.<Procedure name>.
  • for a procedure found in a component: <Component name>.<Name of set of procedures>.<Procedure name>.
This property does not accept:
  • The local procedures. A local procedure only exists in the context of the call to its parent procedure. This context will not exist anymore during the call to the scheduled task.
  • A Procedure variable (except if this one identifies a procedure belonging to a set of procedures).
ProcedureNameCharacter stringName of procedure to execute.
This property is read-only and it is used to retrieve the name of the procedure associated with the task (to display it in a specific screen for example).
TimeUTCBoolean
  • True (default value) if the time is in UTC (Hour and Minute properties).
  • False otherwise.
UserCharacter stringIndicates the user of the operating system who will run the task. If this value is not filled, the user that will be used is the default user of the application (site or webservice).

List of functions that use the appServerScheduledTask type

AppServerAddScheduledTaskAdds a new scheduled task to the application (site or webservice).
AppServerDeleteScheduledTaskDeletes a scheduled task associated with the application (site or Webservice).
AppServerInfoScheduledTaskReads the description of a scheduled task.
AppServerModifyScheduledTaskModifies an existing scheduled task.
AppServerRunScheduledTaskImmediately starts the execution of a scheduled task on a WEBDEV Application Server.
Minimum version required
  • Version 22
Comments
Click [Add] to post a comment

Last update: 01/26/2023

Send a report | Local help