Rule Engine Implementation

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

This my idea to implement the Rule & Engine into ADempiere

Fist we need create new model data into Application Dictionary:

  • Table AD_Rule_Engine
  • Fields:
    • Value
    • Name
    • Description
    • Rule Engine Type
    • Script

DDL Script

CREATE TABLE adempiere.ad_rule_engine
(
 ad_client_id numeric(10) NOT NULL,
 ad_org_id numeric(10) NOT NULL,
 ad_rule_engine_id numeric(10) NOT NULL,
 created timestamp without time zone NOT NULL,
 createdby numeric(10) NOT NULL,
 description character varying(255),
 isactive character(1) NOT NULL,
 name character varying(60) NOT NULL,
 rule_engine_type character varying(2),
 script character varying(4000),
 updated timestamp without time zone NOT NULL,
 updatedby numeric(10) NOT NULL,
 value character varying(40),
 CONSTRAINT ad_rule_engine_key PRIMARY KEY (ad_rule_engine_id),
 CONSTRAINT ad_rule_engine_isactive_check CHECK (isactive = ANY (ARRAY['Y'::bpchar, 'N'::bpchar]))
) 



New Windows into Application Dictionary

  • Windows Name : Rule Engine
  • Fields
    • Search Key : Value to search to Rule
    • Name : Name of Rule
    • Description: Description detail the rule
    • Rule Engine Type :
      • Bash Shell (Allow execute a rule based in this language script)
      • SQL (Will Allow execute a rule based in SQL standard)
      • AOP (Will Allow execute a rule based in AOP)
    • Script : Script logic to Rule Engine Type

Screenshot

RuleEngine.jpg

Here you can review how I am implement bash Shell in Payroll

MHRProcess