ActivityPrompt クラス

public class ActivityPrompt
extends Dialog

アクティビティの受信を待機するプロンプト ダイアログの主要な動作を定義します。 このプロンプトは検証コントロールを渡す必要があり、イベントなどのメッセージ以外のアクティビティが受信されるのを待つ場合に便利です。検証コントロールは、期待されるアクティビティの種類が受信されるまで、受信したアクティビティを無視できます。

コンストラクターの概要

コンストラクター 説明
ActivityPrompt(String dialogId, PromptValidator<Activity> validator)

ActivityPrompt クラスの新しいインスタンスを初期化します。

メソッドの概要

修飾子と型 メソッドと説明
java.util.concurrent.CompletableFuture<DialogTurnResult> beginDialog(DialogContext dc, Object options)

プロンプト ダイアログがダイアログ スタックにプッシュされ、アクティブ化されるときに呼び出されます。

java.util.concurrent.CompletableFuture<DialogTurnResult> continueDialog(DialogContext dc)

プロンプト ダイアログがアクティブなダイアログであり、ユーザーが新しいアクティビティで応答したときに呼び出されます。

protected java.util.concurrent.CompletableFuture<java.lang.Void> onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options)

派生クラスでオーバーライドされると、ユーザーに入力を求めます。

protected java.util.concurrent.CompletableFuture<java.lang.Void> onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)

派生クラスでオーバーライドされると、ユーザーに入力を求めます。

protected java.util.concurrent.CompletableFuture<PromptRecognizerResult<Activity>> 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<DialogTurnResult> resumeDialog(DialogContext dc, DialogReason reason, Object result)

以前のアクティブなダイアログが完了したときなど、ダイアログ スタック上のアクティブなダイアログとしてプロンプト ダイアログが再開されたときに呼び出されます。

メソッドの継承元: Dialog

メソッドの継承元: java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

コンストラクターの詳細

ActivityPrompt

public ActivityPrompt(String dialogId, PromptValidator validator)

ActivityPrompt クラスの新しいインスタンスを初期化します。 ActivityPrompt クラスを初期化するために、派生クラスのコンストラクターから呼び出されます。

パラメーター:

dialogId - このプロンプトに割り当てる ID。
validator - このプロンプトの検証を含む PromptValidator<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="DialogSet"></xref> or <xref uid="com.microsoft.bot.dialogs.ComponentDialog" data-throw-if-not-resolved="false" data-raw-source="ComponentDialog"></xref> to which the
              prompt is added.

メソッドの詳細

beginDialog

public CompletableFuture beginDialog(DialogContext dc, Object options)

プロンプト ダイアログがダイアログ スタックにプッシュされ、アクティブ化されるときに呼び出されます。

上書き:

ActivityPrompt.beginDialog(DialogContext dc, Object options)

パラメーター:

dc - 会話の現在のターンのダイアログ コンテキスト。
options - オプション。開始中のプロンプトに渡す追加情報。

戻り値:

非同期操作を表す CompletableFuture
     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 continueDialog(DialogContext dc)

プロンプト ダイアログがアクティブなダイアログであり、ユーザーが新しいアクティビティで応答したときに呼び出されます。

上書き:

ActivityPrompt.continueDialog(DialogContext dc)

パラメーター:

dc - 会話の現在のターンのダイアログ コンテキスト。

戻り値:

非同期操作を表す CompletableFuture
     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.

onPrompt

protected CompletableFuture onPrompt(TurnContext turnContext, Map state, PromptOptions options)

派生クラスでオーバーライドされると、ユーザーに入力を求めます。

パラメーター:

turnContext - ユーザーとの会話の現在のターンのコンテキスト。
state - ダイアログ スタック上のプロンプトの現在のインスタンスの状態を格納します。
options - プロンプト オプション オブジェクトは、prompt(String dialogId, PromptOptions options) の呼び出しで最初に指定されたオプションから作成されます。

戻り値:

非同期操作を表す CompletableFuture

onPrompt

protected CompletableFuture onPrompt(TurnContext turnContext, Map state, PromptOptions options, Boolean isRetry)

派生クラスでオーバーライドされると、ユーザーに入力を求めます。

パラメーター:

turnContext - ユーザーとの会話の現在のターンのコンテキスト。
state - ダイアログ スタック上のプロンプトの現在のインスタンスの状態を格納します。
options - プロンプト オプション オブジェクトは、prompt(String dialogId, PromptOptions options) の呼び出しで最初に指定されたオプションから作成されます。
isRetry - プロンプトが再試行であるかどうかを表す Boolean

戻り値:

非同期操作の結果を表す CompletableFuture

onRecognize

protected CompletableFuture> onRecognize(TurnContext turnContext, Map state, PromptOptions options)

派生クラスでオーバーライドされると、受信アクティビティを認識しようとします。

パラメーター:

turnContext - ユーザーとの会話の現在のターンのコンテキスト。
state - ダイアログ スタック上のプロンプトの現在のインスタンスの状態を格納します。
options - プロンプト オプション オブジェクトは、prompt(String dialogId, PromptOptions options) の呼び出しで最初に指定されたオプションから作成されます。

戻り値:

非同期操作を表す CompletableFuture
     If the task is successful, the result describes the result of the
     recognition attempt.

repromptDialog

public CompletableFuture repromptDialog(TurnContext turnContext, DialogInstance instance)

ユーザーに入力を再度求めるプロンプト ダイアログが要求されたときに呼び出されます。

上書き:

ActivityPrompt.repromptDialog(TurnContext turnContext, DialogInstance instance)

パラメーター:

turnContext - ユーザーとの会話の現在のターンのコンテキスト。
instance - スタック上のダイアログのインスタンス。

戻り値:

非同期操作を表す CompletableFuture

resumeDialog

public CompletableFuture resumeDialog(DialogContext dc, DialogReason reason, Object result)

以前のアクティブなダイアログが完了したときなど、ダイアログ スタック上のアクティブなダイアログとしてプロンプト ダイアログが再開されたときに呼び出されます。

上書き:

ActivityPrompt.resumeDialog(DialogContext dc, DialogReason reason, Object result)

パラメーター:

dc - 会話の現在のターンのダイアログ コンテキスト。
reason - ダイアログが再開された理由を示す列挙型。
result - 省略可能。スタック上の前のダイアログから返された値。 返される値の型は、前のダイアログに依存します。

戻り値:

非同期操作を表す CompletableFuture
     If the task is successful, the result indicates whether the dialog is
     still active after the turn has been processed by the dialog.

適用対象