DialogContainer Class
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. DialogContainer
- com.
- com.
public abstract class DialogContainer
extends Dialog
A container for a set of Dialogs.
Constructor Summary
| Constructor | Description |
|---|---|
| DialogContainer() |
Creates a new instance with the default dialog id. |
| DialogContainer(String dialogId) |
Creates a new instance with the default dialog id. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
checkForVersionChange(DialogContext dc)
Checks to see if a containers child dialogs have changed since the current dialog instance was started. |
|
abstract
Dialog |
createChildContext(DialogContext dc)
Creates an inner dialog context for the containers active child. |
| Dialog |
findDialog(String dialogId)
Searches the current Dialog |
|
Dialog |
getDialogs()
Returns the Dialogs as a Dialog |
| protected java.lang.String |
getInternalVersion()
Returns internal version identifier for this container. |
| java.util.concurrent.CompletableFuture<java.lang.Boolean> |
onDialogEvent(DialogContext dc, DialogEvent e)
Called when an event has been raised, using `Dialog |
| void |
setTelemetryClient(BotTelemetryClient withTelemetryClient)
Sets the Bot |
Methods inherited from Dialog
Methods inherited from java.lang.Object
Constructor Details
DialogContainer
public DialogContainer()
Creates a new instance with the default dialog id.
DialogContainer
public DialogContainer(String dialogId)
Creates a new instance with the default dialog id.
Parameters:
Method Details
checkForVersionChange
protected CompletableFuture
Checks to see if a containers child dialogs have changed since the current dialog instance was started. This should be called at the start of `beginDialog()`, `continueDialog()`, and `resumeDialog()`.
Parameters:
Returns:
createChildContext
public abstract DialogContext createChildContext(DialogContext dc)
Creates an inner dialog context for the containers active child.
Parameters:
Returns:
findDialog
public Dialog findDialog(String dialogId)
Searches the current DialogSet for a Dialog by its ID.
Parameters:
Returns:
getDialogs
public DialogSet getDialogs()
Returns the Dialogs as a DialogSet.
Returns:
getInternalVersion
protected String getInternalVersion()
Returns internal version identifier for this container.
DialogContainers detect changes of all sub-components in the container and map that to an DialogChanged event. Because they do this, DialogContainers "hide" the internal changes and just have the .id. This isolates changes to the container level unless a container doesn't handle it. To support this DialogContainers define a protected virtual method getInternalVersion() which computes if this dialog or child dialogs have changed which is then examined via calls to checkForVersionChange().
Returns:
onDialogEvent
public CompletableFuture
Called when an event has been raised, using `DialogContext.emitEvent()`, by either the current dialog or a dialog that the current dialog started.
This override will trace version changes.
Overrides:
DialogContainer.onDialogEvent(DialogContext dc, DialogEvent e)Parameters:
Returns:
setTelemetryClient
public void setTelemetryClient(BotTelemetryClient withTelemetryClient)
Sets the BotTelemetryClient to use for logging. When setting this property, all of the contained dialogs' BotTelemetryClient properties are also set.
Overrides:
DialogContainer.setTelemetryClient(BotTelemetryClient withTelemetryClient)Parameters: