Hi,
I see that you have shown a way to skip certain parts of a dialog by using the next() function. Is it possible to go back? For example, something like previous() so that instead of restarting the entire dialog, we just move to the previous prompt?
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
In the v4 SDK, you can use the dialog context's _replace_ method to replace the current dialog with the specified one, but the replacing dialog will start from the beginning. If you need to "start in the middle", you can break up your conversation flow into a set of dialogs. See the how-to manage complex conversation flows topic for more information.
@v-ducvo , do you know if there is a comparable way to do this in v3?
No there isn't.
But, you could implement it by using a combination of "replace()", "next()", and state tracking to support this behavior.
@v-ducvo - Thanks a lot for that information. I will probably use that flow. I have a couple of more questions regarding the usage. Do you mind if I send out an email to you?
Not at all...
No there isn't.
But, you could implement it by using a combination of "replace()", "next()", and state tracking to support this behavior.
Correct me if i'm mistaken but in V3 you could do this just by awaiting the name of the particular dialog you wanted to go to
For example:
public virtual async Task Step1(IDialogContext context, Iawaitable<Imessageactivity> activity)
{
some code
await Step2(context, null);
}
public virtual async Task Step2(IDialogContext context, Iawaitable<Imessageactivity> activity)
{
some code
await Step3(context,null);
}
public virtual async Task Step3(IDialogContext context, Iawaitable<Imessageactivity> activity)
{
some code
await Step2(context,null);
}
I believe this capability (going into a particular Dialog waterfall step by using something like context.ReplaceDialogAsync(MainDialogId.Step4, object, cancellationToken); ) should be added to V4 of the Bot Framework. Of course I'm talking without knowing the required amount of work to do it but it would be nice anyway.
In v4, you could implement a pattern of "naming" the steps of your dialog and implement a fall through to that step using the start options to suggest falling through to that step. You could even advertise the available step names via a public property off your dialog class.
Past that, you could mess with the dialog stack, but that would be fragile and fraught with peril. We don't have documentation on it yet, but you could implement your own custom dialog type for this by deriving from Dialog.
Most helpful comment
No there isn't.
But, you could implement it by using a combination of "replace()", "next()", and state tracking to support this behavior.