Can we represent loops in the rules? #121
Unanswered
karthik6244
asked this question in
Q&A
Replies: 1 comment
-
Assuming you are using at list or array. As for full-fledged support for looping, it is not possible via expression. You can write a utils class with a method to do looping for you and inject it in RulesEngine. You can refer it here - https://github.com/microsoft/RulesEngine/wiki/Getting-Started#resettings |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Say a complex object is there I want to iterate over that object and apply rule on one property, is this possible?
"Rules": [
{
"RuleName": "GiveDiscount10",
"SuccessEvent": "10",
"ErrorMessage": "One or more adjust rules failed.",
"ErrorType": "Error",
"RuleExpressionType": "LambdaExpression",
"Expression": "Loop through Complexobject AND input1.country == "india" AND input1.loyalityFactor <= 2 AND input1.totalPurchasesToDate >= 5000"
},
Beta Was this translation helpful? Give feedback.
All reactions