Skip to main content

DocuMine Documentation

Execution flow parameters

The rule engine simultaneously evaluates the “when” blocks of all rules within the engine. The flow parameters that allow for conflict resolution determine the execution order of the “then” parts. For further information, please see Rule engine basics.

Salience

Salience is the main execution flow parameter. It is specified as an integer below the rule name and above the “when” section.

Rules with a higher salience value are given higher priority. If no salience is provided, the salience is set to 0 by default. If you want a rule to be triggered after the rules with default salience, you can express the salience as a negative value.

If two rules have the same salience, the rules are executed in the order they are written in the rule editors' file.

rule "PerformingLaboratory.0.2: Performing Laboratory not found"
    salience -1
    when
        not Component(name == "Performing_Laboratory")
    then
        componentCreationService.create("PerformingLaboratory.0.2", "Performing_Laboratory", "", "fallback");
    end
Agenda groups

Agenda groups are another flow parameter that allows grouping a set of rules. Rules that are part of an agenda group that is in focus are executed with priority. Salience determines the executing order within an agenda group.

If no agenda group is specified, the rules default to the 'DEFAULT' agenda group. The focus of the entity rules is set to 'LOCAL_DICTIONARY_ADDS', and that of the component rules is set to 'DEFAULT'.

Example:

rule "CBI.11.0: Annotate all CBI_author entities in Table with Vertebrate Study Y/N Header"
    agenda-group "LOCAL_DICTIONARY_ADDS"
    salience -1
    when
      $table: ...