context-filter dialog

Description of the global context-filter dialog that manages contextFilters to configure the behavior of a specific dialog.

Introduction

ℹ️ The context-filter dialog is an aura-bot core dialog, deployed jointly with the corresponding Aura Platform release.

Find the source code of this dialog in its different versions:

The context-filter dialog handles the execution of all the contextFilters configured in each dialog, evaluating all the properties of the contextFilter, within the triggerCondition model.

  • Does the current contextFilter break the dialog execution? If breakDialogExecution is true, then the response to the request is just handled by the contextFilter, as the dialog is not executed.

  • Does the current contextFilter break the rest of the contextFilters evaluation? If breakFilterEval is true, then the rest of the configured contextFilters are not evaluated.

  • resource: if the contextFilter condition is matched, then the configured resource is returned to the user.

  • redirectToIntent: if the contextFilter condition is matched, then the execution passes to the dialog in charge of the configured intent for the current channel.

  • suggestions: flag to indicate whether or not the response handled by the contextFilter should return suggestions to the user.

Example: Scenario 1

  • Couple of contextFilter, both of them break the dialog execution and only return a resource.
  • None of them break the rest of the contextFilter evaluation, so the last matching contextFilter resource is returned.

In this case, if the user is prepaid, the response is bill:bill.check.prepaid with suggestions; if the user is multimisdn, the response is context-filter:multimsisdn-users-intent-not-allowed.text without suggestions. It works the same than setting breakFilterEval to true, what it is in fact recommended, to avoid performance loss.

"triggerConditions": [
                {
                    "intent": "intent.billing.check",
                    "contextFilters": [
                        {
                            "name": "subscription_type_prepaid_invoice",
                            "type": "subscription_type_filter",
                      "conditions": "/authData/subscriptionType eq 'prepaid'",
                            "true": {
                                "name": "subscription_type_prepaid_invoice_true",
                                "breakDialogExecution": true,
                                "breakFilterEval": false,
                                "resource": "bill:bill.check.prepaid",
                                "suggestions": true
                            }
                        },
{
                            "name": "Multimsisdn Not Allowed",
                            "type": "UserType",
                            "conditions": "/type eq 'multimsisdn'",
                            "true": {
                                "name": "Return_resource_not_multimsisdn_allowed",
                                "breakDialogExecution": true,
                                "breakFilterEval": false,
                                "resource": "context-filter:multimsisdn-users-intent-not-allowed.text",
                                "suggestions": false
                            }
                        }

]

Example: Scenario 2

  • Single filter configured, that matches whether the user is anonymous or not. If the user is anonymous, then the dialog execution is broken and the rest of the contextFilter are not evaluated. The execution is redirected to the dialog that handles intent.account.linking for the current channel.

  • Redirect to the dialog indicated in the contextFilter of the dialog settings:

"contextFilters": [
        {
            "name": "Anonymous redirect to linking",
            "type": "type",
            "conditions": "/type eq 'anonymous'",
            "true": {
                "name": "Anonymous redirect to linking",
                "breakDialogExecution": true,
                "breakFilterEval": true,
                "redirectToIntent": "intent.account.linking",
                "suggestions": false
            }
        }
    ]