I come to you because i have an issue that i don't know if what i want to do is possible actually with easyrule and if or if it isn't a good practice to do that with a rule engine like this..
I'm actually trying to fire rules like that ( from yml file like you will see, its not a real business case just an exemple for showing what i wants to do in my project) :
name: test single
description: A single man doesnt got a wife
priority: 1
condition: "' person.wife == null"
actions:
"result = Type.Single"
name: test parent
description: A parent have a least 1 child
priority: 1
condition: "'CollectionUtils.isNotEmpty(person.childs)"
actions:
"res = Type.Parent"
(in this exemple Type is an Enum)
The "result " is what i want to obtain after easy rule execution, i want that when a rule fire, a result is returned.
In 3.2 version i just had to initialize the fact result with a default value and then my rules changed it and i just had to do re facts.get('myFactName') and i had what i expected but now in 4.X version Fact is final so we cant change a setted value from mvl action.. so my question is : how can i have a result when a rule is checked as true (iv skipOnFirstAppliedRules) ?
In every exemples i saw it's talking about loging semeothing..hello wold.. but never returning a boolean, a String, an object ..
I watched the API doc and other github issues and tried some things with listener but i never found a way to get a result as Objet from the action triggered in a mvl yaml file rule. Could you please help me ? Thank you
Hello,
I come to you because i have an issue that i don't know if what i want to do is possible actually with easyrule and if or if it isn't a good practice to do that with a rule engine like this..
I'm actually trying to fire rules like that ( from yml file like you will see, its not a real business case just an exemple for showing what i wants to do in my project) :
name: test single description: A single man doesnt got a wife priority: 1 condition: "' person.wife == null" actions:
"result = Type.Single"
name: test parent description: A parent have a least 1 child priority: 1 condition: "'CollectionUtils.isNotEmpty(person.childs)" actions:
(in this exemple Type is an Enum)
The "result " is what i want to obtain after easy rule execution, i want that when a rule fire, a result is returned. In 3.2 version i just had to initialize the fact result with a default value and then my rules changed it and i just had to do re facts.get('myFactName') and i had what i expected but now in 4.X version Fact is final so we cant change a setted value from mvl action.. so my question is : how can i have a result when a rule is checked as true (iv skipOnFirstAppliedRules) ?
In every exemples i saw it's talking about loging semeothing..hello wold.. but never returning a boolean, a String, an object .. I watched the API doc and other github issues and tried some things with listener but i never found a way to get a result as Objet from the action triggered in a mvl yaml file rule. Could you please help me ? Thank you