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
Stringliteral and an attribute namedcodefrom the current tuple:"AREA_" + code - A string formed by concatenating a
Stringliteral and a profile attribute namedname:"My name is " + profile.name - An arithmetic expression involving an attribute and
Int32literals:numSeconds / (24 * 60 * 60) - An arithmetic expression involving a profile attribute and
Int32literals: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
Stringliteral is found in an attribute namedplacesof typeList(String):"airport" in places - A Boolean expression checking if a
Stringliteral is found in a profile attribute namedfavoritePlacesof typeList(String):"airport" in profile.favoritePlaces