import { WorkflowState } from '../workflow-state'; import { Workflow } from '../workflow'; import { ClassConstructor, CoreDependencies } from '../../util'; import { ContainerAdapter } from '../../container'; import { HandlerRegistry } from '../../handler'; import { Persistence } from '../persistence'; /** * The central workflow registry that holds all workflows managed by the application. This includes * - the list of workflows * - what messages start the workflow * - what messages are handled by each workflow * This registry is also responsible for dispatching messages to workflows as they are received. */ export declare class WorkflowRegistry { private workflowRegistry; private isInitialized; private isInitializing; private logger; private persistence; prepare(coreDependencies: CoreDependencies, persistence: Persistence): void; register(workflow: ClassConstructor>): Promise; /** * Initialize all services that are used to support workflows. This registers all messages subscribed to * in workflows as handlers with the bus, as well as initializing the persistence service so that workflow * states can be stored. * * This should be called once as the application is starting. */ initialize(handlerRegistry: HandlerRegistry, container: ContainerAdapter | undefined): Promise; dispose(): Promise; private registerFnStartedBy; private registerFnHandles; private createWorkflowState; /** * Creates a new handling context for a single workflow. This is used so * that the `workflowId` is attached to outgoing messages in sticky * attributes. This allows message chains to be automatically mapped * back to the workflow if handled. */ private buildWorkflowHandlingContext; private dispatchMessageToWorkflow; private persist; }