Once you have validations created as explained in user guide, you can use it along with your transitions. You just need to add a validation string to your transition.
Validation string is an expression which results boolean true or false.
Each transition has a validation string and it looks like;
validation.isEligbleForPromotion
In addition to simple validations you can also create complex validations by combining operators and other validations.
You can combine multiple validations with operators listed below;
Operator | Description |
---|---|
&& | Logical And operator |
|| | Logical Or operator |
! | Not operator |
() | Grouping |
Tip:If you want to learn more about boolean algebra you can check this link.
For example;
If you have 3 validations are called checkDay
,cartValue
, isMember
You can have validation string as combined;
validation.checkDay && validation.cartValue && validation.isMember
or you can group validations together;
(validation.checkDay && validation.cartValue) || !validation.isMember