PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • Delayed tasks
  • Overview
  • Implementation via the code editor
  • Scheduled tasks
  • Overview
  • Implementation via the code editor
  • Implementation through programming
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
Overview
WEBDEV allows you to implement tasks on the server directly: each task is a server WLanguage procedure.
The delayed tasks are used to postpone time-consuming processes on the WEBDEV application server. For example, sending an email or calculating statistics.
The scheduled tasks are used to run a given operation on a regular basis. For example, sending a mailshot about the current promotions.
Remarks:
  • The scheduled tasks and the delayed tasks correspond to Server procedures.
  • Implementing these features requires a WEBDEV application server version 180046 or later.
  • The number of scheduled tasks associated with a site or with a Webservice can be viewed in the WEBDEV administrator (local or remote administrator).
  • You have the ability to manage the scheduled tasks from the WEBDEV administrator (local or remote administrator).
  • The scheduled tasks can be defined through programming.
Delayed tasks

Overview

Example of delayed task: A confirmation email is sent to the Web user when he validates his booking. The actual sending of the email is postponed on the server. The Web user is not locked during the sending.

Implementation via the code editor

To implement a delayed task in a WEBDEV site:
  1. In the code editor, display the server procedure whose execution must be postponed.
  2. Click in the bar of code editor.

    Remark: You also have the ability to perform one of the following operations:
    • Select "Configure the automations of the procedure" from the popup menu of procedure ("Project explorer" pane).
    • Select "Properties" from the popup menu of procedure in the "Code" pane.
    Caution:
    • The multi-syntax procedures cannot be postponed.
    • No syntax can be added to a delayed procedure.
  3. In the window for configuring the procedure automation, select "WEBDEV tasks" then "Delayed task" and configure the different parameters of the delayed task:
    • Using (or not) the current HFSQL context.
    • Maximum runtime duration.
  4. Validate.
  5. To start the execution of the delayed procedure in your project:
    • use ExecuteDelayedProcedure.
    • enter the name of the function directly: a specific icon appears beside the function name:
    Remark: InDelayedProcedureMode is used to find out whether the current procedure is run in delayed mode.
  6. During the next deployment of the site, the delayed task will be be run on the server.
Remark: You have the ability to limit the runtime duration of the scheduled or delayed tasks:
  • at server level: in the WEBDEV administrator, in the "Configuration" tab, specify the maximum duration of a task. If the tasks used exceed this duration, they will be automatically stopped.
  • in the site or Webservice: in the WEBDEV administrator, in the "Sites" or "Webservices" tab, select the desired site or Webservice and click "Parameters" to specify the maximum duration of the task. In this case, the maximum duration of the task (of a site or Webservice) cannot exceed the one set on the server.
Scheduled tasks

Overview

Example of scheduled task: Every day of the week, at 3:00 AM, a reminder email is sent to the customers who did not confirm their booking.

Implementation via the code editor

To implement a scheduled task in a WEBDEV site:
  1. In the code editor, display the server procedure that must be scheduled.
  2. Click in the bar of code editor.

    Remark: You also have the ability to perform one of the following operations:
    • Select "Configure the automations of the procedure" from the popup menu of procedure ("Project explorer" pane).
    • Select "Properties" from the popup menu of procedure in the "Code" pane.
  3. Caution:
    • The multi-syntax procedures cannot be scheduled.
    • No syntax can be added to a scheduled procedure.
  4. In the window for configuring the procedure automation, select "WEBDEV tasks" then "Scheduled task" and configure the different scheduling parameters:
    • Runtime month.
    • Runtime day.
    • Execution time.
    • Maximum runtime duration.
  5. Validate.
  6. During the next site deployment, the scheduled task will be run on the server according to the specified parameters.
Remark: You have the ability to limit the runtime duration of the scheduled or delayed tasks: in the WEBDEV administrator, in the "Configuration" tab, specify the maximum duration of a task. If the tasks used exceed this duration, they will be automatically stopped.
This duration can also be configured for the tasks of a specific site ("Sites" tab, "Parameters" button) or for the tasks of a specific Webservice ("Webservices" tab, "Parameters" button). In this case the maximum duration of a task cannot exceed the maximum duration set on the server.

Implementation through programming

WEBDEV allows you to programmatically define scheduled tasks using functions of type AppServerxxx.
The implementation is child's play. You must:
  1. Define the characteristics of the scheduled task via an AppServerScheduledTask variable.
  2. Add the scheduled task with AppServerAddScheduledTask.
  3. Then, several functions can be used to handle the scheduled tasks:
    AppServerRunScheduledTaskImmediately starts the execution of a scheduled task on a WEBDEV Application Server.
    AppServerInfoScheduledTaskReads the description of a scheduled task.
    AppServerListScheduledTaskReturns the list of scheduled tasks for the application (site or Webservice).
    AppServerModifyScheduledTaskModifies an existing scheduled task.
    AppServerDeleteScheduledTaskDeletes a scheduled task associated with the application (site or Webservice).
Minimum version required
  • Version 18
Comments
Click [Add] to post a comment