Rules accumulator

    Drools is the present rule engine implementation and its can be referenced for use by this transform. Drools documentation

    Once all incoming rows have been collected by the Rules Accumulator transform (e.g. - the previous transform shuts down) the rows are transformed into Rules.Row objects and passed into the rules engine to be executed against the given rule set.

    Rules.Row is defined as a key / value Map of fields where key is the name of the field and value is the value of the field; as well as the externalSource boolean property to indicate whether the Rules.Row object was created in the rule set or injected from an external source.

    Fields of a row are accessed as “Row (column[“<fieldname>”])”.

    The Rules tab is where you enter your rule definition or a reference to the rule file..

    Rules result Tab

    Rules result tab defines the layout of the Rules output fields.

    All Rule Definitions should contain “import org.apache.hop.pipeline.transforms.drools.Rules.Row;” to give access to the Rules.Row class.

    For the input with a row meta: name (String), position (Integer), color (String); a Rules.Row object will be created for each row with a Map containing those fields.

    Rules can be defined and applied:

    Rules.Row objects can be checked as in the above’s left hand side.

    The transform can be told what fields to pickup from the generated row objects by defining the field Map’s name in the transform’s Results tab. Type conversions can be applied by setting the Result column type as well.