Table of Contents

Scheduled task properties

General properties

Identifier

The identifier of a scheduled task is a GUID. It is auto-generated and is also used as an identifier for the Quartz.NET trigger generated from the scheduled task.

Enabled

In creation, on a disabled task, the Quartz.NET trigger is not created. In modification, on a task that changes to the disabled state, the Quartz.NET trigger is deleted. In both cases, the task will never be triggered automatically. It is still possible to trigger it manually.

Target cluster

This is the name of the cluster on which to trigger the background server method. Its name must be entered exactly so that the event published to trigger the background server method is correctly processed by the Task Runner of the target cluster.

Multi-tenant

You need to know if the target cluster is running as single-tenant or multi-tenant and indicate it here. When multi-tenant is unchecked, the target tenant is not accessible and pre-populated with __default__.

Target tenant

This field can only be entered if multi-tenant is checked. If a value is entered, the scheduled task will be executed only once for this tenant. If no value is entered, each time the scheduled task is executed, the list of tenants in the cluster is obtained and an event is emitted to request an execution of the background server method for each tenant.

Run as

This user is passed in the event to the Task Runner of the business cluster to start the background server method. It is then accessible in the business code using the IUserInfoAccessor service.

Startup timeout in minutes

If the task has not started before the time set here, it automatically transitions to the 'Timeout expired' state.

The timeout is also used to:

  • Set the lifespan of the published message to start the background server method.
  • A check just before the start of the background server method by the Task Runner.

Timeout in minutes

If the task is not completed within the time set here, it automatically transitions to the 'Timeout expired' state.

The timeout is also used for:

  • Setting the lifespan of the published message to start the server method in the background if the startup timeout is not specified.
  • Canceling the cancellation token of the server method if it exposes this parameter.
Warning

It is strongly recommended to systematize the use of the CancellationToken in the background server methods so that the processing is properly stopped if a timeout occurs.

Action

It is generally not advisable to enter the action manually, the risk of error is high. The Capture call action can allow you to manually launch an action to be scheduled and obtain all its information automatically.

Target server method

Here you must enter the exact name of the background server method as it appears in Neos Studio.

Server method arguments

Here you need to enter the server method parameters in JSON format. Example for a server method with three parameters named clusterName, maxAgeInDays and quotedIdentifiers:

{
    "clusterName": "TechnicalDemos",
    "maxAgeInDays": 1,
    "quotedIdentifiers": true
}

Trigger

This is the trigger condition for a scheduled task.

In Cron expression mode, it is possible to facilitate the entry using AI if the configuration has been made for the cluster. The configuration is close to that explained here: https://dev.azure.com/POLE-ERP-GROUPEISA/FMK/_wiki/wikis/FMK.wiki/620/Neos-Studio-Assistant. Only the keys AI:ApiEndpoint and AI:ApiKey are required and the ID GroupeIsa.Neos.TaskScheduler.AspNetCore must be used instead of GroupeIsa.Neos.Designer.AspNetCore.