Scheduled tasks

Automate tasks with Vertec

Product line

Standard

|

Expert

Operating mode

CLOUD ABO

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 23.04.2020
Machine translated
Updated: 19.03.2024 | Added annotation for the cloud suite in repeat mode.

To automate tasks in Vertec that are regularly performed overnight, the scheduled tasks are available. They can be used to run scripts in Vertec on a scheduled basis.

New scheduled tasks can be created in the Settings > Customizing > Scheduled Tasks folder.

A scheduled task has the following properties:

Type

There are two different types of tasks:

designation Designation of the scheduled task. Shown e.g. in the list.
Active Only active scheduled tasks are performed
Repeat Mode

Here you can choose between Daily and Weekly. The time is given in Coordinated Universal Time UTC.

Alternatively, a CRON expression can be specified. Information on the structure of CRON expressions can be found on the internet, for example 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 box below, which shows the time of the next execution in both UTC and local time.

Note for the cloud suite: We recommend that you schedule the execution to a time between 02:00 and 19:00 Monday – Friday. Outside these times, for example due to maintenance windows, a running task may be forcibly completed or not executed on that day.

Users The scheduled task will be executed under this user. A user who has sufficient privileges to run this script must be specified here, usually the administrator.
Function reference

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

<Scripteintrag>.<Funktionsname>

Once entered, the code can be shown in a popup by clicking on the button with the three dots. Clicking on the button Open in Script Editor in the popup opens the script entry directly in the Script Editor and can be edited there.

Status

Indicates whether the execution was successful or failed.

If the execution failed, the error message will be shown in the Last Issue field below.

Next version

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

The next execution is determined based on the CRON expression (see Repeat Mode field above) and the up-to-date time.

However, if the cloud server is not running at this time, the execution cannot be performed. When the cloud server is running again, it will detect the next execution. Past “missed” executions are not made up when the cloud server starts, to prevent a sudden large number of tasks running at the same time.

Last start Start time of the last execution.
Last Closing End time of last execution.
Last issue Output of the last execution. If this failed, the error message is shown here.

Execute Directly

In the context menu of the scheduled task, there is a menu item Run Now. Here it is important to know that this operation does not set the scheduled task to the current time, but only executes the script – exactly as if the script or method were executed in the Script Editor, namely under the logged-in user and not under the user defined in the scheduled task.

Note about running reports

In the cloud suite or on-premises, if the parameters Restrict Filesystem Access or Restrict Session Process are activated in the Vertec.ini – file , reports are sent to the client for saving. In scheduled tasks, this does not work and throws the following errors:

Der Bericht kann nicht gespeichert werden. Bitte verwenden Sie eine DMS Schnittstelle oder geben Sie einen leeren Speicherpfad an.

As a remedy, there are two options:

  • Use a cloud-ready DMS extension for document storage.
  • To prevent document storage by passing an empty string as the storage path: resultat = vtcapp.executereport2(projekt, None, vorlage, ''). The report can instead be sent e.g. by e-mail.

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

There are the following parameters in the Vertec.ini file in the section [cloudserver] :

Task Scheduler

 

 

Controls whether Task Scheduling is active or not. If not, no scheduled tasks are executed.

If the parameter is not specified, the default True applies. So if you do not want to perform scheduled tasks with a CloudServer section, this can be turned off with

Task Scheduler = False

When running multiple cloud servers, only one of them may be responsible for running tasks. For all others, this parameter must be set to False.

Task Scheduler Polling Minutes

Controls how many minutes are checked for pending scheduled tasks.

Natural number, default is 1.

Task Scheduler Concurrent Tasks

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

Natural number, default is 1.

BI Task Scheduler Range Start

 

BI Task Scheduler Range End

This allows you to define the time window in which the BI data is calculated. Within this time window, the cloud server rolls a time in which the process is started. The start time is set by a new session when the cloud server starts.

These parameters are especially important for the Vertec cloud suite, but can of course also be used in other ways.

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

This is how to roll the dice: Based on the start time, the quantity of minutes to the end time is determined. Then a random number from 0 to the quantity of minutes is rolled and this value is added to the start time. This results in the CRON expression for determining the next execution (see the description of the Next Execution field above).