There is no stable API for building rules from Java code. Of course, there is an API for the DRL compiler parser, but it is not stable and complex, as is the syntax of the DRL rule, which is significant.
XML was an option where at least the syntax of the left side was simple enough, which ended with 5.2 (IIRC). You can now use the full Java expression syntax and much more, combined with many different ways to write CE.
If your rules are exceptionally simple, you can find a model for rules that can be controlled using the managed API. Otherwise, a text editor (or, of course, Kie Workbench) would be the best option.
laune
source share