ComponentDialog Класс
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. DialogContainer - com.
microsoft. bot. dialogs. ComponentDialog
- com.
- com.
- com.
public class ComponentDialog
extends DialogContainer
Dialog, состоящий из других диалогов. Диалоговое окно компонента содержит внутреннюю DialogSet и DialogContext, которая предоставляет внутренний стек диалогов, скрытый из родительского диалогового окна.
Сводка по полю
| Модификатор и тип | Поле и описание |
|---|---|
| static final java.lang.String |
PERSISTEDDIALOGSTATE
Идентификатор сохраняемого диалогового окна. |
Сводка по конструктору
| Конструктор | Описание |
|---|---|
| ComponentDialog(String dialogId) |
Инициализирует новый экземпляр класса ComponentDialog. |
Сводка по методу
| Модификатор и тип | Метод и описание |
|---|---|
|
Component |
addDialog(Dialog dialog)
Добавляет новый Dialog в диалоговое окно компонента и возвращает обновленный компонент. |
|
java.util.concurrent.CompletableFuture<Dialog |
beginDialog(DialogContext outerDc, Object options)
Вызывается при запуске диалогового окна и отправке в стек диалоговых окон родительского элемента. |
|
java.util.concurrent.CompletableFuture<Dialog |
continueDialog(DialogContext outerDc)
Вызывается при выполнении диалогового окна _continued_, где он является активным диалогом, а пользователь отвечает с новым действием. |
|
Dialog |
createChildContext(DialogContext dc)
Создает внутреннюю DialogContext. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
endComponent(DialogContext outerDc, Object result)
Заканчивает диалоговое окно компонента в контексте родительского элемента. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)
Вызывается, когда диалоговое окно заканчивается. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
ensureInitialized(DialogContext outerDc)
Гарантирует, что диалоговое окно инициализировано. |
| java.lang.String |
getInitialDialogId()
Возвращает идентификатор, назначенный начальному диалогу. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
onBeginDialog(DialogContext innerDc, Object options)
Вызывается при запуске диалогового окна и отправке в стек диалоговых окон родительского элемента. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
onContinueDialog(DialogContext innerDc)
Вызывается при выполнении диалогового окна _continued_, где он является активным диалогом, а пользователь отвечает с новым действием. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onEndDialog(TurnContext context, DialogInstance instance, DialogReason reason)
Вызывается, когда диалоговое окно заканчивается. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onInitialize(DialogContext dc)
Инициализирует диалоговое окно. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onRepromptDialog(TurnContext turnContext, DialogInstance instance)
Вызывается, когда диалоговое окно должно повторно запрашивать ввод пользователем. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
repromptDialog(TurnContext turnContext, DialogInstance instance)
Вызывается, когда диалоговое окно должно повторно запрашивать ввод пользователем. |
|
java.util.concurrent.CompletableFuture<Dialog |
resumeDialog(DialogContext outerDc, DialogReason reason, Object result)
Вызывается, когда дочерний диалог в стеке диалоговых окон родительского элемента завершился этот поворот, возвращая элемент управления этому компоненту диалогового окна. |
| void |
setInitialDialogId(String withInitialDialogId)
Задает идентификатор, назначенный начальному диалогу. |
Методы, унаследованные от Dialog
Методы, унаследованные от DialogContainer
Методы, унаследованные от java.lang.Object
Сведения о полях
PERSISTEDDIALOGSTATE
public static final String PERSISTEDDIALOGSTATE
Идентификатор сохраняемого диалогового окна.
Сведения о конструкторе
ComponentDialog
public ComponentDialog(String dialogId)
Инициализирует новый экземпляр класса ComponentDialog.
Параметры:
Сведения о методе
addDialog
public ComponentDialog addDialog(Dialog dialog)
Добавляет новый Dialog в диалоговое окно компонента и возвращает обновленный компонент.
Параметры:
Возвращаемое значение:
The added dialog's <xref uid="com.microsoft.bot.dialogs.Dialog.telemetryClient" data-throw-if-not-resolved="false" data-raw-source="Dialog#telemetryClient"></xref> is set to the
<xref uid="com.microsoft.bot.dialogs.DialogContainer.telemetryClient" data-throw-if-not-resolved="false" data-raw-source="DialogContainer#telemetryClient"></xref> of the component dialog.
beginDialog
public CompletableFuture
Вызывается при запуске диалогового окна и отправке в стек диалоговых окон родительского элемента.
Переопределения:
ComponentDialog.beginDialog(DialogContext outerDc, Object options)Параметры:
Возвращаемое значение:
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
Вызывается при выполнении диалогового окна _continued_, где он является активным диалогом, а пользователь отвечает с новым действием.
Переопределения:
ComponentDialog.continueDialog(DialogContext outerDc)Параметры:
Возвращаемое значение:
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. If this method is *not*
overridden, the component dialog calls the
<xref uid="com.microsoft.bot.dialogs.DialogContext.continueDialog*" data-throw-if-not-resolved="false" data-raw-source="DialogContext#continueDialog(CancellationToken)"></xref> method on its
inner dialog context. If the inner dialog stack is empty, the
component dialog ends, and if a <xref uid="com.microsoft.bot.dialogs.DialogTurnResult.result" data-throw-if-not-resolved="false" data-raw-source="DialogTurnResult#result"></xref> is
available, the component dialog uses that as its return value.
createChildContext
public DialogContext createChildContext(DialogContext dc)
Создает внутреннюю DialogContext.
Переопределения:
ComponentDialog.createChildContext(DialogContext dc)Параметры:
Возвращаемое значение:
endComponent
protected CompletableFuture
Заканчивает диалоговое окно компонента в контексте родительского элемента.
Параметры:
Возвращаемое значение:
If the task is successful, the result indicates that the dialog ended
after the turn was processed by the dialog. In general, the parent
context is the dialog or bot turn handler that started the dialog. If
the parent is a dialog, the stack calls the parent's
<xref uid="com.microsoft.bot.dialogs.Dialog.resumeDialog(com.microsoft.bot.dialogs.DialogContext,com.microsoft.bot.dialogs.DialogReason,java.lang.Object)" data-throw-if-not-resolved="false" data-raw-source="Dialog#resumeDialog(DialogContext, DialogReason, Object)"></xref>
method to return a result to the parent dialog. If the parent dialog
does not implement `ResumeDialog`, then the parent will end, too, and
the result is passed to the next parent context, if one exists. The
returned <xref uid="com.microsoft.bot.dialogs.DialogTurnResult" data-throw-if-not-resolved="false" data-raw-source="DialogTurnResult"></xref> contains the return value in its
<xref uid="com.microsoft.bot.dialogs.DialogTurnResult.result" data-throw-if-not-resolved="false" data-raw-source="DialogTurnResult#result"></xref> property.
endDialog
public CompletableFuture
Вызывается, когда диалоговое окно заканчивается.
Переопределения:
ComponentDialog.endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)Параметры:
Возвращаемое значение:
When this method is called from the parent dialog's context, the
component dialog cancels all of the dialogs on its inner dialog stack
before ending.
ensureInitialized
protected CompletableFuture
Гарантирует, что диалоговое окно инициализировано.
Параметры:
Возвращаемое значение:
getInitialDialogId
public String getInitialDialogId()
Возвращает идентификатор, назначенный начальному диалогу.
Возвращаемое значение:
onBeginDialog
protected CompletableFuture
Вызывается при запуске диалогового окна и отправке в стек диалоговых окон родительского элемента.
Параметры:
Возвращаемое значение:
If the task is successful, the result indicates whether the dialog is
still active after the turn has been processed by the dialog. By
default, this calls the
<xref uid="com.microsoft.bot.dialogs.Dialog.beginDialog(com.microsoft.bot.dialogs.DialogContext,java.lang.Object)" data-throw-if-not-resolved="false" data-raw-source="Dialog#beginDialog(DialogContext, Object)"></xref> method of the
component dialog's initial dialog, as defined by
InitialDialogId . Override this method in a derived class to
implement interrupt logic.
onContinueDialog
protected CompletableFuture
Вызывается при выполнении диалогового окна _continued_, где он является активным диалогом, а пользователь отвечает с новым действием.
Параметры:
Возвращаемое значение:
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. By default, this calls the
currently active inner dialog's
<xref uid="com.microsoft.bot.dialogs.Dialog.continueDialog(com.microsoft.bot.dialogs.DialogContext)" data-throw-if-not-resolved="false" data-raw-source="Dialog#continueDialog(DialogContext)"></xref> method. Override this
method in a derived class to implement interrupt logic.
onEndDialog
protected CompletableFuture
Вызывается, когда диалоговое окно заканчивается.
Параметры:
Возвращаемое значение:
Override this method in a derived class to implement any additional
logic that should happen at the component level, after all inner
dialogs have been canceled.
onInitialize
protected CompletableFuture
Инициализирует диалоговое окно.
Параметры:
Возвращаемое значение:
onRepromptDialog
protected CompletableFuture
Вызывается, когда диалоговое окно должно повторно запрашивать ввод пользователем.
Параметры:
Возвращаемое значение:
Override this method in a derived class to implement any additional
logic that should happen at the component level, after the re-prompt
operation completes for the inner dialog.
repromptDialog
public CompletableFuture
Вызывается, когда диалоговое окно должно повторно запрашивать ввод пользователем.
Переопределения:
ComponentDialog.repromptDialog(TurnContext turnContext, DialogInstance instance)Параметры:
Возвращаемое значение:
resumeDialog
public CompletableFuture
Вызывается, когда дочерний диалог в стеке диалоговых окон родительского элемента завершился этот поворот, возвращая элемент управления этому компоненту диалогового окна.
Переопределения:
ComponentDialog.resumeDialog(DialogContext outerDc, DialogReason reason, Object result)Параметры:
Возвращаемое значение:
If the task is successful, the result indicates whether this dialog
is still active after this dialog turn has been processed. Generally,
the child dialog was started with a call to
BeginDialog(DialogContext, Object) in the parent's context.
However, if the <xref uid="com.microsoft.bot.dialogs.DialogContext.replaceDialog(java.lang.String,java.lang.Object)" data-throw-if-not-resolved="false" data-raw-source="DialogContext#replaceDialog(String, Object)"></xref>
method is called, the logical child dialog may be different than the
original. If this method is *not* overridden, the dialog
automatically calls its RepromptDialog(TurnContext,
DialogInstance) when the user replies.
setInitialDialogId
public void setInitialDialogId(String withInitialDialogId)
Задает идентификатор, назначенный начальному диалогу.
Параметры: