cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a new promotion condition with boolean field.

krishn_signet
Participant
0 Kudos
166

I want to create a new promotion condition which will be of boolean type. But when I tried to write a translator for the same, I am getting some exception. Below is my code:

                final String userRaoVariable = context.generateVariable(UserRAO.class);
final RuleIrAttributeCondition irTenderCondition = new RuleIrAttributeCondition();
irTenderCondition.setVariable(userRaoVariable);
irTenderCondition.setAttribute("loyaltyPromo");
irTenderCondition.setOperator(RuleIrAttributeOperator.EQUAL);
irTenderCondition.setValue(loyaltyPromo);
return irTenderCondition;

"loyaltyPromo": is the new condition for my promotion.

And this is the exception that I am getting

Unable to Analyse Expression loyaltyPromo == Boolean.TRUE:
[Error: unable to resolve method using strict-mode: de.hybris.platform.ruleengineservices.rao.UserRAO.loyaltyPromo()]
[Near : {... loyaltyPromo == Boolean.TRUE ....}]

Any idea, how to write condition translator for boolean condition type?

Accepted Solutions (0)

Answers (0)