Package org.drools.examples.decisiontable

Examples of org.drools.examples.decisiontable.Policy


        // typical decision tables are used statelessly
        StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();

        //now create some test data
        Driver driver = new Driver();
        Policy policy = new Policy();

        ksession.execute( Arrays.asList( new Object[]{driver, policy} ) );

        System.out.println( "BASE PRICE IS: " + policy.getBasePrice() );
        System.out.println( "DISCOUNT IS: " + policy.getDiscountPercent() );

        return policy.getBasePrice();

    }
View Full Code Here


        WorkingMemory wm = rb.newStatefulSession();
       
        //now create some test data
        Driver driver = new Driver();
        Policy policy = new Policy();
       
        wm.insert(driver);
        wm.insert(policy);
       
        wm.fireAllRules();
       
        System.out.println("BASE PRICE IS: " + policy.getBasePrice());
        System.out.println("DISCOUNT IS: " + policy.getDiscountPercent( ));
       
        return policy.getBasePrice();
    }
View Full Code Here

TOP

Related Classes of org.drools.examples.decisiontable.Policy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.