简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM