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 named code from the current tuple: "AREA_" + code
  • A string formed by concatenating a String literal and a profile attribute named name: "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 named places of type List(String): "airport" in places
  • A Boolean expression checking if a String literal is found in a profile attribute named favoritePlaces of type List(String): "airport" in profile.favoritePlaces