EmitEvent class
Action which emits an event declaratively.
- Extends
-
Dialog<O>
Constructors
Emit |
Initializes a new instance of the EmitEvent class. |
Emit |
Initializes a new instance of the EmitEvent class. |
Properties
$kind | |
bubble |
A value indicating whether gets or sets whether the event should bubble or not. |
disabled | An optional expression which if is true will disable this action. |
event |
The name of the event to emit. |
event |
The memory property path to use to get the value to send as part of the event. |
handled |
The property path to store whether the event was handled or not. |
Inherited Properties
End |
Gets a default end-of-turn result. |
id | |
telemetry |
Methods
begin |
Starts a new Dialog and pushes it onto the dialog stack. |
get |
Inherited Methods
configure(Record<string, unknown>) | Fluent method for configuring the object. |
continue |
When overridden in a derived class, continues the dialog. |
end |
When overridden in a derived class, performs clean up for the dialog before it ends. |
get |
An encoded string used to aid in the detection of bot changes on re-deployment. |
on |
Called when an event has been raised, using |
reprompt |
When overridden in a derived class, reprompts the user for input. |
resume |
When overridden in a derived class, resumes the dialog after the dialog above it on the stack completes. |
Constructor Details
EmitEvent()
Initializes a new instance of the EmitEvent class.
new EmitEvent()
EmitEvent(string, string, boolean)
Initializes a new instance of the EmitEvent class.
new EmitEvent(eventName: string, eventValue?: string, bubbleEvent?: boolean)
Parameters
- eventName
-
string
Name of the event to emit.
- eventValue
-
string
Optional. Memory property path to use to get the value to send as part of the event.
- bubbleEvent
-
boolean
Default = false
. Value indicating whether the event should bubble to parents or not.
Property Details
$kind
static $kind: string
Property Value
string
bubbleEvent
A value indicating whether gets or sets whether the event should bubble or not.
bubbleEvent: BoolExpression
Property Value
BoolExpression
disabled
An optional expression which if is true will disable this action.
disabled?: BoolExpression
Property Value
BoolExpression
eventName
The name of the event to emit.
eventName: StringExpression
Property Value
StringExpression
eventValue
The memory property path to use to get the value to send as part of the event.
eventValue: ValueExpression
Property Value
ValueExpression
handledProperty
The property path to store whether the event was handled or not.
handledProperty: StringExpression
Property Value
StringExpression
Inherited Property Details
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
Method Details
beginDialog(DialogContext, O)
Starts a new Dialog and pushes it 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.
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 Method Details
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)
When overridden in a derived class, continues the dialog.
function continueDialog(dc: DialogContext): Promise<DialogTurnResult>
Parameters
- dc
-
DialogContext
The context for the current dialog turn.
Returns
Promise<DialogTurnResult>
A promise resolving to the dialog turn result.
Remarks
Derived dialogs that support multiple-turn conversations should override this method. By default, this method signals that the dialog is complete and returns.
The DialogContext calls this method when it continues the dialog.
To signal to the dialog context that this dialog has completed, await DialogContext.endDialog before exiting this method.
See also
Inherited From Dialog.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
getVersion()
An encoded string used to aid in the detection of bot changes on re-deployment.
function getVersion(): string
Returns
string
Unique string which should only change when dialog has changed in a way that should restart the dialog.
Remarks
This defaults to returning the dialogs id but can be overridden to provide more
precise change detection logic. Any dialog on the stack that has its version change will
result in a versionChanged
event will be raised. If this event is not handled by the bot,
an error will be thrown resulting in the bots error handler logic being run.
Returning an empty string will disable version tracking for the component all together.
Inherited From Dialog.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)
When overridden in a derived class, resumes the dialog after the dialog above it on the stack completes.
function resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>
Parameters
- dc
-
DialogContext
The context for the current dialog turn.
- reason
-
DialogReason
The reason the dialog is resuming. This will typically be DialogReason.endCalled
- result
-
any
Optional. The return value, if any, from the dialog that ended.
Returns
Promise<DialogTurnResult>
A promise resolving to the dialog turn result.
Remarks
Derived dialogs that support multiple-turn conversations should override this method. By default, this method signals that the dialog is complete and returns.
The DialogContext calls this method when it resumes
the dialog. If the previous dialog on the stack returned a value, that value is in the result
parameter.
To start a child dialog, use DialogContext.beginDialog or DialogContext.prompt; however, this dialog will not necessarily be the one that started the child dialog. To signal to the dialog context that this dialog has completed, await DialogContext.endDialog before exiting this method.
See also
Inherited From Dialog.resumeDialog