BartoBarto
BartoBarto

Reputation: 113

Drools Rule Language from Java API

Platform that I use requires Drools Rule Language (DRL), but for me more convenient thing is to create rules in Java API.

Is there any way to create rules in Java API, and then convert/transfer it to DRL?

Thx for answer.

Upvotes: 7

Views: 1463

Answers (1)

Edson Tirelli
Edson Tirelli

Reputation: 3901

Drools does have a fluent API for building rules as Geoffrey mentioned, but it is not in the public API. You can use and it has been stable for several years now, but you need to be aware that there might be changes over time due to features being added to the engine.

The API is used by the Drools parser itself. Here are some unit tests that you can use as examples:

https://github.com/droolsjbpm/drools/blob/6.3.x/drools-compiler/src/test/java/org/drools/compiler/lang/api/DescrBuilderTest.java#L451-L465

Upvotes: 5

Related Questions