Package org.kie.internal.command

Examples of org.kie.internal.command.Context


        this.identifier = identifier;
        this.contextName = contextName;
    }

    public Object execute(Context ctx) {       
        Context targetCtx;
        if ( this.contextName == null ) {
            targetCtx = ctx;
        } else {
            targetCtx = ctx.getContextManager().getContext( this.contextName );
        }
       
        return targetCtx.get( identifier);       
    }
View Full Code Here


        this.identifier = identifier;
        this.contextName = contextName;
    }

    public Object execute(Context ctx) {       
        Context targetCtx;
        if ( this.contextName == null ) {
            targetCtx = ctx;
        } else {
            targetCtx = ctx.getContextManager().getContext( this.contextName );
        }
       
        return targetCtx.get( identifier);       
    }
View Full Code Here

        this.identifier = identifier;
        this.contextName = contextName;
    }

    public Object execute(Context context) {
        Context targetCtx;
        if ( this.contextName == null ) {
            targetCtx = context;
        } else {
            targetCtx = context.getContextManager().getContext( this.contextName );
        }

        GetDefaultValue sim = (GetDefaultValue) context.get( "simulator" );

        Object o = sim.getObject();
        // for FactHandle's we store the handle on a map and the actual object as
        if ( o instanceof FactHandle ) {
            Map<String, FactHandle> handles = (Map<String, FactHandle>) targetCtx.get( "h" );
            if ( handles == null ) {
                handles = new HashMap<String, FactHandle>();
                targetCtx.set( "h",
                               handles );
            }
            handles.put( identifier,
                         (FactHandle) o );

            o = ((InternalFactHandle) o).getObject();

        }

        targetCtx.set( identifier,
                       o );

        return o;
    }
View Full Code Here

            return null;
        }
        SimulationStepImpl step = (SimulationStepImpl) this.queue.remove();
        SimulationPathImpl path = (SimulationPathImpl) step.getPath();

        Context pathContext = new ResolvingKnowledgeCommandContext( this.contexts.get( path.getName() ) );

        // increment the clock for all the registered ksessions
        for ( StatefulKnowledgeSession ksession : this.ksessions ) {
            SessionPseudoClock clock = (SessionPseudoClock) ksession.getSessionClock();
            long newTime = startTime + step.getDistanceMillis();
View Full Code Here

            return null;
        }
        SimulationStepImpl step = (SimulationStepImpl) this.queue.remove();
        SimulationPathImpl path = (SimulationPathImpl) step.getPath();

        Context pathContext = new ResolvingKnowledgeCommandContext( this.contexts.get( path.getName() ) );

        // increment the clock for all the registered ksessions
        for ( StatefulKnowledgeSession ksession : this.ksessions ) {
            SessionPseudoClock clock = (SessionPseudoClock) ksession.getSessionClock();
            long newTime = startTime + step.getDistanceMillis();
View Full Code Here

        this.identifier = identifier;
        this.contextName = contextName;
    }

    public Object execute(Context ctx) {       
        Context targetCtx;
        if ( this.contextName == null ) {
            targetCtx = ctx;
        } else {
            targetCtx = ctx.getContextManager().getContext( this.contextName );
        }
       
        return targetCtx.get( identifier);       
    }
View Full Code Here

        this.identifier = identifier;
        this.contextName = contextName;
    }

    public Object execute(Context context) {
        Context targetCtx;
        if ( this.contextName == null ) {
            targetCtx = context;
        } else {
            targetCtx = context.getContextManager().getContext( this.contextName );
        }

        GetDefaultValue sim = (GetDefaultValue) context.get( "simulator" );

        Object o = sim.getObject();
        // for FactHandle's we store the handle on a map and the actual object as
        if ( o instanceof FactHandle ) {
            Map<String, FactHandle> handles = (Map<String, FactHandle>) targetCtx.get( "h" );
            if ( handles == null ) {
                handles = new HashMap<String, FactHandle>();
                targetCtx.set( "h",
                               handles );
            }
            handles.put( identifier,
                         (FactHandle) o );

            o = ((InternalFactHandle) o).getObject();

        }

        targetCtx.set( identifier,
                       o );

        return o;
    }
View Full Code Here

    public void setCommandExecutionHandler(CommandExecutionHandler executionHandler) {
        this.executionHandler = executionHandler;
    }
   
    public Context createContext(String identifier) {
        Context ctx = this.contexts.getidentifier );
        if ( ctx == null ) {
            ctx = new ContextImpl( identifier, this, root );
            this.contexts.putidentifier, ctx );
        }
       
View Full Code Here

TOP

Related Classes of org.kie.internal.command.Context

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.