Rule syntax
Rules are written in Drools, a programming language commonly used for defining business rules and logic. All rules need to follow the "when-then" format. If you do not adhere to this format, you will not be able to save your changes.
Rule skeleton:
rule "<Rule Group>.<Rule Unit>.<Rule Number>: <Rule Name>" when // Define the target layout element for the information extraction then // Apply information extraction commands end
Rule naming conventions
Rule Group, Rule Unit, and Rule Number form the Rule Identifier.
Rule Group | alphanumerical |
Rule Unit | number |
Rule Number | number |
![]() |
Rule identifier
Rule identifier requirements:
The Rule Identifier must be unique in the rule file.
The Rule Identifier used in the rule must match the Rule Identifier in the rule name.
Example:
Rule identifier in the rule
Rule naming examples:
CP.1.0: Batch Number
CP.1.1: Batch Number from CoA
CP.1.2: Batch Number from Substances
CP.2.0: Plant species
CP.2.1: Species from Botanical Conservation
CP.2.2: Species from Cultivation Practices