Trigger Event Categories
This page describes how to configure real-time event rules in HCL Detect, including audience templates, trigger conditions, metrics, and offer actions. It covers enum types for UI drop-downs, audience segmentation, event triggers, and action tracking (both cumulative and non-cumulative) to streamline event creation through the UI.
Event trigger profile categories is a list of categories used for defining the templates used to create trigger conditions. Each category has a name and list of templates, each template has defines a list of segments. A segment is a customizable part of the audience condition like segments in audience templates which can be used when forming the template's caption. Each trigger template also defines a domain mapping, the domain mapping may contains a switch/case statement on the segment values, and translates the condition into a UEL expression using profile attributes and aggregates, very similar to audience selection profile categories discussed earlier The former can reference profile attributes, where the latter can reference both the profile attributes and the feed attributes aka tuple's attributes.
Trigger templates are grouped into named categories based on their business logic as shown below:
{
"categories": [
{
"icon": "fa-user",
"name": "Usage-Based Trigger Conditions",
"templates": [
{
...
},
{
...
}
]
},
{
"icon": "fa-crosshairs",
"name": "Usage threshold Based",
"templates": [
{
...
},
{
...
}
]
}
}
categories are shown below:

Once we select an trigger category, all trigger templates under that trigger category.
Elements inside the templates are different trigger template condition,
we will try learn how to configure trigger condition templates by examples.
trigger conditions are configured in
etc/model/campaigns/trigger_event_categories.json file.
As trigger templates are very similar to audience template, below section will only discuss about the difference between them.
Simple Trigger Templates
Example:
{
"analyticsBased": false,
"caption": "When the subscriber's current call duration is greater than ${callDuration}",
"conditionTemplateId": "callDuration",
"domainMapping": {
"expressionTemplate": "duration > ${callDuration}"
},
"feedsSelector": {
"byNames": [
"Ericsson Usage"
]
},
"name": "Call duration",
"segments": [
{
"segmentId": "callDuration",
"segmentKind": "Primitive",
"segmentType": "Double",
"segmentValue": {
"doubleValue": 1.0
}
}
]
},
- Here
domainMapping.expressionTemplateuses attribute duration, this is an attribute in the real-time feed Ericsson Usage. feedsSelectorselect a feed on which domainMapping expression will be evaluated. Feeds can be selected bybyNamesi.e., a list of feed application names or by byModelNames i.e. a list of feed data models.
Trigger Templates With Aggregate
Example:
{
"analyticsBased": false,
"caption": "When the subscriber's current call duration is greater than ${averageCallDurationPercent}% to his average call duration in the last ${windowLength} hours",
"conditionTemplateId": "averageCallDuration",
"domainMapping": {
"expressionTemplate": "((duration / aggregate(avgCallDuration[MSISDN], Last, ${windowLength}, Day)) * 100 ) > ${averageCallDurationPercent}"
},
"feedsSelector": {
"byNames": [
"Ericsson Usage"
]
},
"name": "Average call duration",
"segments": [
{
"segmentId": "averageCallDurationPercent",
"segmentKind": "Primitive",
"segmentType": "Double",
"segmentValue": {
"doubleValue": 2.0
}
},
{
"segmentId": "windowLength",
"segmentKind": "Primitive",
"segmentType": "Integer",
"segmentValue": {
"integerValue": 1
}
}
]
},
Trigger Templates With Modifiers
Example:
{
"analyticsBased": false,
"caption": "When a voice transaction using the ${walletName} wallet takes place for a subscriber",
"conditionTemplateId": "transactionUsingAWallet",
"domainMapping": {
"expressionTemplate": "currentWalletName == ${walletName}"
},
"feedsSelector": {
"byNames": [
"Voice"
]
},
"modifiers": [
{
"caption": "and wallet is expiring within ${daysToExpire} day(s)",
"domainMapping": {
"expressionTemplate": "currentWalletDaysToExpire == ${daysToExpire}"
},
"modifierId": "daysUntilExpirationForWallet",
"name": "Days until expiration for wallet",
"segments": [
{
"segmentId": "daysToExpire",
"segmentKind": "Primitive",
"segmentType": "Integer",
"segmentValue": {
"integerValue": 2
}
}
]
}
],
"name": "Transaction using the wallet",
"segments": [
{
"segmentId": "walletName",
"segmentKind": "Primitive",
"segmentType": "String",
"segmentValue": {
"stringValue": "Data200"
}
}
]
}