Package org.drools.examples.buspass

Source Code of org.drools.examples.buspass.BussPassBadExample

package org.drools.examples.buspass;

import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;

public class BussPassBadExample {
    public static void main(final String[] args) {
        KieContainer kc = KieServices.Factory.get().getKieClasspathContainer();
        KieSession ksession = kc.newKieSession("BussPassBadKS");

        Person p = new Person("Yoda", 15);
        FactHandle fh = ksession.insert(p);
        ksession.fireAllRules();

        p.setAge( 16 );
        ksession.update( fh, p );
        ksession.fireAllRules();

        ksession.dispose(); // Stateful rule session must always be disposed when finished
    }
}
TOP

Related Classes of org.drools.examples.buspass.BussPassBadExample

TOP
Copyright © 2018 www.massapi.com. 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.