Oracle Magazine, May/June 2019
Mobile APPLICATION DEVELOPER Note The value string above is provided in the starter folder of the download resources for this article You can find it in a text file named step 44_ textProperty txt 45 Run the embedded conversation tester by clicking the Skill Tester icon 46 Type I like to order pizza into the Message field and press the Enter key 47 When the list of values appears type salami into the Message field and press the Enter key Notice the prompt displayed with the pizza type list which now repeats your text input mentioning that the input is not valid and asking you to choose a value from the menu ORACLE MAGAZINE MAY JUNE 2019 50 48 Click Reset and close the tester What you just did Apache FreeMarker is an open source templating engine and expression language that is used in the Oracle Digital Assistant dialog flow The internal invalidUserInput system variable is set to true after the first failed attempt of a user to provide a valid data input The Apache FreeMarker if directive is then used to repeat the provided user message along with a text message explaining what the user should do next ALLOW USER TO ACTIVELY CANCEL OR REQUEST HELP So far so good but as long as there is better just good is not enough With your improvements the pizza skill nicely guides users on what to do and it still cancels the pizza order when the value in the maxPrompts property which defines the maximum number of failed user input attempts is exceeded Instead of the chatbot automatically exiting the validation loop lets make the user do so intentionally 49 Go to line 35 and remove the value set for the maxPrompts property This change configures the askPizzaType state to go into an infinite validation loop when the user does not provide a valid value for the pizza type
You must have JavaScript enabled to view digital editions.