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 tasktypeType of the task (module:tasktype as definied in a moduledefinition)
RECORD ARRAY taskdatasTask data records (as specified by the task). The data must fit in 4K of HSON data
RECORD optionsOptions
RECORD auxdataAuxilliary data cells. This will be merged with the task data when passed to the task, but stored separately to avoid the 4K limit
DATETIME notbeforeScheduled date after which the tasks can be executed
STRING priorityOverride the default task priority for this task type. Allowed values: '', 'background', 'normal', 'interactive', 'update', 'updateinteractive'.
INTEGER ARRAY taskidsPre-set task ids
INTEGER timeoutTime limit for the task, 0 for no limit. If provided, overrides the limit set with the task type.
Return value
INTEGER ARRAYID 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.