StateManager Class

Processes the wizard’s global state and each page’s local state.

Declaration

export class StateManager

Remarks

A global state stores all the wizard settings required to create a report/data source. Each wizard page uses a specific subset of the global state (a page’s local state). The State Manager acts like a mediator between the global state and wizard pages. It processes the global state, extracts a local state for each page, and commits local changes to the global state.

In most cases, you do not need to explicitly use the State Manager object in your code.

constructor(globalState, pageFactory)

Initializes the StateManager class with the specified settings.

Declaration

constructor(
    globalState: any,
    pageFactory: PageFactory
)

Parameters

Name Type Description
globalState any

The global state.

pageFactory PageFactory

The page factory.

Methods

getCurrentState Method

Returns the global state.

Declaration

getCurrentState(): any

Returns

Type Description
any

The global state.

getPageState(pageId) Method

Returns the local state of the specified page.

Declaration

getPageState(
    pageId: string
): any

Parameters

Name Type Description
pageId string

The page ID.

Returns

Type Description
any

The page’s local state.

reset Method

Resets the global state.

Declaration

reset(): void

resetPageState(pageId) Method

Resets the local state of the specified page.

Declaration

resetPageState(
    pageId: string
): void

Parameters

Name Type Description
pageId string

The page ID.

setPageState(pageId, data) Method

Sets the local state to the specified page.

Declaration

setPageState(
    pageId: string,
    data: any
): void

Parameters

Name Type Description
pageId string

The page ID.

data any

The page state.