Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TaskManager

The task manager allows you to manually trigger service executions of your scheduled tasks which actually ran periodically at fixed times, dates, or intervals.

Typically, a scheduled task runs according to its defined execution schedule. However, with Altogic's client API by calling the runOnce method, you can manually run scheduled tasks ahead of their actual execution schedule.

export

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

fetcher: Fetcher

The http client to make RESTful API calls to the application's execution engine

Methods

  • getTaskStatus(taskId: string): Promise<{ errors: null | APIError; info: null | TaskInfo }>
  • Gets the latest status of the task. The last seven days task execution logs are kept. If you try to get the status of a task that has been triggered earlier, this method returns null for TaskInfo.

    If the client library key is set to enforce session, an active user session is required (e.g., user needs to be logged in) to call this method.

    Parameters

    • taskId: string

      The id of the task

    Returns Promise<{ errors: null | APIError; info: null | TaskInfo }>

    If successful, returns status information about the triggered task

  • runOnce(taskNameOrId: string): Promise<{ errors: null | APIError; info: null | TaskInfo }>
  • Triggers the execution of the specified task. After the task is triggered, the routed service defined in your scheduled task configuration is invoked. This routed service executes the task and performs necessary actions defined in its service flow.

    If the client library key is set to enforce session, an active user session is required (e.g., user needs to be logged in) to call this method.

    Parameters

    • taskNameOrId: string

    Returns Promise<{ errors: null | APIError; info: null | TaskInfo }>

    If successful, returns information about the triggered task. You can use taskId to check the exectuion status of your task by calling getTaskStatus method. In case of errors, returns the errors that occurred.

Generated using TypeDoc