Skip to main content

d2fs.state.method

D2FSStateMethod : d2/sdk/controls/dialogs/generic/d2fs.state.method

D2FSStateMethod. A default, contextful implementation of state methods that makes it possible to retrieve and transition through different states of D2FS dialogs. To customize the default implementation with lesser amount of coding, this class can be extended into scenario specific subclass and added to state methods collection by means of extension with proper binding rules.

Also see DialogStateMethods

Extends: DialogStateMethod

d2FSStateMethod.execute(options, result) ⇒ Promise.<boolean>

Implements contextful state transition logic for D2FS dialog.

Kind: instance method of D2FSStateMethod
Returns: Promise.<boolean> - Resolve with false to stop executing any other matching state methods that are supposed to execute after it.

ParamTypeDescription
optionsMethodMetadata

holder for various current state related metadata

resultOutputFormData

Output parameter, should be filled in with metadata pertaining to next possible state of the dialog.

d2FSStateMethod.setDialogContextForm(dialogId, action, currentFormName) ⇒ void

Set the context before applying this method to current state of the dialog.

Kind: instance method of D2FSStateMethod

ParamTypeDescription
dialogIdstring

A uniqueue identifier associated with current dialog.

actionstring

Name of the method getting applied

currentFormNamestring

Present state's metadata name for the dialog.

d2FSStateMethod.getDialogContextForm(dialogId, action) ⇒ string | null

Get context before applying this method to current state of the dialog.

Kind: instance method of D2FSStateMethod
Returns: string | null - Should return contextual state name, however can return null to implement a contextless flow.

ParamTypeDescription
dialogIdstring

A uniqueue identifier associated with current dialog.

actionstring

Name of the method about to be applied.

d2FSStateMethod.clearDialogContextForm(dialogId) ⇒ void

Clears context for given dialog when the dialog has reached a terminal state.

Kind: instance method of D2FSStateMethod

ParamTypeDescription
dialogIdstring

A uniqueue identifier associated with current dialog.