Menu

Menu Rule Engine isn't exist.

2009-04-05
2013-03-07
  • Peter Shepetko

    Peter Shepetko - 2009-04-05

    Hi,
    I have AdempiereTrunk rel.8953 and AdempiereLibero rel.8939.
    I tested  Libero HR & Payroll (as http://adempiere.com/wiki/index.php/Sponsored_Development:_Libero_HR_%26_Payroll#Testers\) and I can't setup Rule Engine because menu Rule Engine isn't exist.
    Help me pls.

    Peter Shepetko

     
    • Cristina Ghita

      Cristina Ghita - 2009-04-05

      Hi Peter,

      To setup a rule engine you have to log in as System and you will find Rule in Application Dictionary.

      Regards,
      Cristina Ghita - www.arhipac.ro

       
      • Peter Shepetko

        Peter Shepetko - 2009-04-06

        Dear Cristina,
        I should create Rule Engine  or use Rule in Application Dictionary for Libero HR?

        Rule Engine Implementation
        From AdempiereWiki
        Jump to: navigation, search
        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:
        o    Value
        o    Name
        o    Description
        o    Rule Engine Type
        o    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]))
        )

        Peter Shepetko

         
        • Cristina Ghita

          Cristina Ghita - 2009-04-06

          Hi,

          NO! You have to use Rule.

          E.g.

          You have one concept HR_C1 which type is concept and another HR_C2 that is Rule Engine. Lets say that HR_C2 apply a percent on HR_C1.

          So, in rule you do like this:

          Name: beanshell:HR_C2

          Event Type: Process

          Rule Type: JSR 223 Scripting APIs

          Script:
                     double c = getConcept("HR_C1");
                     result = c*75/100;

          Regards,
          Cristina Ghita - www.arhipac.ro

           
    • Peter Shepetko

      Peter Shepetko - 2009-04-14

      Thanks.
      I have the Development project based line level Task.
      The project has a human resource: Developer.
      He worked 8 hours * 20 дней=160 hours in current month.
      This field Planned Quantity in form Project-Phase-Task-Task line.
      In DD this field Plannedqty in table C_ProjectLine.
      Help me to please take this value and to increase by cost of hour (sample concept HR_C5).

      Peter shepetko

       
  • Jahn Andy

    Jahn Andy - 2011-06-22

    Hi Cristina,

    I attempted to create a rule as your example mentioned above but got an error:

    Wrong Script Value - format for JSR 223 Script must be engine:scriptName where supported engines must be something like groovy, jython, beanshell

    However, rule saved with JSR 94 and Aspect One…
    Also, would you please recommend some sites where I can learn about beanshell or groovy that could be used in the rule window?

    Thank you,
    Jahn

     

Log in to post a comment.