article by Frank Nimphius, April 2020
updated on May 2020 for oda-native-client-sdk-js-20.5.1 Web SDK
During a bot conversation, users can be distracted for a short time and become inactive. With the Oracle Web SDK, your skills can remind users after a certain idle time or even cancel the conversation. This behavior however does not come out-of-the box but requires you to design your dialog flow conversation for it.
This article explains an implementation strategy that allows bot to remind users of the conversation they started and also to close a conversation that sat idle for too long. Using this implementation you can also avoid users from staying idle beyond the time configured as the channel session expiry time.
The sample that you can download for this article is a pizza order bot. The business of the bot is less important though than what it does. After you setup the downloaded sample as described in the article, you can run it by starting the index.html file, opening the message window (with a click on the bot icon in the lower right corner of the page) and typing I like to order pizza.
The bot response shows as in the image below. You can now select a pizza to order, or just do nothing.
Once you do nothing for more than 10 seconds (the configured idle time to the demo), you see a "wake-up" dialog shown in the image below. You can now consider selecting to continue the conversation, cancel the conversation or remain idle.
If you remain idle then the sample skill cancels the pizza order after another 10 seconds. If you selected the Continue pizza order button, then navigation would continue from where it has been left. By doing so, the timer is reset and active until next time you stay idle for longer than 10 seconds.
The sample ZIP file contains the pizza order skill and the web messenger shown in the article. Follow these steps
Note: The PDF article contains a detailed explanation of the setup and how it works.
Download oda-native-client-sdk-js-20.5.1 sample: Sample Skill and Web Client (ZIP)
Use the sample below if you are on a Web SDK version before 20.5.1.
Download oda-native-client-sdk-js-20.3.1 sample : Sample Skill and Web Client (ZIP)