Example: an AIML template with customized tags

The following script is an excerpt from an out-of-box AIML configuration template, which consists of customized tags that are specific for HPE Service Manager:

<SMJS>
	<JSCALL>
		lib.EndUserChatBotIDOLSearch.IDOLSearch
	</JSCALL>
	<JSPARAMS>
		<JSPARAM name="smLoginUser"><get name="smLoginUser"/></JSPARAM>
		<JSPARAM name="smBotId"><get name="smBotId"/></JSPARAM>
		<JSPARAM name="problemDesc"><get name="problemDesc"/></JSPARAM>
	</JSPARAMS>
</SMJS>

Refer to the following table for detailed descriptions about the tags:

Tag Description
<SMJS> Indicates that the system invokes a Service Manager JavaScript and returns the executed value of this Javascript to a end user as the real response.
<JSCALL>

Indicates the Service Manager JavaScript to be invoked. The format is lib.<Service Manager ScriptLibrary Name>.<function name>.

The sample JavaScript is lib.EndUserChatBotIDOLSearch.IDOLSearch, which consists of the following codes:

function IDOLSearch(){
//Get parameters 
//by using arguments[0][parameter name specified in <JSPARAM>]
    var endUserLoginName=arguments[0]['smLoginUser'];
    var botId=arguments[0]['smBotId'];
    var content=arguments[0]['problemDesc'];
    ... ...
return 
{\"predicates\":
  {\"BOTCUSTPREDICATE_SMIDOLSEARCH1\":\"BOTCUSTPREDICATE1: Install Lync Mobile\",
   \"BOTCUSTPREDICATE_SMIDOLSEARCH2\":\"BOTCUSTPREDICATE2: New Employee Bundle\",
   \"BOTCUSTPREDICATE_SMIDOLSEARCH3\":\"BOTCUSTPREDICATE3: Email Configuration\"
  }
};
}

In the return value:

Code Description
predicates

This key word is to notify a virtual agent to set customized predicates that can be used in the following AIML categories as the template response by <get name="predicate name"/>.

See Service Manager out-of-box predicates for more information.

Predicate with the BOTCUSTPREDICATE prefix This is a Service Manager reserved predicate for IDOL search result. You can define your own predicates.
Predicate’s value with the BOTCUSTPREDICATE prefix

This is Service Manager “key word”. The system uses the content after BOTCUSTPREDICATE as the template text response and filters BOTCUSTPREDICATE out of the response.

Note After you Configure IDOL search for virtual agent, you must update the AIML configuration by setting related predicates amount along with the search results so that the virtual agent's IDOL search can work successfully.

<JSPARAMS> Indicates the parameters that the JavaScript required.
<JSPARAM> Specifies the parameter name and value.