cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Missing RuleEngineResultRao from ruleActionContext

Former Member
453

Created new rule engine, and published new rule on that engine, when any rule that satisfy the condition gets executed. while executing action for that rule, it try to fetch RuleEngineResultRAO from ruleActionContext. and it returns null.

Since i am new to rule engine not sure where RuleActionContext is Created. Although other facts(RAOs) are available in ruleActionContext but RuleEngineResultRAO.

No error while executing same rule on promotionEngine.

Thanks in advance for any help :)

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

: There is a issue with your rule generator, please check generateRuleContentRule() of DroolsTargetCodeGenerator where we set these values.

Former Member
0 Kudos

Hi , RuleActionContext will be set in RAOAction class.

you have to Insert Resultant Rao in RuleActionContext(Rao object where promotion result value is available).

You can take refrence of OOB available RAOAction. I am adding an example from RuleAddCouponRAOAction for your refrence.

Here if you see AddCouponRAO is the resultant RAO object which has coupon id, to recieve this value in Action Strategy you need to set this in RuleActionContext. refer line number 60

However if the RAO is already available in Facts you just need to update with updated changes. refer line number 59 for this.

Please let me know if you need any help in this regard.

Former Member
0 Kudos

Hi , Thanks a lot for your response,

But i am facing a different issue here, I am trying to fetch RuleEngineResultRao from ruleActionContext (Line no. 56) and getting null in the response.

This is something related to rule publication because when i looked into generated DRL of the rule, RuleEngineResultRao was missing from Variables. Have a look on DRL:

NOTE: i have created a new rule module and publishing rules on that only instead of Promotion module.

Thanks,

Ask a Question