PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Delayed tasks
  • Overview
  • Implementation via the code editor
  • Implementation by programming
  • Scheduled tasks
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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.
Notes:
  • The scheduled tasks and the delayed tasks correspond to Server procedures.
  • Implementing these features requires a WEBDEV application server version 180046 or later.
  • Versions 22 and 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).
    New in version 22
    The number of scheduled tasks associated with a site or with a Webservice can be viewed in the WEBDEV administrator (local or remote administrator).
    The number of scheduled tasks associated with a site or with a Webservice can be viewed in the WEBDEV administrator (local or remote administrator).
  • Versions 22 and later
    You have the ability to manage the scheduled tasks from the WEBDEV administrator (local or remote administrator).
    New in version 22
    You have the ability to manage the scheduled tasks from the WEBDEV administrator (local or remote administrator).
    You have the ability to manage the scheduled tasks from the WEBDEV administrator (local or remote administrator).
  • Versions 22 and later
    The scheduled tasks can be defined by programming.
    New in version 22
    The scheduled tasks can be defined by programming.
    The scheduled tasks can be defined by 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.
    Note: 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 "Delayed task (WEBDEV)" and configure the different parameters of the delayed task: 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 HyperFileSQL context. 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:
    Note: 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.
Note: 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).
Versions 22 and later

Implementation by programming

WEBDEV proposes to define the delayed procedures by programming via the AppServerxxx functions.
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:
    Versions 22 and later
    AppServerDeleteScheduledTask
    AppServerDeleteScheduledTask
    Deletes a scheduled task associated with the application (site or Webservice).
    Versions 22 and later
    AppServerInfoScheduledTask
    AppServerInfoScheduledTask
    Reads the description of a scheduled task.
    Versions 22 and later
    AppServerListScheduledTask
    AppServerListScheduledTask
    Returns the list of scheduled tasks for the application (site or Webservice).
    Versions 22 and later
    AppServerModifyScheduledTask
    AppServerModifyScheduledTask
    Modifies an existing scheduled task.
    Versions 22 and later
    AppServerRunScheduledTask
    New in version 22
    AppServerRunScheduledTask
    AppServerRunScheduledTask
    Immediately starts the execution of a scheduled task on a WEBDEV Application Server.
New in version 22

Implementation by programming

WEBDEV proposes to define the delayed procedures by programming via the AppServerxxx functions.
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:
    Versions 22 and later
    AppServerDeleteScheduledTask
    AppServerDeleteScheduledTask
    Deletes a scheduled task associated with the application (site or Webservice).
    Versions 22 and later
    AppServerInfoScheduledTask
    AppServerInfoScheduledTask
    Reads the description of a scheduled task.
    Versions 22 and later
    AppServerListScheduledTask
    AppServerListScheduledTask
    Returns the list of scheduled tasks for the application (site or Webservice).
    Versions 22 and later
    AppServerModifyScheduledTask
    AppServerModifyScheduledTask
    Modifies an existing scheduled task.
    Versions 22 and later
    AppServerRunScheduledTask
    New in version 22
    AppServerRunScheduledTask
    AppServerRunScheduledTask
    Immediately starts the execution of a scheduled task on a WEBDEV Application Server.

Implementation by programming

WEBDEV proposes to define the delayed procedures by programming via the AppServerxxx functions.
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:
    Versions 22 and later
    AppServerDeleteScheduledTask
    AppServerDeleteScheduledTask
    Deletes a scheduled task associated with the application (site or Webservice).
    Versions 22 and later
    AppServerInfoScheduledTask
    AppServerInfoScheduledTask
    Reads the description of a scheduled task.
    Versions 22 and later
    AppServerListScheduledTask
    AppServerListScheduledTask
    Returns the list of scheduled tasks for the application (site or Webservice).
    Versions 22 and later
    AppServerModifyScheduledTask
    AppServerModifyScheduledTask
    Modifies an existing scheduled task.
    Versions 22 and later
    AppServerRunScheduledTask
    New in version 22
    AppServerRunScheduledTask
    AppServerRunScheduledTask
    Immediately starts the execution of a scheduled task on a WEBDEV Application Server.
Scheduled tasks
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.
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.
    Note: 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 "Scheduled task (WEBDEV)" and configure the different scheduling parameters:
    • Runtime month.
    • Runtime day.
    • Execution time.
    • Maximum runtime duration.
    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 deployment of the site, the scheduled task will be run on the server according to the specified parameters.
Note: 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).
Minimum required version
  • Version 18
Comments
Click [Add] to post a comment