Reputation: 2549
I see classes like org.drools.lang.api.PackageDescrBuilder
and org.drools.lang.api.impl.RuleDescrBuilderImpl
to create rules programmatically, but I don't see any examples of that.
Basically user will create a rule and upload the file to a location. I have read these rule files and set rule attributes like date-effective, date-expires, enabled etc.
As per org.drools.rule.Rule
api, there are methods to set, but I don't get any idea on how to read the rule.drl file and convert it to object of type org.drools.rule.Rule
.
Any idea on this or how to modify a drools rule using drools api will be useful.
Note: I don't want to do string replacement for modifying a rule.
Upvotes: 0
Views: 2093
Reputation: 9480
You could take a look at the tests for the PackageBuilder:
... which has examples of doing this.
Upvotes: 1