I am trying to migrate an existing ILOG JRules based application to Drools based project. In ILOG we have local variables (and variable set) which can be used to calculate and store intermediate values within rules (formulas).
Is there an equivalent of local variables in Drools? I know we have Globals in Drools but the documentation suggest to use Globals only as read only constants and to pass data between Java calling class to rules:
It is strongly discouraged to set or change a global value from inside your rules. We recommend to you always set the value from your application using the working memory interface.
One approach would be to write a custom java class Variable
and declare all variables within it and use it in drools rules. But that would need a java code change everytime we want to add a new variable.
Is there any feasible method of defining and using variables in Drools which can be defined and altered within rules?