Prompt<T> クラス
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. prompts. Prompt<T>
- com.
- com.
型パラメーター
- T
プロンプトの作成対象を入力します。
public abstract class Prompt
extends Dialog
プロンプト ダイアログの主要な動作を定義します。 プロンプトが終了すると、プロンプトが表示された値を表すオブジェクトが返されます。 ダイアログ セットまたはコンポーネント ダイアログにプロンプトを追加するには、add(Dialog dialog) または addDialog(Dialog dialog) を使用します。 prompt(String dialogId, PromptOptions options) または beginDialog(String dialogId, Object options) を使用してプロンプトを開始します。 WaterfallDialogの WaterfallStep からプロンプトを開始すると、ウォーターフォールの次の手順でプロンプトの結果を使用できるようになります。
フィールドの概要
| 修飾子と型 | フィールドと説明 |
|---|---|
| static final java.lang.String | ATTEMPTCOUNTKEY |
コンストラクターの概要
| コンストラクター | 説明 |
|---|---|
| Prompt(String dialogId, PromptValidator<T> validator) |
{@link Prompt{T}} クラスの新しいインスタンスを初期化します。 |
メソッドの概要
| 修飾子と型 | メソッドと説明 |
|---|---|
| protected Activity |
appendChoices(Activity prompt, String channelId, List<Choice> choices, ListStyle style, ChoiceFactoryOptions options)
派生クラスでオーバーライドされると、ユーザーが入力を求められたときにアクティビティに選択肢を追加します。 |
|
java.util.concurrent.CompletableFuture<Dialog |
beginDialog(DialogContext dc, Object options)
プロンプト ダイアログがダイアログ スタックにプッシュされ、アクティブ化されるときに呼び出されます。 |
|
java.util.concurrent.CompletableFuture<Dialog |
continueDialog(DialogContext dc)
プロンプト ダイアログがアクティブなダイアログであり、ユーザーが新しいアクティビティで応答したときに呼び出されます。 |
| protected java.util.concurrent.CompletableFuture<java.lang.Boolean> |
onPreBubbleEvent(DialogContext dc, DialogEvent e)
イベントが親にバブルされる前に呼び出されます。 |
| protected abstract java.util.concurrent.CompletableFuture<java.lang.Void> |
onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)
派生クラスでオーバーライドされると、ユーザーに入力を求めます。 |
|
protected abstract
java.util.concurrent.CompletableFuture<Prompt |
onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)
派生クラスでオーバーライドされると、ユーザーの入力を認識しようとします。 |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
repromptDialog(TurnContext turnContext, DialogInstance instance)
ユーザーに入力を再度求めるプロンプト ダイアログが要求されたときに呼び出されます。 |
|
java.util.concurrent.CompletableFuture<Dialog |
resumeDialog(DialogContext dc, DialogReason reason, Object result)
以前のアクティブなダイアログが完了したときなど、ダイアログ スタック上のアクティブなダイアログとしてプロンプト ダイアログが再開されたときに呼び出されます。 |
メソッドの継承元: Dialog
メソッドの継承元: java.lang.Object
フィールドの詳細
ATTEMPTCOUNTKEY
public static final String ATTEMPTCOUNTKEY
コンストラクターの詳細
Prompt
public Prompt(String dialogId, PromptValidator
{@link Prompt{T}} クラスの新しいインスタンスを初期化します。 {@link Prompt{T}} クラスを初期化するために、派生クラスのコンストラクターから呼び出されます。
パラメーター:
The value of dialogId must be unique within the
<xref uid="com.microsoft.bot.dialogs.DialogSet" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.bot.dialogs.DialogSet"></xref> or
<xref uid="com.microsoft.bot.dialogs.ComponentDialog" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.bot.dialogs.ComponentDialog"></xref> to which
the prompt is added.
メソッドの詳細
appendChoices
protected Activity appendChoices(Activity prompt, String channelId, List
派生クラスでオーバーライドされると、ユーザーが入力を求められたときにアクティビティに選択肢を追加します。
パラメーター:
戻り値:
If the task is successful, the result contains the updated activity.
beginDialog
public CompletableFuture
プロンプト ダイアログがダイアログ スタックにプッシュされ、アクティブ化されるときに呼び出されます。
上書き:
Prompt<T>.beginDialog(DialogContext dc, Object options)パラメーター:
戻り値:
If the task is successful, the result indicates whether the prompt is
still active after the turn has been processed by the prompt.
continueDialog
public CompletableFuture
プロンプト ダイアログがアクティブなダイアログであり、ユーザーが新しいアクティビティで応答したときに呼び出されます。
上書き:
Prompt<T>.continueDialog(DialogContext dc)パラメーター:
戻り値:
If the task is successful, the result indicates whether the dialog is
still active after the turn has been processed by the dialog. The
prompt generally continues to receive the user's replies until it
accepts the user's reply as valid input for the prompt.
onPreBubbleEvent
protected CompletableFuture
イベントが親にバブルされる前に呼び出されます。 これは、イベントのインターセプトを実行するのに適しています。'true' を返すと、ダイアログの親にイベントがさらにバブルするのを防ぎ、子ダイアログが既定の処理を実行することもできなくなります。
上書き:
Prompt<T>.onPreBubbleEvent(DialogContext dc, DialogEvent e)パラメーター:
戻り値:
onPrompt
protected abstract CompletableFuture
派生クラスでオーバーライドされると、ユーザーに入力を求めます。
パラメーター:
戻り値:
onRecognize
protected abstract CompletableFuture
派生クラスでオーバーライドされると、ユーザーの入力を認識しようとします。
パラメーター:
戻り値:
If the task is successful, the result describes the result of the
recognition attempt.
repromptDialog
public CompletableFuture
ユーザーに入力を再度求めるプロンプト ダイアログが要求されたときに呼び出されます。
上書き:
Prompt<T>.repromptDialog(TurnContext turnContext, DialogInstance instance)パラメーター:
戻り値:
resumeDialog
public CompletableFuture
以前のアクティブなダイアログが完了したときなど、ダイアログ スタック上のアクティブなダイアログとしてプロンプト ダイアログが再開されたときに呼び出されます。
上書き:
Prompt<T>.resumeDialog(DialogContext dc, DialogReason reason, Object result)パラメーター:
戻り値:
If the task is successful, the result indicates whether the dialog is
still active after the turn has been processed by the dialog.