ComponentDialog Classe
- 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
Um Dialog composto por outros diálogos. Uma caixa de diálogo de componente tem uma DialogSet interna e DialogContext , que fornece uma pilha de diálogo interna oculta da caixa de diálogo pai.
Resumo do campo
| Modificador e tipo | Campo e descrição |
|---|---|
| static final java.lang.String |
PERSISTEDDIALOGSTATE
A ID do estado da caixa de diálogo persistente. |
Resumo do Construtor
| Construtor | Description |
|---|---|
| ComponentDialog(String dialogId) |
Inicializa uma nova instância da classe ComponentDialog. |
Resumo do método
| Modificador e tipo | Método e descrição |
|---|---|
|
Component |
addDialog(Dialog dialog)
Adiciona um novo Dialog à caixa de diálogo do componente e retorna o componente atualizado. |
|
java.util.concurrent.CompletableFuture<Dialog |
beginDialog(DialogContext outerDc, Object options)
Chamado quando a caixa de diálogo é iniciada e enviada por push para a pilha de diálogo do pai. |
|
java.util.concurrent.CompletableFuture<Dialog |
continueDialog(DialogContext outerDc)
Chamado quando a caixa de diálogo é _continued_, onde é a caixa de diálogo ativa e o usuário responde com uma nova atividade. |
|
Dialog |
createChildContext(DialogContext dc)
Cria um DialogContext interno. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
endComponent(DialogContext outerDc, Object result)
Termina a caixa de diálogo do componente no contexto do pai. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)
Chamado quando a caixa de diálogo está terminando. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
ensureInitialized(DialogContext outerDc)
Garante que a caixa de diálogo seja inicializada. |
| java.lang.String |
getInitialDialogId()
Obtém a ID atribuída à caixa de diálogo inicial. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
onBeginDialog(DialogContext innerDc, Object options)
Chamado quando a caixa de diálogo é iniciada e enviada por push para a pilha de diálogo do pai. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
onContinueDialog(DialogContext innerDc)
Chamado quando a caixa de diálogo é _continued_, onde é a caixa de diálogo ativa e o usuário responde com uma nova atividade. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onEndDialog(TurnContext context, DialogInstance instance, DialogReason reason)
Chamado quando a caixa de diálogo está terminando. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onInitialize(DialogContext dc)
Initiliza a caixa de diálogo. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onRepromptDialog(TurnContext turnContext, DialogInstance instance)
Chamado quando a caixa de diálogo deve solicitar novamente entrada ao usuário. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
repromptDialog(TurnContext turnContext, DialogInstance instance)
Chamado quando a caixa de diálogo deve solicitar novamente entrada ao usuário. |
|
java.util.concurrent.CompletableFuture<Dialog |
resumeDialog(DialogContext outerDc, DialogReason reason, Object result)
Chamado quando uma caixa de diálogo filho na pilha de diálogo do pai concluiu essa curva, retornando o controle para esse componente de caixa de diálogo. |
| void |
setInitialDialogId(String withInitialDialogId)
Define a ID atribuída à caixa de diálogo inicial. |
Métodos herdados de Dialog
Métodos herdados de DialogContainer
Métodos herdados de java.lang.Object
Detalhes do campo
PERSISTEDDIALOGSTATE
public static final String PERSISTEDDIALOGSTATE
A ID do estado da caixa de diálogo persistente.
Detalhes do construtor
ComponentDialog
public ComponentDialog(String dialogId)
Inicializa uma nova instância da classe ComponentDialog.
Parâmetros:
Detalhes do método
addDialog
public ComponentDialog addDialog(Dialog dialog)
Adiciona um novo Dialog à caixa de diálogo do componente e retorna o componente atualizado.
Parâmetros:
Retornos:
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
Chamado quando a caixa de diálogo é iniciada e enviada por push para a pilha de diálogo do pai.
Substituições:
ComponentDialog.beginDialog(DialogContext outerDc, Object options)Parâmetros:
Retornos:
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
Chamado quando a caixa de diálogo é _continued_, onde é a caixa de diálogo ativa e o usuário responde com uma nova atividade.
Substituições:
ComponentDialog.continueDialog(DialogContext outerDc)Parâmetros:
Retornos:
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)
Cria um DialogContext interno.
Substituições:
ComponentDialog.createChildContext(DialogContext dc)Parâmetros:
Retornos:
endComponent
protected CompletableFuture
Termina a caixa de diálogo do componente no contexto do pai.
Parâmetros:
Retornos:
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
Chamado quando a caixa de diálogo está terminando.
Substituições:
ComponentDialog.endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)Parâmetros:
Retornos:
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
Garante que a caixa de diálogo seja inicializada.
Parâmetros:
Retornos:
getInitialDialogId
public String getInitialDialogId()
Obtém a ID atribuída à caixa de diálogo inicial.
Retornos:
onBeginDialog
protected CompletableFuture
Chamado quando a caixa de diálogo é iniciada e enviada por push para a pilha de diálogo do pai.
Parâmetros:
Retornos:
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
Chamado quando a caixa de diálogo é _continued_, onde é a caixa de diálogo ativa e o usuário responde com uma nova atividade.
Parâmetros:
Retornos:
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
Chamado quando a caixa de diálogo está terminando.
Parâmetros:
Retornos:
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
Initiliza a caixa de diálogo.
Parâmetros:
Retornos:
onRepromptDialog
protected CompletableFuture
Chamado quando a caixa de diálogo deve solicitar novamente entrada ao usuário.
Parâmetros:
Retornos:
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
Chamado quando a caixa de diálogo deve solicitar novamente entrada ao usuário.
Substituições:
ComponentDialog.repromptDialog(TurnContext turnContext, DialogInstance instance)Parâmetros:
Retornos:
resumeDialog
public CompletableFuture
Chamado quando uma caixa de diálogo filho na pilha de diálogo do pai concluiu essa curva, retornando o controle para esse componente de caixa de diálogo.
Substituições:
ComponentDialog.resumeDialog(DialogContext outerDc, DialogReason reason, Object result)Parâmetros:
Retornos:
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)
Define a ID atribuída à caixa de diálogo inicial.
Parâmetros: