Apply Advanced Rules

This handler (com.rierino.handler.drools.DroolsProcessEventHandler) provides ability to execute business rules using Drools BRMS library

Handler Parameters

This handler is cacheable.

Parameter
Definition
Example
Default

config.state

Name of the state manager with rule domain configurations

ruledomain

-

domain

Name of the rule domain

product_discount

-

rules.state

Name of the state manager with rule definitions

rule_product_discount

-

buffer

Number of records to buffer before producing output for batch requests

100

-

Example Drools Handler Definition (Can be Imported on Element Screen)

This handler requires the following dependency added to deployment contents:

implementation (group:'com.rierino.custom', name: 'drools', version:"${rierinoVersion}")

Actions

Process / ProcessRules

Passes on structured request data to Drools and returns rule evaluation results in the output. Event metadata fields applicable for this action are as follows:

Field
Definition
Example
Default

inputElement

Json path for the input in request event payload

basket

-

outputElement

Json path for the output in response event payload

basket

-

With event metadata parameters as:

Parameter
Definition
Example
Default

inputPattern

JMESPath pattern to apply on data input

{items:items.productid}

-

outputPattern

JMESPath pattern to apply on data output, before returning response

{totalPrice:basket.totalPrice}

-

forEach

Field for each a separate record should be passed on to Drools

items

-

forEachMap

Json pattern for mapping each record that should be passed on to Drools, allowing replication of common data

-

-

Roles

processPulse

Passes a Json object with "id" field to Drools for evaluating rules, without returning any response.

processJournal

Follows the same flow as processPulse.

processRole

Passes a Json object with full role data to Drools for evaluating rules, without returning any response.

Commands

PROCESSID

Follows the same flow as processPulse, passing "id" field of the command parameters.

Last updated