Attributes
Expressions in HCL Detect Expression Language can also contain attributes. Attributes are identifiers that correspond to the attributes available in a tuple or in the master profile. Each attribute has a type and can appear in anywhere a sub-expression of that type is expected.
If an attribute comes from the master profile, it can be referenced by prefixing it
with profile.
. Otherwise, only the attribute name is used.
Examples:
- A string formed by concatenating a
String
literal and an attribute namedcode
from the current tuple:"AREA_" + code
- A string formed by concatenating a
String
literal and a profile attribute namedname
:"My name is " + profile.name
- An arithmetic expression involving an attribute and
Int32
literals:numSeconds / (24 * 60 * 60)
- An arithmetic expression involving a profile attribute and
Int32
literals:profile.ageInSeconds / (24 * 60 * 60)
- A floating-point arithmetic expression, where the floating point literal is of
type
Double
:cost / 1000.0
- Another expression involving a profile attribute, where the floating point
literal is of type
Double
:profile.revenue / 1000.0
- A Boolean expression checking if a
String
literal is found in an attribute namedplaces
of typeList(String)
:"airport" in places
- A Boolean expression checking if a
String
literal is found in a profile attribute namedfavoritePlaces
of typeList(String)
:"airport" in profile.favoritePlaces