ActivityPrompt Class
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. prompts. ActivityPrompt
- com.
- com.
public class ActivityPrompt
extends Dialog
Defines the core behavior of a prompt dialog that waits for an activity to be received. This prompt requires a validator be passed in and is useful when waiting for non-message activities like an event to be received.The validator can ignore received activities until the expected activity type is received.
Constructor Summary
| Constructor | Description |
|---|---|
| ActivityPrompt(String dialogId, PromptValidator<Activity> validator) |
Initializes a new instance of the ActivityPrompt class. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
java.util.concurrent.CompletableFuture<Dialog |
beginDialog(DialogContext dc, Object options)
Called when a prompt dialog is pushed onto the dialog stack and is being activated. |
|
java.util.concurrent.CompletableFuture<Dialog |
continueDialog(DialogContext dc)
Called when a prompt dialog is the active dialog and the user replied with a new activity. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options)
When overridden in a derived class, prompts the user for input. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)
When overridden in a derived class, prompts the user for input. |
|
protected
java.util.concurrent.CompletableFuture<Prompt |
onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)
When overridden in a derived class, attempts to recognize the incoming activity. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
repromptDialog(TurnContext turnContext, DialogInstance instance)
Called when a prompt dialog has been requested to re-prompt the user for input. |
|
java.util.concurrent.CompletableFuture<Dialog |
resumeDialog(DialogContext dc, DialogReason reason, Object result)
Called when a prompt dialog resumes being the active dialog on the dialog stack, such as when the previous active dialog on the stack completes. |
Methods inherited from Dialog
Methods inherited from java.lang.Object
Constructor Details
ActivityPrompt
public ActivityPrompt(String dialogId, PromptValidator
Initializes a new instance of the ActivityPrompt class. Called from constructors in derived classes to initialize the ActivityPrompt class.
Parameters:
The value of dialogId must be unique within the
<xref uid="com.microsoft.bot.dialogs.DialogSet" data-throw-if-not-resolved="false" data-raw-source="DialogSet"></xref> or <xref uid="com.microsoft.bot.dialogs.ComponentDialog" data-throw-if-not-resolved="false" data-raw-source="ComponentDialog"></xref> to which the
prompt is added.
Method Details
beginDialog
public CompletableFuture
Called when a prompt dialog is pushed onto the dialog stack and is being activated.
Overrides:
ActivityPrompt.beginDialog(DialogContext dc, Object options)Parameters:
Returns:
If the task is successful, the result indicates whether the prompt is
still active after the turn has been processed by the prompt.
continueDialog
public CompletableFuture
Called when a prompt dialog is the active dialog and the user replied with a new activity.
Overrides:
ActivityPrompt.continueDialog(DialogContext dc)Parameters:
Returns:
If the task is successful, the result indicates whether the dialog is
still active after the turn has been processed by the dialog. The
prompt generally continues to receive the user's replies until it
accepts the user's reply as valid input for the prompt.
onPrompt
protected CompletableFuture
When overridden in a derived class, prompts the user for input.
Parameters:
Returns:
onPrompt
protected CompletableFuture
When overridden in a derived class, prompts the user for input.
Parameters:
Returns:
onRecognize
protected CompletableFuture
When overridden in a derived class, attempts to recognize the incoming activity.
Parameters:
Returns:
If the task is successful, the result describes the result of the
recognition attempt.
repromptDialog
public CompletableFuture
Called when a prompt dialog has been requested to re-prompt the user for input.
Overrides:
ActivityPrompt.repromptDialog(TurnContext turnContext, DialogInstance instance)Parameters:
Returns:
resumeDialog
public CompletableFuture
Called when a prompt dialog resumes being the active dialog on the dialog stack, such as when the previous active dialog on the stack completes.
Overrides:
ActivityPrompt.resumeDialog(DialogContext dc, DialogReason reason, Object result)Parameters:
Returns:
If the task is successful, the result indicates whether the dialog is
still active after the turn has been processed by the dialog.