Examples of KieContainer


Examples of org.kie.api.runtime.KieContainer

    public static void main(final String[] args) {
        // KieServices is the factory for all KIE services
        KieServices ks = KieServices.Factory.get();
       
        // From the kie services, a container is created from the classpath
        KieContainer kc = ks.getKieClasspathContainer();
       
        // From the container, a session is created based on 
        // its definition and configuration in the META-INF/kmodule.xml file
        KieSession ksession = kc.newKieSession("StateAgendaGroupKS");
       
        // To setup a file based audit logger, uncomment the next line
        // KieRuntimeLogger logger = ks.getLoggers().newFileLogger( ksession, "./state" );

        final State a = new State( "A" );
View Full Code Here

Examples of org.kie.api.runtime.KieContainer

    public WumpusWorldMain() {
    }

    public void init(boolean exitOnClose) {
        KieContainer kc = KieServices.Factory.get().getKieClasspathContainer();
        final KieSession serverKsession = kc.newKieSession( "WumpusMainKS");
        final KieSession clientKsession = kc.newKieSession("WumpusClientKS");

        serverKsession.getChannels().put( "sensors", new Channel() {
            public void send(Object object) {
                clientKsession.insert( object );
                clientKsession.fireAllRules();
View Full Code Here

Examples of org.kie.api.runtime.KieContainer

import java.util.Scanner;

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

        FactHandle fh = ksession.insert( "A" );
        ksession.fireAllRules();
        pause();
View Full Code Here

Examples of org.kie.api.runtime.KieContainer

import java.util.Scanner;

public class BirdsFlyExample {
    public static void main(final String[] args) {
        KieContainer kc;
        KieSession ksession;

        try {
            System.setProperty("drools.negatable", "on");
            kc = KieServices.Factory.get().getKieClasspathContainer();
            ksession = kc.newKieSession("BirdsFlyKS");
        } catch( Exception e) {
            throw new RuntimeException( e );
        } finally {
            System.setProperty("drools.negatable", "off");
        }
View Full Code Here

Examples of org.kie.api.runtime.KieContainer

import java.util.Date;

public class CashFlowMain {

    public static void main(String[] args) throws Exception {
        KieContainer kc = KieServices.Factory.get().getKieClasspathContainer();
        KieSession ksession = kc.newKieSession( "CashFlowKS");

        AccountPeriod acp = new AccountPeriod(date( "2013-01-01"), date( "2013-03-31"));

        Account ac = new Account(1, 0);
View Full Code Here

Examples of org.kie.api.runtime.KieContainer

import java.util.Map;
import java.util.Scanner;

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

        String[] names = new String[]{"kitchen", "bedroom", "office", "livingroom"};
        Map<String,Room> name2room = new HashMap<String,Room>();

        for( String name: names ){
View Full Code Here

Examples of org.kie.api.runtime.KieContainer

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

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

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

Examples of org.kie.api.runtime.KieContainer

import java.util.Map;
import java.util.Scanner;

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

        String[] names = new String[]{"kitchen", "bedroom", "office", "livingroom"};
        Map<String,Room> name2room = new HashMap<String,Room>();

        for( String name: names ){
View Full Code Here

Examples of 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();
View Full Code Here

Examples of org.kie.api.runtime.KieContainer

import java.util.Scanner;

public class BussPassJTMSExample {
    public static void main(final String[] args) {
        KieContainer kc;
        KieSession ksession;

        try {
            System.setProperty("drools.negatable", "on");
            kc = KieServices.Factory.get().getKieClasspathContainer();
            ksession = kc.newKieSession("BussPassJTMSKS");
        } catch( Exception e) {
            throw new RuntimeException( e );
        } finally {
            System.setProperty("drools.negatable", "off");
        }
View Full Code Here
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.