Case class
Cases of action scope.
- Extends
Constructors
Case(string, Dialog[]) | Initializes a new instance of the Case class. |
Properties
value | Gets or sets value expression to be compared against condition. |
Inherited Properties
actions | The actions to execute. |
End |
Gets a default end-of-turn result. |
id | |
telemetry |
Inherited Methods
begin |
Called when the Dialog is started and pushed onto the dialog stack. |
configure(Record<string, unknown>) | Fluent method for configuring the object. |
continue |
Called when the Dialog is continued, where it is the active dialog and the user replies with a new activity. |
end |
When overridden in a derived class, performs clean up for the dialog before it ends. |
get |
|
get |
Gets the child Dialog dependencies so they can be added to the containers Dialog set. |
get |
Gets a unique |
on |
Called when an event has been raised, using |
reprompt |
When overridden in a derived class, reprompts the user for input. |
resume |
Called when a child Dialog completed its turn, returning control to this dialog. |
Constructor Details
Case(string, Dialog[])
Initializes a new instance of the Case class.
new Case(value?: string, actions?: Dialog[])
Parameters
- value
-
string
Optional. Case's string value.
- actions
-
Dialog[]
Optional. Numerable list of Dialog actions.
Property Details
value
Gets or sets value expression to be compared against condition.
value: string
Property Value
string
Inherited Property Details
actions
The actions to execute.
actions: Dialog[]
Property Value
Dialog[]
Inherited From ActionScope.actions
EndOfTurn
Gets a default end-of-turn result.
static EndOfTurn: DialogTurnResult
Property Value
DialogTurnResult
Remarks
This result indicates that a dialog (or a logical step within a dialog) has completed processing for the current turn, is still active, and is waiting for more input.
Inherited From Dialog.EndOfTurn
id
id: string
Property Value
string
Inherited From Dialog.id
telemetryClient
telemetryClient: BotTelemetryClient
Property Value
BotTelemetryClient
Inherited From Dialog.telemetryClient
Inherited Method Details
beginDialog(DialogContext, O)
Called when the Dialog is started and pushed onto the dialog stack.
function beginDialog(dc: DialogContext, _options?: O): Promise<DialogTurnResult>
Parameters
- dc
-
DialogContext
The DialogContext for the current turn of conversation.
- _options
-
O
Optional. Initial information to pass to the dialog.
Returns
Promise<DialogTurnResult>
A Promise
representing the asynchronous operation.
Inherited From ActionScope.beginDialog
configure(Record<string, unknown>)
Fluent method for configuring the object.
function configure(config: Record<string, unknown>): this
Parameters
- config
-
Record<string, unknown>
Configuration settings to apply.
Returns
this
The Configurable after the operation is complete.
Inherited From Configurable.configure
continueDialog(DialogContext)
Called when the Dialog is continued, where it is the active dialog and the user replies with a new activity.
function continueDialog(dc: DialogContext): Promise<DialogTurnResult>
Parameters
- dc
-
DialogContext
The DialogContext for the current turn of conversation.
Returns
Promise<DialogTurnResult>
A Promise
representing the asynchronous operation.
Inherited From ActionScope.continueDialog
endDialog(TurnContext, DialogInstance, DialogReason)
When overridden in a derived class, performs clean up for the dialog before it ends.
function endDialog(_context: TurnContext, _instance: DialogInstance, _reason: DialogReason): Promise<void>
Parameters
- _context
-
TurnContext
The context object for the turn.
- _instance
-
DialogInstance
Current state information for this dialog.
- _reason
-
DialogReason
The reason the dialog is ending.
Returns
Promise<void>
Remarks
Derived dialogs that need to perform logging or cleanup before ending should override this method. By default, this method has no effect.
The DialogContext calls this method when the current dialog is ending.
See also
Inherited From Dialog.endDialog
getConverter(Object)
function getConverter(property: Object): Converter | ConverterFactory
Parameters
- property
-
Object
The key of the conditional selector configuration.
Returns
Converter | ConverterFactory
The converter for the selector configuration.
Inherited From ActionScope.getConverter
getDependencies()
Gets the child Dialog dependencies so they can be added to the containers Dialog set.
function getDependencies(): Dialog[]
Returns
Dialog[]
The child Dialog dependencies.
Inherited From ActionScope.getDependencies
getVersion()
Gets a unique string
which represents the version of this dialog. If the version
changes between turns the dialog system will emit a DialogChanged event.
function getVersion(): string
Returns
string
Unique string
which should only change when dialog has changed in a
way that should restart the dialog.
Inherited From ActionScope.getVersion
onDialogEvent(DialogContext, DialogEvent)
Called when an event has been raised, using DialogContext.emitEvent()
, by either the current dialog or a dialog that the current dialog started.
function onDialogEvent(dc: DialogContext, e: DialogEvent): Promise<boolean>
Parameters
- dc
-
DialogContext
The dialog context for the current turn of conversation.
- e
-
DialogEvent
The event being raised.
Returns
Promise<boolean>
True if the event is handled by the current dialog and bubbling should stop.
Inherited From Dialog.onDialogEvent
repromptDialog(TurnContext, DialogInstance)
When overridden in a derived class, reprompts the user for input.
function repromptDialog(_context: TurnContext, _instance: DialogInstance): Promise<void>
Parameters
- _context
-
TurnContext
The context object for the turn.
- _instance
-
DialogInstance
Current state information for this dialog.
Returns
Promise<void>
Remarks
Derived dialogs that support validation and re-prompt logic should override this method. By default, this method has no effect.
The DialogContext calls this method when the current dialog should re-request input from the user. This method is implemented for prompt dialogs.
See also
Inherited From Dialog.repromptDialog
resumeDialog(DialogContext, DialogReason, any)
Called when a child Dialog completed its turn, returning control to this dialog.
function resumeDialog(dc: DialogContext, _reason: DialogReason, result?: any): Promise<DialogTurnResult>
Parameters
- dc
-
DialogContext
The DialogContext for the current turn of conversation.
- _reason
-
DialogReason
(xref:botbuilder-dialogs.DialogReason), reason why the dialog resumed.
- result
-
any
Optional. Value returned from the dialog that was called. The type of the value returned is dependent on the child dialog.
Returns
Promise<DialogTurnResult>
A Promise
representing the asynchronous operation.
Inherited From ActionScope.resumeDialog