Examples of ReteooStatefulSession


Examples of org.drools.reteoo.ReteooStatefulSession

       
      CommandService commandService = ((SessionConfiguration) conf).getCommandService(this, environment);
      if (commandService != null) {
      return new CommandBasedStatefulKnowledgeSession(commandService);
      } else {
        ReteooStatefulSession session = (ReteooStatefulSession) this.ruleBase.newStatefulSession( (SessionConfiguration) conf,
                                                                                                  environment );
        return new StatefulKnowledgeSessionImpl( session, this );
      }
    }   
View Full Code Here

Examples of org.drools.reteoo.ReteooStatefulSession

        DefaultAgenda agenda = new DefaultAgenda( context.ruleBase,
                                                  false );
        readAgenda( context,
                    agenda );
        ReteooStatefulSession session = new ReteooStatefulSession( id,
                                                                   context.ruleBase,
                                                                   executor,
                                                                   handleFactory,
                                                                   initialFactHandle,
                                                                   propagationCounter,
                                                                   config, 
                                                                   agenda,
                                                                   environment );

        // RuleFlowGroups need to reference the session
        for ( RuleFlowGroup group : agenda.getRuleFlowGroupsMap().values() ) {
            ((RuleFlowGroupImpl) group).setWorkingMemory( session );
        }
        context.wm = session;

        readFactHandles( context );

        readActionQueue( context );

        if ( context.readBoolean() ) {
            readTruthMaintenanceSystem( context );
        }

        if ( context.marshalProcessInstances ) {
            readProcessInstances( context );
        }

        if ( context.marshalWorkItems ) {
            readWorkItems( context );
        }

        readTimers( context );

        if( multithread ) {
            session.startPartitionManagers();
        }

        return session;
    }   
View Full Code Here

Examples of org.drools.reteoo.ReteooStatefulSession

        int id = ((ReteooRuleBase) ((KnowledgeBaseImpl) this.kbase).ruleBase).nextWorkingMemoryCounter();
        RuleBaseConfiguration conf = ((ReteooRuleBase) ((KnowledgeBaseImpl) this.kbase).ruleBase).getConfiguration();
        ExecutorService executor = ExecutorServiceFactory.createExecutorService( conf.getExecutorService() );

        ReteooStatefulSession session = InputMarshaller.readSession( context,
                                                                     id,
                                                                     executor,
                                                                     environment,
                                                                     (SessionConfiguration) config );
        executor.setCommandExecutor( new CommandExecutor( session ) );
View Full Code Here

Examples of org.drools.reteoo.ReteooStatefulSession

        this.name = name;
        this.exitPoint = exitPoint;
    }

    public Object execute(ReteooWorkingMemory session) {
        ReteooStatefulSession reteooStatefulSession = (ReteooStatefulSession) session;

        reteooStatefulSession.registerExitPoint( name,
                                                 exitPoint );

        return null;
    }
View Full Code Here

Examples of org.drools.reteoo.ReteooStatefulSession

    public UnregisterExitPointCommand(String name) {
        this.name = name;
    }

    public Object execute(ReteooWorkingMemory session) {
        ReteooStatefulSession reteooStatefulSession = (ReteooStatefulSession) session;

        reteooStatefulSession.unregisterExitPoint( name );

        return null;
    }
View Full Code Here

Examples of org.drools.reteoo.ReteooStatefulSession

    public GetFactHandlesCommand(ObjectFilter filter) {
        this.filter = filter;
    }

    public Collection< ? extends FactHandle> execute(ReteooWorkingMemory session) {
        ReteooStatefulSession reteooStatefulSession = (ReteooStatefulSession) session;

        if ( filter != null ) {
            return new ObjectStoreWrapper( reteooStatefulSession.getObjectStore(),
                                           null,
                                           ObjectStoreWrapper.FACT_HANDLE );
        } else {
            return new ObjectStoreWrapper( reteooStatefulSession.getObjectStore(),
                                           filter,
                                           ObjectStoreWrapper.FACT_HANDLE );
        }
    }
View Full Code Here

Examples of org.drools.reteoo.ReteooStatefulSession

        DefaultAgenda agenda = new DefaultAgenda( context.ruleBase,
                                                  false );
        readAgenda( context,
                    agenda );
        ReteooStatefulSession session = new ReteooStatefulSession( id,
                                                                   context.ruleBase,
                                                                   executor,
                                                                   handleFactory,
                                                                   initialFactHandle,
                                                                   propagationCounter,
                                                                   config,
                                                                   agenda,
                                                                   environment );
        new StatefulKnowledgeSessionImpl( session );

        initialFactHandle.setEntryPoint( session.getEntryPoints().get( EntryPoint.DEFAULT.getEntryPointId() ) );

        return readSession( session,
                            agenda,
                            time,
                            multithread,
View Full Code Here

Examples of org.drools.reteoo.ReteooStatefulSession

     */
    public static ReteooStatefulSession readSession(MarshallerReaderContext context,
                                                    int id,
                                                    ExecutorService executor) throws IOException,
                                                                             ClassNotFoundException {
        ReteooStatefulSession session = readSession( context,
                                                     id,
                                                     executor,
                                                     EnvironmentFactory.newEnvironment(),
                                                     SessionConfiguration.getDefaultInstance() );
        return session;
View Full Code Here

Examples of org.drools.reteoo.ReteooStatefulSession

                                                    SessionConfiguration config) throws IOException,
                                                                                ClassNotFoundException {

        ProtobufMessages.KnowledgeSession _session = loadAndParseSession( context );

        ReteooStatefulSession session = createAndInitializeSession( context,
                                                                    id,
                                                                    executor,
                                                                    environment,
                                                                    config,
                                                                    _session );

        return readSession( _session,
                            session,
                            (DefaultAgenda) session.getAgenda(),
                            context );
    }
View Full Code Here

Examples of org.drools.reteoo.ReteooStatefulSession

                                                  false );
        readAgenda( context,
                    _session.getRuleData(),
                    agenda );

        ReteooStatefulSession session = new ReteooStatefulSession( id,
                                                                   context.ruleBase,
                                                                   executor,
                                                                   handleFactory,
                                                                   initialFactHandle,
                                                                   0,
                                                                   config,
                                                                   agenda,
                                                                   environment );
        new StatefulKnowledgeSessionImpl( session );

        initialFactHandle.setEntryPoint( session.getEntryPoints().get( EntryPoint.DEFAULT.getEntryPointId() ) );
        return session;
    }
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.