ComponentDialog Klasse
- 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
Eine Dialog, die aus anderen Dialogfeldern besteht. Ein Komponentendialogfeld verfügt über eine innere DialogSet und DialogContext, die einen inneren Dialogstapel bereitstellt, der im übergeordneten Dialogfeld ausgeblendet ist.
Feldzusammenfassung
| Modifizierer und Typ | Feld und Beschreibung |
|---|---|
| static final java.lang.String |
PERSISTEDDIALOGSTATE
Die ID für den permanenten Dialogfeldstatus. |
Zusammenfassung zum Konstruktor
| Konstruktor | Beschreibung |
|---|---|
| ComponentDialog(String dialogId) |
Initialisiert eine neue Instanz der ComponentDialog Klasse. |
Methodenzusammenfassung
| Modifizierer und Typ | Methode und Beschreibung |
|---|---|
|
Component |
addDialog(Dialog dialog)
Fügt dem Komponentendialogfeld eine neue Dialog hinzu und gibt die aktualisierte Komponente zurück. |
|
java.util.concurrent.CompletableFuture<Dialog |
beginDialog(DialogContext outerDc, Object options)
Wird aufgerufen, wenn das Dialogfeld gestartet und auf den Dialogstapel des übergeordneten Elements verschoben wird. |
|
java.util.concurrent.CompletableFuture<Dialog |
continueDialog(DialogContext outerDc)
Wird aufgerufen, wenn das Dialogfeld _fortsetzung_ ist, wobei es sich um das aktive Dialogfeld handelt und der Benutzer mit einer neuen Aktivität antwortet. |
|
Dialog |
createChildContext(DialogContext dc)
Erstellt eine innere DialogContext . |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
endComponent(DialogContext outerDc, Object result)
Beendet das Komponentendialogfeld im Kontext des übergeordneten Elements. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)
Wird aufgerufen, wenn das Dialogfeld beendet wird. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
ensureInitialized(DialogContext outerDc)
Stellt sicher, dass das Dialogfeld initialisiert wird. |
| java.lang.String |
getInitialDialogId()
Ruft die ID ab, die dem anfänglichen Dialogfeld zugewiesen ist. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
onBeginDialog(DialogContext innerDc, Object options)
Wird aufgerufen, wenn das Dialogfeld gestartet und auf den Dialogstapel des übergeordneten Elements verschoben wird. |
|
protected
java.util.concurrent.CompletableFuture<Dialog |
onContinueDialog(DialogContext innerDc)
Wird aufgerufen, wenn das Dialogfeld _fortsetzung_ ist, wobei es sich um das aktive Dialogfeld handelt und der Benutzer mit einer neuen Aktivität antwortet. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onEndDialog(TurnContext context, DialogInstance instance, DialogReason reason)
Wird aufgerufen, wenn das Dialogfeld beendet wird. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onInitialize(DialogContext dc)
Initiliziert das Dialogfeld. |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onRepromptDialog(TurnContext turnContext, DialogInstance instance)
Wird aufgerufen, wenn das Dialogfeld den Benutzer zur Eingabe erneut auffordert. |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
repromptDialog(TurnContext turnContext, DialogInstance instance)
Wird aufgerufen, wenn das Dialogfeld den Benutzer zur Eingabe erneut auffordert. |
|
java.util.concurrent.CompletableFuture<Dialog |
resumeDialog(DialogContext outerDc, DialogReason reason, Object result)
Wird aufgerufen, wenn ein untergeordnetes Dialogfeld im Dialogstapel des übergeordneten Elements diese Drehung abgeschlossen hat und dieses Steuerelement an diese Dialogfeldkomponente zurückgibt. |
| void |
setInitialDialogId(String withInitialDialogId)
Legt die ID fest, die dem anfänglichen Dialogfeld zugewiesen ist. |
Geerbte Methoden von Dialog
Geerbte Methoden von DialogContainer
Geerbte Methoden von java.lang.Object
Felddetails
PERSISTEDDIALOGSTATE
public static final String PERSISTEDDIALOGSTATE
Die ID für den permanenten Dialogfeldstatus.
Details zum Konstruktor
ComponentDialog
public ComponentDialog(String dialogId)
Initialisiert eine neue Instanz der ComponentDialog Klasse.
Parameter:
Details zur Methode
addDialog
public ComponentDialog addDialog(Dialog dialog)
Fügt dem Komponentendialogfeld eine neue Dialog hinzu und gibt die aktualisierte Komponente zurück.
Parameter:
Gibt zurück:
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
Wird aufgerufen, wenn das Dialogfeld gestartet und auf den Dialogstapel des übergeordneten Elements verschoben wird.
Überschreibt:
ComponentDialog.beginDialog(DialogContext outerDc, Object options)Parameter:
Gibt zurück:
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
Wird aufgerufen, wenn das Dialogfeld _fortsetzung_ ist, wobei es sich um das aktive Dialogfeld handelt und der Benutzer mit einer neuen Aktivität antwortet.
Überschreibt:
ComponentDialog.continueDialog(DialogContext outerDc)Parameter:
Gibt zurück:
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)
Erstellt eine innere DialogContext .
Überschreibt:
ComponentDialog.createChildContext(DialogContext dc)Parameter:
Gibt zurück:
endComponent
protected CompletableFuture
Beendet das Komponentendialogfeld im Kontext des übergeordneten Elements.
Parameter:
Gibt zurück:
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
Wird aufgerufen, wenn das Dialogfeld beendet wird.
Überschreibt:
ComponentDialog.endDialog(TurnContext turnContext, DialogInstance instance, DialogReason reason)Parameter:
Gibt zurück:
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
Stellt sicher, dass das Dialogfeld initialisiert wird.
Parameter:
Gibt zurück:
getInitialDialogId
public String getInitialDialogId()
Ruft die ID ab, die dem anfänglichen Dialogfeld zugewiesen ist.
Gibt zurück:
onBeginDialog
protected CompletableFuture
Wird aufgerufen, wenn das Dialogfeld gestartet und auf den Dialogstapel des übergeordneten Elements verschoben wird.
Parameter:
Gibt zurück:
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
Wird aufgerufen, wenn das Dialogfeld _fortsetzung_ ist, wobei es sich um das aktive Dialogfeld handelt und der Benutzer mit einer neuen Aktivität antwortet.
Parameter:
Gibt zurück:
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
Wird aufgerufen, wenn das Dialogfeld beendet wird.
Parameter:
Gibt zurück:
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
Initiliziert das Dialogfeld.
Parameter:
Gibt zurück:
onRepromptDialog
protected CompletableFuture
Wird aufgerufen, wenn das Dialogfeld den Benutzer zur Eingabe erneut auffordert.
Parameter:
Gibt zurück:
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
Wird aufgerufen, wenn das Dialogfeld den Benutzer zur Eingabe erneut auffordert.
Überschreibt:
ComponentDialog.repromptDialog(TurnContext turnContext, DialogInstance instance)Parameter:
Gibt zurück:
resumeDialog
public CompletableFuture
Wird aufgerufen, wenn ein untergeordnetes Dialogfeld im Dialogstapel des übergeordneten Elements diese Drehung abgeschlossen hat und dieses Steuerelement an diese Dialogfeldkomponente zurückgibt.
Überschreibt:
ComponentDialog.resumeDialog(DialogContext outerDc, DialogReason reason, Object result)Parameter:
Gibt zurück:
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)
Legt die ID fest, die dem anfänglichen Dialogfeld zugewiesen ist.
Parameter: