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
Un Dialog composé d’autres dialogues. Un dialogue de composant comporte une DialogSet interne et DialogContext , qui fournit une pile de dialogues interne masquée dans le dialogue parent.
Récapitulatif du champ
| Modificateur et type | Champ et description |
|---|---|
| static final java.lang.String |
PERSISTEDDIALOGSTATE
ID de l’état de boîte de dialogue persistant. |
Récapitulatif du constructeur
| Constructeur | Description |
|---|---|
| ComponentDialog(String dialogId) |
Initialise une nouvelle instance de la classe ComponentDialog. |
Résumé de la méthode
| Modificateur et type | Méthode et description |
|---|---|
|
Component |
addDialog(Dialog dialog)
Ajoute une nouvelle Dialog à la boîte de dialogue du composant et retourne le composant mis à jour. |
|
java.util.concurrent.CompletableFuture<Dialog |
beginDialog(DialogContext outerDc, Object options)
Appelé lorsque le dialogue est démarré et envoyé (push) sur la pile de dialogues du parent. |
|
java.util.concurrent.CompletableFuture<Dialog |
continueDialog(DialogContext outerDc)
Appelé lorsque le dialogue est _continue_, où il s’agit du dialogue actif et que l’utilisateur répond avec une nouvelle activité. |
|
Dialog |
createChildContext(DialogContext dc)
Crée un DialogContext interne . |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
endComponent(DialogContext outerDc, Object result)
Termine la boîte de dialogue composant dans le contexte de son parent. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)
Appelé lorsque la boîte de dialogue se termine. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
ensureInitialized(DialogContext outerDc)
Vérifie que la boîte de dialogue est initialisée. |
| java.lang.String |
getInitialDialogId()
Obtient l’ID affecté à la boîte de dialogue initiale. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
onBeginDialog(DialogContext innerDc, Object options)
Appelé lorsque le dialogue est démarré et envoyé (push) sur la pile de dialogues du parent. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
onContinueDialog(DialogContext innerDc)
Appelé lorsque le dialogue est _continue_, où il s’agit du dialogue actif et que l’utilisateur répond avec une nouvelle activité. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onEndDialog(TurnContext context, DialogInstance instance, DialogReason reason)
Appelé lorsque la boîte de dialogue se termine. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onInitialize(DialogContext dc)
Initilise la boîte de dialogue. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onRepromptDialog(TurnContext turnContext, DialogInstance instance)
Appelé lorsque la boîte de dialogue doit inviter à nouveau l’utilisateur à entrer. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
repromptDialog(TurnContext turnContext, DialogInstance instance)
Appelé lorsque la boîte de dialogue doit inviter à nouveau l’utilisateur à entrer. |
|
java.util.concurrent.CompletableFuture<Dialog |
resumeDialog(DialogContext outerDc, DialogReason reason, Object result)
Appelé lorsqu’un dialogue enfant sur la pile de dialogues parent a terminé ce tour, retournant le contrôle à ce composant de dialogue. |
| void |
setInitialDialogId(String withInitialDialogId)
Définit l’ID affecté à la boîte de dialogue initiale. |
Méthodes héritées de Dialog
Méthodes héritées de DialogContainer
Méthodes héritées de java.lang.Object
Détails du champ
PERSISTEDDIALOGSTATE
public static final String PERSISTEDDIALOGSTATE
ID de l’état de boîte de dialogue persistant.
Détails du constructeur
ComponentDialog
public ComponentDialog(String dialogId)
Initialise une nouvelle instance de la classe ComponentDialog.
Paramètres:
Détails de la méthode
addDialog
public ComponentDialog addDialog(Dialog dialog)
Ajoute une nouvelle Dialog à la boîte de dialogue du composant et retourne le composant mis à jour.
Paramètres:
Retours:
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
Appelé lorsque le dialogue est démarré et envoyé (push) sur la pile de dialogues du parent.
Remplacements:
ComponentDialog.beginDialog(DialogContext outerDc, Object options)Paramètres:
Retours:
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
Appelé lorsque le dialogue est _continue_, où il s’agit du dialogue actif et que l’utilisateur répond avec une nouvelle activité.
Remplacements:
ComponentDialog.continueDialog(DialogContext outerDc)Paramètres:
Retours:
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)
Crée un DialogContext interne .
Remplacements:
ComponentDialog.createChildContext(DialogContext dc)Paramètres:
Retours:
endComponent
protected CompletableFuture
Termine la boîte de dialogue composant dans le contexte de son parent.
Paramètres:
Retours:
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
Appelé lorsque la boîte de dialogue se termine.
Remplacements:
ComponentDialog.endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)Paramètres:
Retours:
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
Vérifie que la boîte de dialogue est initialisée.
Paramètres:
Retours:
getInitialDialogId
public String getInitialDialogId()
Obtient l’ID affecté à la boîte de dialogue initiale.
Retours:
onBeginDialog
protected CompletableFuture
Appelé lorsque le dialogue est démarré et envoyé (push) sur la pile de dialogues du parent.
Paramètres:
Retours:
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
Appelé lorsque le dialogue est _continue_, où il s’agit du dialogue actif et que l’utilisateur répond avec une nouvelle activité.
Paramètres:
Retours:
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
Appelé lorsque la boîte de dialogue se termine.
Paramètres:
Retours:
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
Initilise la boîte de dialogue.
Paramètres:
Retours:
onRepromptDialog
protected CompletableFuture
Appelé lorsque la boîte de dialogue doit inviter à nouveau l’utilisateur à entrer.
Paramètres:
Retours:
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
Appelé lorsque la boîte de dialogue doit inviter à nouveau l’utilisateur à entrer.
Remplacements:
ComponentDialog.repromptDialog(TurnContext turnContext, DialogInstance instance)Paramètres:
Retours:
resumeDialog
public CompletableFuture
Appelé lorsqu’un dialogue enfant sur la pile de dialogues parent a terminé ce tour, retournant le contrôle à ce composant de dialogue.
Remplacements:
ComponentDialog.resumeDialog(DialogContext outerDc, DialogReason reason, Object result)Paramètres:
Retours:
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)
Définit l’ID affecté à la boîte de dialogue initiale.
Paramètres: