Package org.kie.api.runtime

Examples of org.kie.api.runtime.Globals


                      facts.size() );
    }

    private KieSession marsallStatefulKnowledgeSession(KieSession ksession) throws IOException,
                                                                                                       ClassNotFoundException {
        Globals globals = ksession.getGlobals();

        KieBase kbase = ksession.getKieBase();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        MarshallerFactory.newMarshaller( kbase ).marshall( out,
View Full Code Here


     * @param message the message
     * @param operation the operation
     * @param session the session
     */
    public static void setGlobals(Message message, KnowledgeOperation operation, KnowledgeSession session) {
        Globals globals = session.getGlobals();
        if (globals != null) {
            Map<String, Object> globalsMap = new HashMap<String, Object>();
            globalsMap.put(GLOBALS, new ConcurrentHashMap<String, Object>());
            Map<String, Object> expressionMap = getMap(message, operation.getGlobalExpressionMappings(), null);
            if (expressionMap != null) {
                globalsMap.putAll(expressionMap);
            }
            for (Entry<String, Object> globalsEntry : globalsMap.entrySet()) {
                globals.set(globalsEntry.getKey(), globalsEntry.getValue());
            }
        }
    }
View Full Code Here

     * @return the global variables
     */
    protected Map<String, Object> getGlobalVariables(KnowledgeSession session) {
        Map<String, Object> globalVariables = new HashMap<String, Object>();
        if (session != null) {
            Globals globals = session.getGlobals();
            if (globals != null) {
                for (String key : globals.getGlobalKeys()) {
                    Object value = globals.get(key);
                    globalVariables.put(key, value);
                }
            }
        }
        return globalVariables;
View Full Code Here

        this.environment = environment;

        nodeMemories = new ConcurrentNodeMemories(this.ruleBase);
        actionQueue = new ConcurrentLinkedQueue<WorkingMemoryAction>();

        Globals globals = (Globals) this.environment.get(EnvironmentName.GLOBALS);
        if (globals != null) {
            if (!(globals instanceof GlobalResolver)) {
                this.globalResolver = new GlobalsAdapter(globals);
            } else {
                this.globalResolver = (GlobalResolver) globals;
View Full Code Here

        this.environment = environment;

        nodeMemories = new ConcurrentNodeMemories(this.ruleBase);
        actionQueue = new ConcurrentLinkedQueue<WorkingMemoryAction>();

        Globals globals = (Globals) this.environment.get(EnvironmentName.GLOBALS);
        if (globals != null) {
            if (!(globals instanceof GlobalResolver)) {
                this.globalResolver = new GlobalsAdapter(globals);
            } else {
                this.globalResolver = (GlobalResolver) globals;
View Full Code Here

        this.environment = environment;

        nodeMemories = new ConcurrentNodeMemories(this.kBase);
        actionQueue = new ConcurrentLinkedQueue<WorkingMemoryAction>();

        Globals globals = (Globals) this.environment.get(EnvironmentName.GLOBALS);
        if (globals != null) {
            if (!(globals instanceof GlobalResolver)) {
                this.globalResolver = new GlobalsAdapter(globals);
            } else {
                this.globalResolver = (GlobalResolver) globals;
View Full Code Here

        this.environment = environment;

        nodeMemories = new ConcurrentNodeMemories(this.ruleBase);
        actionQueue = new ConcurrentLinkedQueue<WorkingMemoryAction>();

        Globals globals = (Globals) this.environment.get(EnvironmentName.GLOBALS);
        if (globals != null) {
            if (!(globals instanceof GlobalResolver)) {
                this.globalResolver = new GlobalsAdapter(globals);
            } else {
                this.globalResolver = (GlobalResolver) globals;
View Full Code Here

                      facts.size() );
    }

    private KieSession marsallStatefulKnowledgeSession(KieSession ksession) throws IOException,
            ClassNotFoundException {
        Globals globals = ksession.getGlobals();

        KieBase kbase = ksession.getKieBase();

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        MarshallerFactory.newMarshaller( kbase ).marshall( out,
View Full Code Here

        this.environment = environment;

        nodeMemories = new ConcurrentNodeMemories(this.ruleBase);
        actionQueue = new ConcurrentLinkedQueue<WorkingMemoryAction>();

        Globals globals = (Globals) this.environment.get(EnvironmentName.GLOBALS);
        if (globals != null) {
            if (!(globals instanceof GlobalResolver)) {
                this.globalResolver = new GlobalsAdapter(globals);
            } else {
                this.globalResolver = (GlobalResolver) globals;
View Full Code Here

        this.environment = environment;

        nodeMemories = new ConcurrentNodeMemories(this.kBase);
        actionQueue = new ConcurrentLinkedQueue<WorkingMemoryAction>();

        Globals globals = (Globals) this.environment.get(EnvironmentName.GLOBALS);
        if (globals != null) {
            if (!(globals instanceof GlobalResolver)) {
                this.globalResolver = new GlobalsAdapter(globals);
            } else {
                this.globalResolver = (GlobalResolver) globals;
View Full Code Here

TOP

Related Classes of org.kie.api.runtime.Globals

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.