Scheduled tasks

How to automate tasks with Vertec

Scheduled tasks are useful to automate processes in Vertec that are performed regularly, e.g. overnight.

You can create new scheduled tasks in the folder Settings > Customize > Scheduled tasks.

A scheduled task has the following properties:

Type

There are different types of tasks:

  • Recalculate BI measures: calculates the measures for the Business Intelligence module.
  • Recalculate full-text search index: recalculates all indexes for full-text search.
  • Update database index statistics: updates the database index statistics.
  • Execute script: This allows a script registered in Vertec to be run at a defined time.
  • Drop and recalculate full-text search index: Available as of Vertec 6.8.0.7. This is used to remove and re-create the full-text search index if problems occur with the usual scheduled task Recalculate full-text search index. You should not activate and regularly execute this task. Instead, you should manually trigger it if necessary.  
Designation

Designation of the scheduled task. For example, shown in the list.

Active

Only active scheduled tasks are performed.

Repeat mode

In this field, you can select between Daily and Weekly. The time is given in the Coordinated Universal Time UTC.

Alternatively, a CRON expression can be specified. You can find information about the structure of CRON expressions online, e.g. on Wikipedia: https://de.wikipedia.org/wiki/Cron.

In the background, each of these data leads to a CRON expression, with which the time of the next execution is determined.

You can check your entries in the Next execution field below, which shows the time of the next execution in both UTC and local time.

Note for Cloud Suite: We recommend setting the execution time from Monday to Friday between 03:00 and 19:00. Outside these times, it may happen that a running task is forced to complete or not execute on that day, for example, due to maintenance windows.

Users

The scheduled task will be performed under this user, so you must specify here a user with sufficient rights to execute this script, usually, the administrator.

Function reference

Only available if Execute script is selected in the Type field.  

The function reference is the name of the script entry, followed by the function to be executed within this script, separated by a period. It must be a feature with no arguments.

<scriptentry>.<functionname>

Once entered, the code can be shown in a popup by clicking on the button with the three dots. In the popup, click on the Open in Script Editor button to open the script entry directly in the Script Editor. You can also edit it there.

Status

Specifies whether the execution was successful or failed.

If the execution failed, the error message shows in the Last output box at the bottom.

Next execution

Here, the time of the next execution is shown in both UTC and local time.

The next run is determined based on the CRON expression (see Repeat mode field above) and the current time.

However, if the cloud server is not running at this point, the execution cannot be performed. As soon as the cloud server is running again, it detects the next execution. To prevent a sudden large number of tasks from running at the same time, past “missed” executions are not made up at the start of the cloud server.

Last started

Start time of last execution.

Last finished

End date of last execution.

Last output

Output of last execution. If this failed, an error message is shown here.

Execute directly

In the context menu of the scheduled task, you can find an Execute now menu item. It is important to note that this operation does not set the scheduled task to the current point in time. Instead, it only executes the script – just as if the script or the called method were executed in the Script Editor, under the logged-in user, and not under the user defined in the scheduled task.

Note on running reports

If the Restricted Filesystem Access or Restricted Session Process parameters are enabled, activated reports to be stored on the file system are sent to the client for storage.    

In scheduled tasks, this does not work and throws the following errors:

The report cannot be saved. Please use a DMS extension, or specify an empty save path.

To solve this issue, choose one of the following options:

  • Save documents directly in Vertec (Document storage) Internal)
  • Use a cloud ready DMS extension, e.g. the Sharepoint online dms extension, for document storage
  • Prevent document storage by passing an empty string as the storage path: result = vtcapp.executereport2(project, none, template, ''). The report can instead be sent e.g. by email.

Note on executing extension code, e.g. payment import

Extension codes can also be executed, but these must be online extensions, i.e. under Cloud capability, they have the attribute Cloud and Web App.

The cloud ready extensions, which can only be operated in the Cloud App, are, in the background, local COM extensions, which are communicated with via COM forwarding. This cannot be done by the scheduled task. In this case, a Windows batch task must be created for automation.

Parameters in the Vertec.ini file (Vertec On-Premises only)

In the Vertec.ini file in the [cloudserver] section, the following parameters influence the scheduled tasks:

Task scheduler
 
 

Controls whether the scheduling task is active or not. If not, no scheduled tasks are executed.

If the parameter is not specified, the default is True. If you do not want to perform scheduled tasks with a CloudServer section, you can turn it off with

Task Scheduler = False

If you are running multiple cloud servers, only one of them is applied to run tasks. For all others, this parameter must be set to False.

Task Scheduler Polling Minutes

Controls how many minutes are checked for outstanding scheduled tasks.

Natural number, default is 1.

Task Scheduler Concurrent Tasks

Controls the maximum number of scheduled tasks that can be executed in parallel.

Natural number, default is 1.

Special Task Scheduler Range Start
Special Task Scheduler Range End

This allows you to define the time window in which the scheduled tasks for BI calculationsfull-text indexing and  recalculation of index statistics may be carried out.    

Within this time window, the Vertec Cloud Server rolls a time in which the processes are started. The start time is set by a new session at the start of the Cloud Server.

Special Task Scheduler Range Start=23:00 
Special Task Scheduler Range End=05:00

How to roll: Beginning from the start time, the number of minutes until the end time is determined. Then, a random number from 0 to the number of minutes is rolled, and this value is added to the start time. This results in the CRON expression for determining the next execution.

Netherlands

United Kingdom