ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
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
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
appServerScheduledTask (Variable type)
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 web service).
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Programme la tâche pour s'exécuter toutes les heures
MaTâchePlanifiée is appServerScheduledTask
MaTâchePlanifiée.Name = "MaTache"
MaTâchePlanifiée.Procedure = MaProc
MaTâchePlanifiée.Month = "*"
MaTâchePlanifiée.DayOfMonth = "*"
MaTâchePlanifiée.DayOfWeek = "*"
MaTâchePlanifiée.Hour = "*"
MaTâchePlanifiée.Minute = "0"

IF NOT AppServerAddScheduledTask(MaTâchePlanifiée) THEN
	// Cas d'erreur (par exemple si une tâche de même nom existe déjà)
END
Properties

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 between 0 and 31.
This property can also correspond to:
  • a comma-separated list of numbers: 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 the month.
This property can correspond to:
  • True to run the scheduled task every Monday AND on the first day of the month (cumulative conditions).
  • False to perform the task only 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 comma-separated list of numbers: 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 comma-separated list of numbers: 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 comma-separated list of numbers: 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 between 1 and 12
  • a comma-separated list of numbers: 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 set, the task name will correspond to the full name of the Procedure (for example: MyColletion.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.
Note: When the scheduled task is executed, WEBDEV Application Server will automatically transfer the parameters to the Procedure. The same procedure can therefore be associated with multiple scheduled tasks that will pass different parameters.
PasswordCharacter string or Secret stringUser password.
New in version 2025
Secret strings: If you use the secret string vault, the type of secret string used for this parameter must be "ANSI or Unicode string".
To learn more about secret strings and how to use the vault, see Secret string vault.
ProcedureProcedure nameProcedure that will be run by the scheduled task. This name has the following format:
  • for a procedure in a collection of procedures: <Nom de la collection de procédures>.<Nom de la procédure>.
  • for a Procedure present in a component: <Nom du composant>.<Nom de la collection de procédures>.<Nom de la procédure>.
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 the procedure to be executed.
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 web service).
Remarks

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: 05/16/2025

Send a report | Local help