Interface JobCompletionInterfaceRest<WorkerOutputVariables>

interface JobCompletionInterfaceRest<WorkerOutputVariables> {
    cancelWorkflow: (() => Promise<"JOB_ACTION_ACKNOWLEDGEMENT">);
    complete: ((updatedVariables?) => Promise<"JOB_ACTION_ACKNOWLEDGEMENT">);
    error: ((error) => Promise<"JOB_ACTION_ACKNOWLEDGEMENT">);
    fail: {
        (errorMessage, retries?): Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
        (failureConfiguration): Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
    };
    forward: (() => "JOB_ACTION_ACKNOWLEDGEMENT");
    modifyJobTimeout: ((__namedParameters) => Promise<Response<string>>);
}

Type Parameters

  • WorkerOutputVariables

Properties

cancelWorkflow: (() => Promise<"JOB_ACTION_ACKNOWLEDGEMENT">)

Cancel the workflow.

Type declaration

    • (): Promise<"JOB_ACTION_ACKNOWLEDGEMENT">
    • Returns Promise<"JOB_ACTION_ACKNOWLEDGEMENT">

complete: ((updatedVariables?) => Promise<"JOB_ACTION_ACKNOWLEDGEMENT">)

Complete the job with a success, optionally passing in a state update to merge with the process variables on the broker.

Type declaration

    • (updatedVariables?): Promise<"JOB_ACTION_ACKNOWLEDGEMENT">
    • Parameters

      Returns Promise<"JOB_ACTION_ACKNOWLEDGEMENT">

error: ((error) => Promise<"JOB_ACTION_ACKNOWLEDGEMENT">)

Report a business error (i.e. non-technical) that occurs while processing a job. The error is handled in the process by an error catch event. If there is no error catch event with the specified errorCode then an incident will be raised instead.

Type declaration

    • (error): Promise<"JOB_ACTION_ACKNOWLEDGEMENT">
    • Parameters

      Returns Promise<"JOB_ACTION_ACKNOWLEDGEMENT">

fail: {
    (errorMessage, retries?): Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
    (failureConfiguration): Promise<JOB_ACTION_ACKNOWLEDGEMENT>;
}

Fail the job with an informative message as to the cause. Optionally, pass in a value remaining retries. If no value is passed for retries then the current retry count is decremented. Pass in 0for retries to raise an incident in Operate. Optionally, specify a retry backoff period in milliseconds. Default is 0ms (immediate retry) if not specified.

Type declaration

forward: (() => "JOB_ACTION_ACKNOWLEDGEMENT")

Mark this job as forwarded to another system for completion. No action is taken by the broker. This method releases worker capacity to handle another job.

Type declaration

    • (): "JOB_ACTION_ACKNOWLEDGEMENT"
    • Returns "JOB_ACTION_ACKNOWLEDGEMENT"

modifyJobTimeout: ((__namedParameters) => Promise<Response<string>>)

Extend the timeout for the job by setting a new timeout

Type declaration

    • (__namedParameters): Promise<Response<string>>
    • Parameters

      • __namedParameters: {
            newTimeoutMs: number;
        }
        • newTimeoutMs: number

      Returns Promise<Response<string>>

Generated using TypeDoc