Documentation - v1.2.0-alpha.3
    Preparing search index...

    Class DialogContainer<O>Abstract

    A container for a set of Dialogs.

    Type Parameters

    • O extends object = {}

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    dialogs: DialogSet = ...

    The containers dialog set.

    EndOfTurn: DialogTurnResult = ...

    Gets a default end-of-turn result.

    This result indicates that a dialog (or a logical step within a dialog) has completed processing for the current turn, is still active, and is waiting for more input.

    Accessors

    Methods

    • Checks to see if a containers child dialogs have changed since the current dialog instance was started.

      Parameters

      Returns Promise<void>

      This should be called at the start of beginDialog(), continueDialog(), and resumeDialog().

    • Returns internal version identifier for this container.

      Returns string

      Version which represents the change of the internals of this container.

      DialogContainers detect changes of all sub-components in the container and map that to a versionChanged event. Because they do this, DialogContainers "hide" the internal changes and just have the .id. This isolates changes to the container level unless a container doesn't handle it. To support this DialogContainers define a protected method getInternalVersion() which computes if this dialog or child dialogs have changed which is then examined via calls to checkForVersionChange().

    • An encoded string used to aid in the detection of agent changes on re-deployment.

      Returns string

      Unique string which should only change when dialog has changed in a way that should restart the dialog.

      This defaults to returning the dialog's id but can be overridden to provide more precise change detection logic. Any dialog on the stack that has its version change will result in a versionChanged event will be raised. If this event is not handled by the agent, an error will be thrown resulting in the agent error handler logic being run.

      Returning an empty string will disable version tracking for the component all together.

    • Called when a unique ID needs to be computed for a dialog.

      Returns string

      SHOULD be overridden to provide a more contextually relevant ID. The preferred pattern for ID's is <dialog type>(this.hashedLabel('<dialog args>')).

    • Called after an event was bubbled to all parents and wasn't handled.

      Parameters

      Returns Promise<boolean>

      Whether the event is handled by the current dialog and further processing should stop.

      This is a good place to perform default processing logic for an event. Returning true will prevent any processing of the event by child dialogs.

    • Called before an event is bubbled to its parent.

      Parameters

      Returns Promise<boolean>

      Whether the event is handled by the current dialog and further processing should stop.

      This is a good place to perform interception of an event as returning true will prevent any further bubbling of the event to the dialogs parents and will also prevent any child dialogs from performing their default processing.

    • When overridden in a derived class, prompts the user again for input.

      Parameters

      Returns Promise<void>

      Derived dialogs that support validation and re-prompt logic should override this method. By default, this method has no effect.

      The DialogContext calls this method when the current dialog should re-request input from the user. This method is implemented for prompt dialogs.

    • When overridden in a derived class, resumes the dialog after the dialog above it on the stack completes.

      Parameters

      • dc: DialogContext

        The context for the current dialog turn.

      • reason: DialogReason

        The reason the dialog is resuming. This will typically be DialogReason.endCalled

      • Optionalresult: any

        Optional. The return value, if any, from the dialog that ended.

      Returns Promise<DialogTurnResult<any>>

      A promise resolving to the dialog turn result.

      Derived dialogs that support multiple-turn conversations should override this method. By default, this method signals that the dialog is complete and returns.

      The DialogContext calls this method when it resumes the dialog. If the previous dialog on the stack returned a value, that value is in the result parameter.

      To start a child dialog, use DialogContext.beginDialog or DialogContext.prompt; however, this dialog will not necessarily be the one that started the child dialog. To signal to the dialog context that this dialog has completed, await DialogContext.endDialog before exiting this method.