Package org.drools.common

Examples of org.drools.common.InternalWorkingMemory


        return new ReteStatelessSessionResult( wm,
                                               globalResolver );
    }

    public StatelessSessionResult executeWithResults(Object[] array) {
        InternalWorkingMemory wm = newWorkingMemory();

        for ( int i = 0, length = array.length; i < length; i++ ) {
            wm.insert( array[i] );
        }
        wm.fireAllRules( this.agendaFilter );

        GlobalResolver globalResolver = null;
        if ( this.globalExporter != null ) {
            globalResolver = this.globalExporter.export( wm );
        }
View Full Code Here


        return new ReteStatelessSessionResult( wm,
                                               globalResolver );
    }

    public StatelessSessionResult executeWithResults(Collection collection) {
        InternalWorkingMemory wm = newWorkingMemory();

        for ( Iterator it = collection.iterator(); it.hasNext(); ) {
            wm.insert( it.next() );
        }
        wm.fireAllRules( this.agendaFilter );

        GlobalResolver globalResolver = null;
        if ( this.globalExporter != null ) {
            globalResolver = this.globalExporter.export( wm );
        }
View Full Code Here

    public void attach(final InternalWorkingMemory[] workingMemories) {
        attach();

        for ( int i = 0, length = workingMemories.length; i < length; i++ ) {
            final InternalWorkingMemory workingMemory = workingMemories[i];
            final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(),
                                                                                      PropagationContext.RULE_ADDITION,
                                                                                      null,
                                                                                      null,
                                                                                      null );
            this.rightInput.updateSink( this,
View Full Code Here

    public void attach(final InternalWorkingMemory[] workingMemories) {
        attach();

        for ( int i = 0, length = workingMemories.length; i < length; i++ ) {
            final InternalWorkingMemory workingMemory = workingMemories[i];
            final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(),
                                                                                      PropagationContext.RULE_ADDITION,
                                                                                      null,
                                                                                      null,
                                                                                      null );
            this.source.updateSink( this,
View Full Code Here

  public ProcessInstance readProcessInstance(MarshallerReaderContext context)
      throws IOException {
    ObjectInputStream stream = context.stream;
        InternalRuleBase ruleBase = context.ruleBase;
        InternalWorkingMemory wm = context.wm;

        RuleFlowProcessInstance processInstance = new RuleFlowProcessInstance();
        processInstance.setId( stream.readLong() );
        String processId = stream.readUTF();
        processInstance.setProcessId( processId );
View Full Code Here

    public void attach(final InternalWorkingMemory[] workingMemories) {
        attach();

        for ( int i = 0, length = workingMemories.length; i < length; i++ ) {
            final InternalWorkingMemory workingMemory = workingMemories[i];
            final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(),
                                                                                      PropagationContext.RULE_ADDITION,
                                                                                      null,
                                                                                      null,
                                                                                      null );
            this.tupleSource.updateSink( this,
View Full Code Here

    public void attach(final InternalWorkingMemory[] workingMemories) {
        attach();

        for ( int i = 0, length = workingMemories.length; i < length; i++ ) {
            final InternalWorkingMemory workingMemory = workingMemories[i];
            final PropagationContext propagationContext = new PropagationContextImpl( workingMemory.getNextPropagationIdCounter(),
                                                                                      PropagationContext.RULE_ADDITION,
                                                                                      null,
                                                                                      null,
                                                                                      null );
            this.tupleSource.updateSink( this,
View Full Code Here

        context.put( BUILD_CONTEXT,
                     buildContext );
        context.put( "ClassFieldAccessorStore",
                     this.reteTesterHelper.getStore() );

        InternalWorkingMemory wm = (InternalWorkingMemory) rbase.newStatefulSession( true );
        context.put( WORKING_MEMORY,
                     wm );
        return context;
    }
View Full Code Here

    }

    public Map<String, Object> run(Map<String, Object> context,
                                   List<DslStep> steps,
                                   NodeTestResult result) {
        InternalWorkingMemory wm = (InternalWorkingMemory) context.get( WORKING_MEMORY );
        for ( DslStep step : steps ) {
            String name = step.getName();
            Object object = this.steps.get( name );
            if ( object != null && object instanceof Step ) {
                Step stepImpl = (Step) object;
View Full Code Here

        str += "    otn1,[h1, h3];\n";

        NodeTestResult result = executeTest( str );
        Map<String, Object> map = result.context;

        InternalWorkingMemory wm = (InternalWorkingMemory) map.get( "WorkingMemory" );

        JoinNode join1 = (JoinNode) map.get( "join1" );

        BetaMemory memory = (BetaMemory) wm.getNodeMemory( join1 );
        assertEquals( 2,
                      memory.getRightTupleMemory().size() );

        assertEquals( 2,
                      memory.getLeftTupleMemory().size() );
View Full Code Here

TOP

Related Classes of org.drools.common.InternalWorkingMemory

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.