DialogManager Class

  • java.lang.Object
    • com.microsoft.bot.dialogs.DialogManager

public class DialogManager

Class which runs the dialog system.

Constructor Summary

Constructor Description
DialogManager(Dialog rootDialog, String dialogStateProperty)

Initializes a new instance of the DialogManager class.

Method Summary

Modifier and Type Method and Description
ConversationState getConversationState()

Gets the ConversationState.

DialogSet getDialogs()

Returns the DialogSet.

java.lang.Integer getExpireAfter()

Gets the (optinal) number of milliseconds to expire the bot's state after.

TurnContextStateCollection getInitialTurnState()

Gets InitialTurnState collection to copy into the TurnState on every turn.

Dialog getRootDialog()

Gets the Root Dialog.

DialogStateManagerConfiguration getStateManagerConfiguration()

Gets the DialogStateManagerConfiguration.

UserState getUserState()

Gets the UserState.

java.util.concurrent.CompletableFuture<DialogManagerResult> onTurn(TurnContext context)

Runs dialog system in the context of an ITurnContext.

void setConversationState(ConversationState withConversationState)

Sets the ConversationState.

void setDialogs(DialogSet withDialogSet)

Set the DialogSet.

void setExpireAfter(Integer withExpireAfter)

Sets the (optional) number of milliseconds to expire the bot's state after.

void setRootDialog(Dialog dialog)

Sets root dialog to use to start conversation.

void setStateManagerConfiguration(DialogStateManagerConfiguration withStateManagerConfiguration)

Sets the DialogStateManagerConfiguration.

void setUserState(UserState userState)

Sets the UserState.

Methods inherited from 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

Constructor Details

DialogManager

public DialogManager(Dialog rootDialog, String dialogStateProperty)

Initializes a new instance of the DialogManager class.

Parameters:

rootDialog - Root dialog to use.
dialogStateProperty - Alternate name for the dialogState property. (Default is "DialogState").

Method Details

getConversationState

public ConversationState getConversationState()

Gets the ConversationState.

Returns:

The ConversationState.

getDialogs

public DialogSet getDialogs()

Returns the DialogSet.

Returns:

The DialogSet.

getExpireAfter

public Integer getExpireAfter()

Gets the (optinal) number of milliseconds to expire the bot's state after.

Returns:

Number of milliseconds.

getInitialTurnState

public TurnContextStateCollection getInitialTurnState()

Gets InitialTurnState collection to copy into the TurnState on every turn.

Returns:

TurnState.

getRootDialog

public Dialog getRootDialog()

Gets the Root Dialog.

Returns:

the Root Dialog.

getStateManagerConfiguration

public DialogStateManagerConfiguration getStateManagerConfiguration()

Gets the DialogStateManagerConfiguration.

Returns:

The DialogStateManagerConfiguration.

getUserState

public UserState getUserState()

Gets the UserState.

Returns:

UserState.

onTurn

public CompletableFuture onTurn(TurnContext context)

Runs dialog system in the context of an ITurnContext.

Parameters:

context - Turn Context

Returns:

result of runnign the logic against the activity.

setConversationState

public void setConversationState(ConversationState withConversationState)

Sets the ConversationState.

Parameters:

withConversationState - The ConversationState.

setDialogs

public void setDialogs(DialogSet withDialogSet)

Set the DialogSet.

Parameters:

withDialogSet - The DialogSet being provided.

setExpireAfter

public void setExpireAfter(Integer withExpireAfter)

Sets the (optional) number of milliseconds to expire the bot's state after.

Parameters:

withExpireAfter - Number of milliseconds.

setRootDialog

public void setRootDialog(Dialog dialog)

Sets root dialog to use to start conversation.

Parameters:

dialog - Root dialog to use to start conversation.

setStateManagerConfiguration

public void setStateManagerConfiguration(DialogStateManagerConfiguration withStateManagerConfiguration)

Sets the DialogStateManagerConfiguration.

Parameters:

withStateManagerConfiguration - The DialogStateManagerConfiguration to set from.

setUserState

public void setUserState(UserState userState)

Sets the UserState.

Parameters:

userState - UserState.

Applies to