I'm currently using Drools in a software application to validate a significant number of data objects. The creation process involves multiple steps, and at each step, Drools rulesets are employed to validate the objects being created. These validated objects eventually become properties of the final data object.
Whenever a rule is triggered during this validation process, it necessitates user approval and is subsequently saved to the database along with the object. However, these data objects can be updated at any given time. To optimize the system, I want to prevent rules from being retriggered so that less manual approval is required if the property of the model object that was involved in calculation in the previously saved rule remains unchanged.
My requirement can be visualized into diagram as below:
Stateful session can not be used for my case since it will hode an active session for each object. My system will have millions of objects to be validated and the number keeps increasing.
To achieve this, I'm seeking a solution that allows me to save the triggered rule and its evaluation arguments or calculation processes to the database. Consequently, when the object is passed in again, I can compare the evaluation arguments or calculation processes and determine if they are the same. If they are, I can consider the rule's property as unchanged.
Unfortunately, I've hit a roadblock as I can't find a way to retrieve the evaluation arguments in Drools. Therefore, I'm inquiring if there is a way to accomplish this within the Drools framework or if there are alternative technologies that could fulfill this requirement. Any guidance would be greatly appreciated.
I read documentations, checked the source code, printed the trace logs, asked chatgpt, none of them helped.