import Bluebird from "bluebird"; import type ActivityContextProxy from "./ActivityContextProxy"; import type AmbientState from "./AmbientState"; import type { IActivityState } from "./IDebugSession"; import type MonikerFrame from "./MonikerFrame"; import type { IActivityContext, IActivityHandler } from "../IActivityHandler"; import type { Task } from "../Task"; import type { Activity } from "../definition/Activity"; interface ExpressionEvaluator { (resources: any, values: any): any; } type Recent = { context: ActivityContext; }; /** * USE TRY-CATCH CAREFULLY * * There is a difference between an error with the workflow and an error with * the environment and/or engine. We don't want to conflate the two. So to that * end, whenever we invoke something else outside of the engine, we should try * to isolate that code. Bludbird's Promise.attempt feature does this very nicely. * * CAPTURING ERRORS * * Here we are using a Promise to capture the errors during activity * execution. Many things can contribute an error: accessors, inputs, handler * creation, and activation problems. The promise is never meant to become * rejected itself as this would indicate a problem with the actual engine * rather than a problem with executing the workflow. This distinction is * extremely important in terms of issue routing. */ declare abstract class ActivityContext implements IActivityState, IActivityContext { action: string; activity: Activity; ambient: AmbientState; branch?: string; callBranch?: boolean; cancellationToken: Task; caught?: Error; evaluators: Record; extras: any[]; forkBranch?: boolean; frame: MonikerFrame; handler?: Bluebird; id: any; inputs: Record; jumpBranch?: string; luid: any; monikers: string[]; outputs: Record; passes: number; promise: Bluebird | undefined; proxy: ActivityContextProxy; recent?: Recent; registeredForErrors?: boolean; repeat?: boolean; scope: Record; state: any; stateToPersist: any; private static filterErrors; private static isError; private static isInvalidHandler; private static reduceErrors; call(branch: any): void; cancellationResolve: () => void; execute(): Bluebird | Bluebird; fork(branch: any): void; goto(): void; hasBranch(branch: any): boolean; jump(branch: any): void; persist(state: any): void; registerForErrors(): void; protected generateMonikers(): void; protected marshalError(): Error | undefined; private concludeInline; private emitActivityActivationError; private emitActivityBindingError; private emitActivityError; private emitExpressionAccessorError; private emitExpressionEvaluationError; private emitExpressionSyntaxError; private executeHandlerInline; private findContext; private resolveAccessorInline; private resolveAssetsInline; private resolveExtrasInline; private resolveHandlerInline; private resolveInputsInline; private resolveOutputsInline; protected abstract transferInline(): void; } export {};