问题
I have a scenario in Drools. I have some set of rules. For Example :
In Rule 1: I am setting ProductName in the fact pojo that comes from session after some condition. In Rule 2: I am calculating grade value i.e. X1,X2,X3,X4. So for each grade I have single rule to calculate.
The Fact pojo that is coming from User may ask to calculate any grade value. However, say user asked for X4, then all the grade value from X1 to X3 should also be calculated.
What I did is that whenever any rule is executed; in then condition I am updating a fact that is holding a grade value property and in the last one single rule is written that will check for matching of the grade that is incoming from Pojo and executed rule grade.
However, it is not stopping on the particuler grade and executing all the grade value.
Please suggest some way.
========Edit=======
Rule Calculate X when seq == true then calculate X;
Rule Calculate x1 when seq == true then calculate X1; Rule Calculate x2 when seq == true then calculate X2;
Say if I asked to calculate X2, then rule x and x1 should also be calculated. If x1 then rule x and x1 should only execute.
Thanks Kumar Shorav
来源:https://stackoverflow.com/questions/26322576/stop-rules-on-update-facts-drools