article by Frank Nimphius, August 2018
Update: Oracle Intelligent Bots has been rebranded Oracle Digital Assistant to better describe its capabilities beyond a standard chatbot. To learn more, visit cloud.oracle.com/digital-assistant
If you ever submitted a paper for a conference, then you probably know the type of registration question in which a list of categories is displayed for you to first choose the primary topic of your talk, then the secondary and finally the third. By selecting a topic from the list, the items on the list are reduced by the one selected for the next display.
The same UI can be achieved for a bot conversation in Oracle Intelligent Bots. Below screen shots shows a conversation in a fictitious bot to submit papers for Oracle Open World.
The first list shows all the options to select from
The second list then shows the same choice minus the previously selected one
Eventually, the third list shows the remaining list items minus the two previously selected items
Note: The selected values could have been from anywhere in the list. Its coincidentally that the values on top were selected in the sample
The above lists are created from an array of data saved in a context variable. The array could be statically defined in BotML (as in this sample) or populated dynamically from a custom component (querying a remote service).
The reduction of the list, from one question to the next, however is implemented using Apache Freemarker expressions. So no custom component that needs to be involved for this.
The image above shows the CR component, which is used to build the list, with the visible attribute set to an expression that compares each list elements with the value selected value saved in a context variable. Notice the use of the Apache FreeMarker matches built-in expression to compare the list item value with the context variable value.
The expression ensures that a previous selected value is hidden from the CR component response. Note that the CR component list dynamically reads the content saved in the "categories" array. The second list then checks for the content saved in two context variables
Bottom line is that the selected values are not removed from the list but hidden in the CR component rendering.
Related articles
TechExchange – Using Apache Freemarker Expression in Oracle Intelligent Bots
TechExchange: How-to make System.Switch case insensitive with Apache FreeMarker