/** @packageDocumentation * @module WorkflowTask */ import { UiEvent } from "@bentley/ui-core"; import { ItemDefBase } from "../shared/ItemDefBase"; import { ItemProps } from "../shared/ItemProps"; import { Task } from "./Task"; /** Properties for a [[Workflow]]. * @public */ export interface WorkflowProps extends ItemProps { id: string; defaultTaskId: string; tasks: string[]; isDefault?: boolean; } /** Workflow Properties List definition. * @public */ export interface WorkflowPropsList { defaultWorkflowId: string; workflows: WorkflowProps[]; } /** Workflow class. * A Workflow is a defined sequence of tasks used to accomplish a goal. * @public */ export declare class Workflow extends ItemDefBase { /** Id of the Workflow */ workflowId: string; /** Default Task Id */ defaultTaskId: string; /** Active Task Id */ activeTaskId: string | null; /** Indicates whether this Workflow is the default */ isDefault: boolean; private _taskIds; private _tasks; constructor(workflowDef: WorkflowProps); /** Gets the Id of the Workflow. */ get id(): string; /** Gets the active Task. */ get activeTask(): Task | undefined; /** Gets a Task with a given Id. * @param taskId Id of the Task to get */ getTask(taskId: string): Task | undefined; /** Gets the last active Task. If no Task is active, it returns the default Task. */ get lastActiveTask(): Task | undefined; /** Determines if the Workflow is active. */ get isActive(): boolean; set isActive(_: boolean); /** Sets a Task as active. * @param task The Task to set as active */ setActiveTask(task: Task): void; /** Gets an array of sorted Tasks in the Workflow. */ getSortedTasks(): Task[]; } /** Workflow Activated Event Args class. * @public */ export interface WorkflowActivatedEventArgs { workflowId?: string; workflow?: Workflow; } /** Workflow Activated Event class. * @public */ export declare class WorkflowActivatedEvent extends UiEvent { } /** Task Activated Event Args class. * @public */ export interface TaskActivatedEventArgs { taskId?: string; task?: Task; workflowId: string; workflow: Workflow; } /** Task Activated Event class. * @public */ export declare class TaskActivatedEvent extends UiEvent { } /** Workflow Manager class. * @public */ export declare class WorkflowManager { private static _workflows; private static _activeWorkflow; private static _defaultWorkflowId; /** Get Workflow Activated event. */ static readonly onWorkflowActivatedEvent: WorkflowActivatedEvent; /** Get Task Activated event. */ static readonly onTaskActivatedEvent: TaskActivatedEvent; /** Loads one or more Workflows. * @param workflowPropsList the list of Workflows to load */ static loadWorkflows(workflowPropsList: WorkflowPropsList): void; private static loadWorkflowDefs; /** Loads a Workflow. * @param workflowProps Properties of the Workflow to load */ static loadWorkflow(workflowProps: WorkflowProps): void; /** Adds a Workflow. * @param workflowId Id of the Workflow to add * @param workflow The Workflow to add */ static addWorkflow(workflowId: string, workflow: Workflow): void; /** Finds a Workflow with a given Id. * @param workflowId Id of the Workflow to find * @returns The Workflow if found, or undefined if not found */ static findWorkflow(workflowId: string): Workflow | undefined; /** Sets the active Workflow * @param workflow The Workflow to set as active */ static setActiveWorkflow(workflow: Workflow | undefined): void; /** Sets the active Workflow and Task * @param workflow The Workflow to set as active * @param task The Task to set as active */ static setActiveWorkflowAndTask(workflow: Workflow, task: Task): Promise; /** Gets the active Workflow */ static get activeWorkflow(): Workflow | undefined; /** Gets the active Workflow id */ static get activeWorkflowId(): string; /** Gets the active Task */ static get activeTask(): Task | undefined; /** Gets the active Task id */ static get activeTaskId(): string; /** Gets the Id of the default Workflow */ static get defaultWorkflowId(): string; /** Sets the Id of the default Workflow */ static setDefaultWorkflowId(id: string): void; /** Removes a Workflow * @param workflow The Workflow to remove */ static removeWorkflow(workflow: Workflow): boolean; static getSortedWorkflows(): Workflow[]; } //# sourceMappingURL=Workflow.d.ts.map