WaterfallDialog Class
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. WaterfallDialog
- com.
- com.
public class WaterfallDialog
extends Dialog
Dialog optimized for prompting a user with a series of questions. Waterfalls accept a stack of functions which will be executed in sequence. Each waterfall step can ask a question of the user and the user's response will be passed as an argument to the next waterfall step.
Constructor Summary
| Constructor | Description |
|---|---|
| WaterfallDialog(String dialogId, List<WaterfallStep> actions) |
Initializes a new instance of the WaterfallDialog class. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
Waterfall |
addStep(WaterfallStep step)
Adds a new step to the waterfall. |
|
java.util.concurrent.CompletableFuture<Dialog |
beginDialog(DialogContext dc, Object options)
Called when the waterfall dialog is started and pushed onto the dialog stack. |
|
java.util.concurrent.CompletableFuture<Dialog |
continueDialog(DialogContext dc)
Called when the waterfall dialog is _continued_, where it is the active dialog and the user replies with a new activity. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)
Called when the dialog is ending. |
| java.lang.String |
getVersion()
Gets a unique String which represents the version of this dialog. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
onStep(WaterfallStepContext stepContext)
Called when an individual waterfall step is being executed. |
|
java.util.concurrent.CompletableFuture<Dialog |
resumeDialog(DialogContext dc, DialogReason reason, Object result)
Called when a child waterfall dialog completed its turn, returning control to this dialog. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
runStep(DialogContext dc, int index, DialogReason reason, Object result)
Excutes a step of the waterfall dialog. |
Methods inherited from Dialog
Methods inherited from java.lang.Object
Constructor Details
WaterfallDialog
public WaterfallDialog(String dialogId, List
Initializes a new instance of the WaterfallDialog class.
Parameters:
Method Details
addStep
public WaterfallDialog addStep(WaterfallStep step)
Adds a new step to the waterfall.
Parameters:
Returns:
AddStep().beginDialog
public CompletableFuture
Called when the waterfall dialog is started and pushed onto the dialog stack.
Overrides:
WaterfallDialog.beginDialog(DialogContext dc, Object options)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.
continueDialog
public CompletableFuture
Called when the waterfall dialog is _continued_, where it is the active dialog and the user replies with a new activity.
Overrides:
WaterfallDialog.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
result may also contain a return value.
endDialog
public CompletableFuture
Called when the dialog is ending.
Overrides:
WaterfallDialog.endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)Parameters:
Returns:
getVersion
public String 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.
Overrides:
WaterfallDialog.getVersion()Returns:
onStep
protected CompletableFuture
Called when an individual waterfall step is being executed.
Parameters:
Returns:
resumeDialog
public CompletableFuture
Called when a child waterfall dialog completed its turn, returning control to this dialog.
Overrides:
WaterfallDialog.resumeDialog(DialogContext dc, DialogReason reason, Object result)Parameters:
Returns:
runStep
protected CompletableFuture
Excutes a step of the waterfall dialog.
Parameters:
Returns: