From 52fbb97a7cd6a40c9aff723fb7c745ea76c691bb Mon Sep 17 00:00:00 2001 From: Toshiya Kobayashi Date: Tue, 5 Mar 2024 17:08:06 +0900 Subject: [PATCH] [incubator-kie-drools#5752] [docs] Add explanation for DRL declared Rule Unit (#5755) --- .../modules/ROOT/pages/language-reference/_drl-rules.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drools-docs/src/modules/ROOT/pages/language-reference/_drl-rules.adoc b/drools-docs/src/modules/ROOT/pages/language-reference/_drl-rules.adoc index 07aefbce971..17904986f65 100644 --- a/drools-docs/src/modules/ROOT/pages/language-reference/_drl-rules.adoc +++ b/drools-docs/src/modules/ROOT/pages/language-reference/_drl-rules.adoc @@ -144,6 +144,11 @@ rule "Using a rule unit with a declared type" end ---- +[NOTE] +==== +If you declare a rule unit in DRL, the rule unit class will be generated by {PRODUCT} at build time. It means that you can't refer to the class in your client codes. Declared rule units are only useful when the client is also auto-generated, for example, REST endpoint generation by Drools-Quarkus integration. +==== + To separate the fact types from the rule unit for use with other DRL rules, you can declare the types in a separate DRL file and then use the DRL rule file to declare the data sources by using the `RuleUnitData` interface implementation: .Example DRL type declaration as a separate file