@vhidvz/wfjs
    Preparing search index...

    Class Context<D>

    Type Parameters

    • D = any

    Implements

    Index

    Constructors

    Properties

    data?: D
    recentlyAddedTokens?: Token[]
    status: Status = Status.Ready
    tokens: Token[] = []

    Methods

    • It adds a token to the tokens array

      Parameters

      • token: Token

        The token to add to the list of tokens.

      Returns void

    • If every token in the tokens array has a status of Completed, then return true

      Returns boolean

      A boolean value.

    • The function checks if the status is equal to "Failed".

      Returns boolean

      The isFailed() function is returning a boolean value

    • It returns true if some token in the tokens array has a status of Terminated

      Returns boolean

      A boolean value that is true if all the tokens have a status of Terminated.

    • It returns true if every token in the tokens array has a status of Paused

      Returns boolean

      A boolean value.

    • If the status property of the current instance is equal to the Ready constant, return true, otherwise return false.

      Returns boolean

      A boolean value.

    • It returns true if every token in the tokens array has a status of Terminated

      Returns boolean

      A boolean value that is true if all the tokens have a status of Terminated.

    • Return the next token's state if it's ready, otherwise return undefined.

      Returns State<any> | undefined

      The state of the first token that has a status of Ready.

    • If the status is running or paused, set the status to ready

      Parameters

      • force: boolean = false

      Returns Context<D>

      The instance of the class.

    • It returns an object with the data, status, and tokens.

      Parameters

      • options: { data: boolean; value: boolean } = ...

        data: true, value: true

      Returns {
          data?: D;
          status: Status;
          tokens: {
              history: { name?: string; ref: string; status: Status; value?: any }[];
              id: string;
              locked?: boolean;
              parent?: string;
          }[];
      }

      An object with the data, status, and tokens.

    • The function sets the status of an object to "Terminated".

      Returns Context<D>

      The terminate() method is returning the current object (this)

    • It returns a new instance of the Context class, with the data parameter passed in as the data property of the new instance

      Type Parameters

      • D = any

      Parameters

      Returns Context<D>

      A new instance of the Context class.