Conversations without Chat in Oracle Intelligent Advisor 21B

There is a growing movement around “conversational interfaces” – for which most people will assume that the author is refering to Chat clients, Chat interfaces and all the necessary tools to make a decent reusable Chat platform, like Oracle Digital Assistant. And regular readers of this website will know that we have experimented with conversational interfaces using the supplied connector with our Oracle Digital Assistant series.

But there are other ways of approaching the conversational idea, even without having to invest in Oracle Digital Assistant (which for the record is a very elegant tool, which I would recommend). We are here to look at two of them, and to showcase another new feature introduced in Oracle Intelligent Advisor 21B.

Firstly, a conversational style can be implemented, more or less, with a simple plugin library like Conversational Form. Here’s what a simple interview would look like running through that library. Cool, huh?

Oracle Intelligent Advisor 21B - Conversational Form

With the arrival of Oracle Intelligent Advisor 21B there is a new, out of the box option for Conversational designers. Although it has nominally been introduced for visibility management of controls in extension code, it can very easily be used to create a “progressive reveal” interview Screen.

It is an interview extension that allows access to the controls on a Screen (in the current Screen, getControls() output for example) and then we must provide either true or false as a function return value, where true means the control should be invisible. The same logical structure is used to hide or show the Submit button. So in effect, we have two new properties to play with :

  • customVisibility : control visibility management
  • isSubmitHidden : Submit button visibility management

Both of these allow us, in Oracle Intelligent Advisor 21B, to eliminate some jQuery or other DOM manipulation which was the usual approach before these extensions broke cover. There is a very good example in the documentation which I will show below, with a few minor comments thrown in.

Let’s deal with the Submit button code first:

				isSubmitHidden: function () {
					const controls = interview.currentScreen().getControls();
					var counter = 0;
					for (counter = 0; counter < controls.length; counter++) {
						const myControl = controls[counter];
						if (!myControl.isVisible())
							continue;
						if (myControl.kind == "input") {
							if (!myControl.isOptional()) {
								if (myControl.getValue() == null) {
									return true;
								}
								const myControlType = myControl.getDataType();
								if (myControlType == "text" && myControl.getValue() == "")
									return true;
							}
						}
					}
					return false;
				}

In the example above, the Submit button is visible (the return false at the end) unless it hits one of the situations in the loop that processes the controls. If there are any null values in non-optional controls then the Submit button is not displayed.

Now here is the customVisibility code:

isControlHidden: function (control) {
				const controls = interview.currentScreen().getControls();
				var counter = 0;
					for (counter = 0; counter < controls.length; counter++) {
						
						const myControl = controls[counter];
						if (myControl == control) {
							console.log ("Current Target is number " + (counter+1))
							console.log("Leaving loop with Control " + (counter+1) + " visible.");
							return false;
						}
						if (myControl.kind == "input") {
							if (!myControl.isOptional()) {
								if (myControl.getValue() == null) {
									return true;
								}
								const myControlType = myControl.getDataType();
								if (myControlType == "text" && myControl.getValue() == "") {
									return true;
								}
							}
						}
					}
					return true;
			}

Some of the code should look familiar as it uses the same logic to decide whether controls should be invisible – reversing what we saw in the submit code. But a video is worth a thousand words, so here is the code running. Note that the current example is not appropriate for Screens that use containers or other “non interactive” controls.

The online documentation for 21B is available here, for the new extensions mentioned in this article. My example is a lightly modified version of the one in the documentation. Have a great conversation!

Author: Richard Napier

Richard Napier joined Siebel Systems in 1999 and took up the role of managing the nascent Siebel University in Southern Europe. He subsequently was Director of Business Development and Education for InFact Group (now part of Business & Decisions) for 8 years. He now runs Intelligent Advisor IT Consulting OÜ. Owner of intelligent-advisor.com, he also is Co-Founder of the Siebel Hub.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Worldwide
Logo by Southpaw Projects LLC