ScheduleManagedTasks (open)

Schedule multiple managed tasks

Syntax

LOADLIB "mod::system/lib/tasks.whlib";

INTEGER ARRAY FUNCTION ScheduleManagedTasks(STRING tasktype, RECORD ARRAY taskdatas, RECORD options)

Parameters

STRING tasktype

Type of the task (module:tasktype as definied in a moduledefinition)

RECORD ARRAY taskdatas

Task data records (as specified by the task). The data must fit in 4K of HSON data

RECORD options

Options

RECORD auxdata

Auxilliary data cells. This will be merged with the task data when passed to the task, but stored separately to avoid the 4K limit

DATETIME notbefore

Scheduled date after which the tasks can be executed

STRING priority

Override the default task priority for this task type. Allowed values: '', 'background', 'normal', 'interactive', 'update', 'updateinteractive'.

INTEGER ARRAY taskids

Pre-set task ids

INTEGER timeout

Time limit for the task, 0 for no limit. If provided, overrides the limit set with the task type.

Return value

INTEGER ARRAY

ID of the scheduled tasks, in the taskdatas order

Description

Allows you to schedule multiple managed tasks, as long as they share the same options. This allows the database to share the auxdata blobs, eg when scheduling an outgoing mail task with multiple receivers.