Clarity Core Actions
Goto page
If you want to go to a particular page, for example a project, idea, custom object or investment, in Clarity, you can use action_objects_form action. It will directly take you to that particular page without clicking on anything. If the user asks for an object name which is not present in Clarity , it will respond with an utterance , saying “It does not have any such record”.
Rasa Slots
The action will use and set the following rasa slots :
- page : stores the object name.
- name : stores the object instance name.
- code : stores the object instance code.
NSQL Query
This example form action relies on the NSQL query rasa_getobject existing within Clarity.
Responses required
The following responses are required to respond to the user :
Response | Example text |
utter_no_result_found | Sorry, could not find any record with the above details. Please try again! |
utter_no_object_found | There is no such object. Please try again with valid object name. |
utter_ask_code | Please enter the code or name |
utter_not_authorized | You are not authorized to do this activity |
utter_forbidden | The requested resource is forbidden |
Run a report
The action_run_report action presents a list of buttons of reports and on clicking on any one will launch the Jaspersoft report in a new tab.
Responses required
The following responses are required to respond to the user :
Response | Example text |
---|---|
utter_found_report | I found the following reports |
utter_no_report_found | Sorry, I couldn’t find a suitable report. |
Status Reports
The action_status_report action will show status of all the reports available for the current user and display them in a table format. If you click on any one of them, it will take you to the current status report page for that investment.
NSQL Query
This example action relies on the NSQL query rasa_status_reports existing within Clarity.
Responses required
The following responses are required to respond to the user :
Response | Example text |
---|---|
utter_no_status_reports | Sorry, I couldn’t find a suitable status report. |
utter_no_result_found | Sorry, could not find any record with the above details. Please try again! |
utter_error_showing_report | Error showing status reports. Please try again, if the problem persists contact your Clarity Admin. |
Monthly Budget
Here the action_project_data action will displays a chart of project budgets for the projects where the current user is the manager. The user can then click on any of the projects to get the monthly budget plan for that particular project from action_monthly_budget action.
Rasa Slots
The action will use and set the following rasa slots :
- project_id : stores the object instance id.
NSQL Queries
This example action relies on the NSQL queries rasa_prj_monthly_budget and rasa_prj_cost existing within Clarity.
Responses required
The following responses are required to respond to the user :
Response | Example text |
---|---|
utter_monthly_budget_no_approved_budget | Sorry, selected projects are not having an approved non-zero budget defined in it. |
Show Submitted Timesheets
The action_submited_timesheet action will respond with a table of timesheets pending the current user’s approval. Clicking on any of the timesheets, you be will redirected to that particular timesheet page, where you can approve it.
NSQL Queries
This example action relies on the NSQL query rasa_timesheet_hours existing within Clarity.
Responses required
The following responses are required to respond to the user :
Response | Example text |
---|---|
utter_no_result_found | Sorry, could not find any record with the above details..Please try again! |
utter_show_timesheets | Here I see below timesheets are pending your approval, click on the link in the table to go to the timesheet. |
utter_timesheet_approval | There are no timesheets awaiting your approval |
utter_error_updating_action_item | Error updating the action item. Please try again, if the problem persists contact your Clarity Admin. |
Pending Action Items
This example comprises three actions: actionPendingActionItems, actionActionsListActionItems and action_take_action_ai. This story will list the action items of the current user, which are waiting to be approved or rejected. If there are no action items, it will respond with an utterance saying “There are no pending action items in your list.” If there are actions, a table will be returned and via the “Take Action” link in this table, the user is able to Approve or Reject the selected action item.
Rasa Slots
The following Rasa slot is used/set by this example
- actionItems : stores all of the action items details in a dictonary.
Responses required
The following responses are required to respond to the user :
Response | Example text |
---|---|
utter_no_pending_action_items | There are no pending action items in your queue. |
utter_actions_assigned | Below actions are assigned to you : |
utter_no_action_items_assigned | No actions are assigned to you |
utter_action_item_updated | Action Item has been updated successfully. |
utter_error_updating_action_item | Error updating the action item. Please try again, if the problem persists contact your Clarity Admin. |
Jokes
The action_jokes action responds with a random joke in multi langugaes to the user from a file resident on the action server. The supplied file contains in excess of 300 jokes.
Requirements
- File : jokes.json inside the actions folder
The file jokes.json must be resident on the action server. Jokes can be added to the file mirroring the current format.
[
{
"en":
[
{
"id": 93,
"type": "general",
"setup": "Did you hear about the Mexican train killer?",
"punchline": "He had loco motives"
}
]
},
{
"fr":
[
{
"identifiant": 10,
"type": "général",
"setup": "Qu'est-ce que le poisson a dit quand il a heurté le mur ?",
"punchline": "Barrage."
}
]
},
{
"de":
[
{
"ID": 15,
"Typ": "allgemein",
"setup": "Was hat der Fisch gesagt, als er gegen die Wand prallte?",
"punchline": "Damm."
}
]
}
]
where the attributes are :
attribute | description |
---|---|
id | a unique id for the joke. |
type | a category for the joke. |
setup | the joke setup/initial line of response. |
punchline | the joke punchline/second line of responses. |
Responses required
The following responses are required to respond to the user :
Response | Example text |
---|---|
utter_no_jokes | Sorry, i’m not feeling funny at the moment. |