Product documentation

04. Spring expression language

The Spring Expression Language (“SpEL” for short) is a powerful expression language that supports querying and manipulating an object graph at runtime.

In Favendo’s context it can be used in a routine definition to condition its triggering.

For example:

Event: tags enters a zone

Routine: Send a notification if the condition “assignedAssetDto!=null” (tag is assigned to an asset) is true

Following some examples on how to use it.

ConditionSpEL valueComment
If tag is assigned to an assetassignedAssetDto!=null
If a specific custom attribute of type “ATTRIBUTE_WITH_BOOLEAN” is trueassignedAssetDto.customAttributes[1].booleanValueThe custom attribute order needs to be known
If a custom attribute of type “ATTRIBUTE_WITH_MULTIPLE_CHOICE” or “ATTRIBUTE_WITH_SINGLE_CHOICE” has value XXassignedAssetDto.customAttributes[2].valueKey==XXfor multiple choice or single choice, it is recommander to use the value key
If a custom attribute of type “ATTRIBUTE_WITH_TEXT” has value XX‘customAttributeWithText-value’.equals(assignedAssetDto.customAttributes[0].textValue)for string use equals for comparison
If current time is between XX and XXT(java.time.LocalTime).now().isAfter(T(java.time.LocalTime).of( 00 , 00 , 00)) && T(java.time.LocalTime).now().isBefore(T(java.time.LocalTime).of( 23 , 59 , 59))the event time stamp can also be used