botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Go back to specific step in waterfall

Open oeroche opened this issue 10 years ago • 9 comments

Hi,

Working with node here!

How can I go back to a specific step in a waterfall ?

The use case is as follow:

Step 1 : The User is prompted to enter a research

Step 2 : No result Found So we go back to step 1

I can't find a way to implement this behavior...

oeroche avatar May 27 '16 10:05 oeroche

reload the dialog using session.replaceDialog(). This will start you back at the beginning of the waterfall. If your waterfall isn't a separate dialog you should break it out to be a separate dialog.

Stevenic avatar May 27 '16 17:05 Stevenic

Yeah I discovered it by myself yesterday ! Hope it will help others!

Thanks for the great work you are doing on this project by the way!

oeroche avatar May 28 '16 09:05 oeroche

Is there a way to skip a step in a waterfall? Say I have a waterfall where each step promps for some data, but for some run through's I may already have the data needed in some of the steps.

stephshelley avatar Jun 05 '16 01:06 stephshelley

@stephshelley check if the result exists, if it does run next()

amitbend avatar Mar 16 '17 11:03 amitbend

may be, you can add a int value to next, to comeback to a previous step or add an index to every step, and, using next(index), we can go back to the step in waterfall

rcarmonad avatar Apr 24 '17 22:04 rcarmonad

If you want to go backward use a Switch method instead of the waterfall dialog.

jasonMunsterteiger avatar Apr 01 '19 03:04 jasonMunsterteiger

@jasonMunsterteiger can you explein please?

Unders0n avatar Jul 24 '19 12:07 Unders0n

You use a Case/Switch statement with If() and control the flow different than with a waterfall dialog. Just check the Case against the client reply and you can start from whatever part in the loop you desire.

jasonMunsterteiger avatar Jul 24 '19 17:07 jasonMunsterteiger

Reading his initial question again, I see that you could also use the data validator for dialog prompts and keep trying that same question until it receives the expected data.

jasonMunsterteiger avatar Jul 24 '19 18:07 jasonMunsterteiger