In the same way constants can be referenced in the when/then portion of a rule, and is it possible to use a string constant from a java file as the rule name?
The use case is we are refactoring our drools rules src and test files to clean up some bad design decisions made earlier in the project.
We would like to fire a specific rule in tests(currently we are setting up the fact objects under test to be in a fully valid state, then altering the field that we want to test as part of the unit tests "arrange" step, followed by firing all rules driven by a stateless kieSession object. Naturally these make testing harder than it should be - for example if a field is missed that's not the one under test, a completely different rule may cause an error other than what's under the test, giving us false negatives).
One of our ideas was to make use of a stateful kiesession for testing combined with an agenda filter that would match rules based on their name.
What we want to do is have the drl files use strings stored in a java file which would be stored alongside the drl files and referenced from the tests, enabling the specific rule to be fired by passing the shared constant to the agenda filter along with setting just the field of the fact object under test rather than maintaining ways of creating full, valid objects.
Thus far I've seen some posts on accessing the rule name from within the rule itself, using constants for other sections of the rule block etc, but little around the above issue.
Is this something that drools allows? Or is there another way to retrieve the rule names from outside of the files for use as a test parameter?