简体   繁体   English

从Java API中删除规则语言

[英]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. 我使用的平台需要Drools Rule Language(DRL),但对我来说更方便的是在Java API中创建规则。

Is there any way to create rules in Java API, and then convert/transfer it to DRL? 有没有办法在Java API中创建规则,然后将其转换/转移到DRL?

Thx for answer. 谢谢答案。

Drools does have a fluent API for building rules as Geoffrey mentioned, but it is not in the public API. 正如杰弗里所提到的,Drools确实有一个流畅的API来构建规则,但它不在公共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. 该API由Drools解析器本身使用。 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 https://github.com/droolsjbpm/drools/blob/6.3.x/drools-compiler/src/test/java/org/drools/compiler/lang/api/DescrBuilderTest.java#L451-L465

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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