Rules SDK - Event Attributes
Essential knowledgeCore knowledge to understand Fluent Commerce
Author:
Fluent Commerce
Changed on:
19 Jan 2024
Overview
The`@EventAttribute` Annotation declares the Event Attributes the Rule requires from the Event.Key points
- Event Attributes
It contains 2 properties:
`name`- the Name of the Event Attribute.`type`- the Type of the Event Attribute.
`@EventAttribute(name = "EventAttribute1", type = "STRING")
`Event Attribute Types include:- STRING (default)
- INTEGER
- BOOLEAN
`STRING`.The Rule code can cast the event attribute into a specific type, such as `StockReserveDetails` below:StockReserveDetails Class:`
`StockReservationRequest Rule:When declaring a User Action on a Ruleset using this rule, the Event Attribute Type should now be declared as follows:StockReservation Ruleset & User Action: