Skip to main content

DocuMine Documentation

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_.png

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_rule_1_2.png

    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