Customizing the chatbot actions
BMC Helix Virtual Agent provides support by interacting with users through natural language, understanding the conversation context, and performing tasks on behalf of the user. As an application business analyst or an administrator, you can configure BMC Helix Virtual Agent to invoke custom actions that are performed by the chatbot on behalf of the user. These actions are invoked from the IBM Watson Assistant service.
To use custom processes and actions in BMC Helix Virtual Agent
You can use custom processes and actions in BMC Helix Virtual Agent. The custom processes are created in the Process designer of BMC Helix Innovation Studio. For more information about creating custom processes, see
Defining the application business logic through processes
in the BMC Helix Innovation Suite online documentation.
After creating the processes and actions, you can invoke the custom processes and actions from a dialog in IBM Watson Assistant Skill. To view examples of the JSON code of dialog response with chat actions, see Example JSON of BMC Chatbot dialog responses.
Example JSON of BMC Helix Virtual Agent dialog responses
To enable BMC Helix Virtual Agent to interact with your users, you must build a dialog in the IBM Watson Assistant Skill. Based on the conversation, IBM Watson Assistant sends an action to your application that needs to be performed on the behalf of the user. In the Skills dialog, you can define these actions to call the processes or actions that you have created.
See the following JSON code samples:
- Sample: Creating a service request
- Sample: Searching for a knowledge article
- Sample: Getting the status of the service request
- Sample: Publishing an event in a chat dialog
- Sample: Checking entitlements and questions with default answers
- Sample: Populating default answers to service request questions
Sample: Creating a service request
After an employee provides all the details to create a service request, for example, a time-off-request, BMC Helix Virtual Agent uses these details to create a service request. The following JSON illustrates the dialog response that contains a chat action to create a service request:
The following table explains the inputs provided in the action block for creating a service request:
Field ID | Input text | Description |
---|---|---|
536870920 | trigger | Defines the action status. |
536870921 | sb_apply_pto | Specifies the name of the action. Ensure that the name matches to the Service Request Name specified in the BMC Helix Business Workflows Catalog. |
536870922 | $loginName | Specifies the login name of the user. |
536870923 | "6491c1f4-5dc7-0887-b8b2-6b11284a49fd": "$startDate" "ab9a845c-0e69-2929-8a25-66a5a319a539": "$vacationType" "ef1145f2-2730-d43b-706e-d25b812ef041": "$endDate" "f4036404-f6cb-9173-6bb1-007296a27463": "$userQuestion" | Specifies the vacation start date. Specifies the vacation type. For example, paid vacation. Specifies the vacation end date. |
Output map
The following table explains the outputs provided:
Field ID | Output | Description |
---|---|---|
536870910 | Status | Specifies the status of the service request. |
536870911 | Request Id | Specifies the ID of the service request. |
<Description field ID> | Description | Specifies the description of the service request. Ensure that the Field Id exists and the content in the field ID placeholder is not blank. |
In a service request, when the process in the output action map is executed, the process result is embedded in the user message and sent to the user. If you want to return a process result to Watson for validation or conditional child dialog execution, you must use "waitForActionExecution": true
in the output action map.
Sample: Searching for a knowledge article
If there are any knowledge articles related to a request from a user, you can enable BMC Helix Virtual Agent to return a list of related knowledge articles. The following JSON illustrates the dialog response that contains a chat action to search for knowledge articles:
The following table explains the inputs provided in the action
block for retrieving the knowledge articles:
Field | Input text | Description |
---|---|---|
536870920 | <?input.text?> | Specifies the text that has to be searched. |
536870921 | 0 | Specifies the beginning of the search index. |
536870922 | 3 | Specifies the maximum number of knowledge articles that should be returned. |
results | ${actionResult.536870911} | Returns a JSON string with the related knowledge article details. |
Sample: Getting the status of the service request
After creating a service request based on the details provided by the user, BMC Helix Virtual Agent returns the status of the service request.
For example, for time-off request, BMC Helix Virtual Agent creates a new service request and returns the service request ID to the user.
The following JSON illustrates the dialog response that contains a chat action to get the status of your request:
The following table explains the inputs provided in the action block for receiving the status of the service request:
Field | Input text | Description |
---|---|---|
536870920 | trigger | Defines the action status. |
536870922 | $loginName | Specifies the login name of the user. |
536870923 | 4 | Specifies the maximum number of service requests to show for the user. |
Sample: Publishing an event in a chat dialog
If you are tracking an event to derive the chatbot usage metrics, you must publish the event details in the dialog in the IBM Watson Assistant Skill. The following JSON illustrates the dialog that contains the publish event action:
The input variables in the JSON change for each event. The following variables are available from chatbot:
Variable name | Description |
---|---|
chatbot_channel | To set the channel |
chatbot_id | To set the chatbot id |
chatbot_name | To set the chatbot name |
Sample: Checking entitlements and questions with default answers
The chatbot checks whether an end user is entitled for a service. The chatbot also checks whether a service question has default answers by using the Entitlement Check and Fill Default Questions action.
The following JSON illustrates the dialog that contains the Entitlement Check and Fill Default Questions action:
The following table describes the parameters in the JSON:
Parameter | Description |
---|---|
service Id | ID of the service created in BMC Helix Digital Workplace Catalog |
Status |
|
Message |
|
Sample Output map of Entitlement Check and Fill Default Questions
If the action is successful, it returns the following output map:
The following table describes the output map:
Parameter | Description |
---|---|
CountryNameID1 | ID of the question |
United States | Default answer of the CountryNameID1 question. |
Sample: Populating default answers to service request questions
If a service has dependent questions or has a default answer to a question, the answers populated in the output map of the Entitlement Check and Fill Default Questions action are used as input for the submitAnswer action.
The following JSON illustrates the dialog that contains the submitAnswer action:
The following table describes the parameters in the JSON:
Parameter | Description |
---|---|
Status |
|
Message |
|
Sample output map of the SubmitAnswer action
If the action is successful, it returns the following output map:
Related topics
Importing chat-enabled services from BMC Helix Digital Workplace Advanced
Comments
Log in or register to comment.