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 :
d2/sdk/controls/dialogs/generic/d2fs.state.method
- .execute(options, result) ⇒
Promise.<boolean>
- .setDialogContextForm(dialogId, action, currentFormName) ⇒
void
- .getDialogContextForm(dialogId, action) ⇒
string
|null
- .clearDialogContextForm(dialogId) ⇒
void
- .execute(options, result) ⇒
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.
Param | Type | Description |
---|---|---|
options | MethodMetadata | holder for various current state related metadata |
result | OutputFormData | 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
Param | Type | Description |
---|---|---|
dialogId | string | A uniqueue identifier associated with current dialog. |
action | string | Name of the method getting applied |
currentFormName | string | 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.
Param | Type | Description |
---|---|---|
dialogId | string | A uniqueue identifier associated with current dialog. |
action | string | 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
Param | Type | Description |
---|---|---|
dialogId | string | A uniqueue identifier associated with current dialog. |