scheduleTask | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Function scheduleTask

    • Schedule a managed task if this transaction commits

      A managed task, once scheduled, will always attempt to complete, and is restarted when it or the task manager fails. Managed tasks are often used for 'after effects' which can take a lot of time, eg the actual deletion of a WRD schema. A managed task will be attempted even if the script that queued it exits before the task starts. If work is open, the task will be queued as soon as the current work is committed, and will not be queued if the work is rolled back.

      Parameters

      • tasktype: string

        Type of the task to schedule (eq: wrd:deleteschemas) - refers to to the servicemanager:managedtask in the moduledefinition

      • Optionaltaskdata: IPCMarshallableData

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

      • Optionaloptions: ScheduleTaskOptions

      Returns Promise<number>

      id of this task. This id is a database id and can be used by later scripts