Examples of newStatefulSession()


Examples of org.drools.RuleBase.newStatefulSession()

            "</process>");
        builder.addRuleFlow(source);
        Package pkg = builder.getPackage();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( pkg );
        WorkingMemory workingMemory = ruleBase.newStatefulSession();
        List<Long> list = new ArrayList<Long>();
        workingMemory.setGlobal("list", list);

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("name", "John Doe");
View Full Code Here

Examples of org.drools.common.InternalRuleBase.newStatefulSession()

    @Test
    public void testAgendaGroupLockOnActive() {
        final InternalRuleBase ruleBase = (InternalRuleBase) RuleBaseFactory.newRuleBase();

        final ReteooWorkingMemory workingMemory = (ReteooWorkingMemory) ruleBase.newStatefulSession();
        final InternalAgenda agenda = (InternalAgenda) workingMemory.getAgenda();

        // create the agendaGroup
        final InternalAgendaGroup agendaGroup = new BinaryHeapQueueAgendaGroup( "agendaGroup",
                                                                                ruleBase );
View Full Code Here

Examples of org.drools.core.RuleBase.newStatefulSession()

        Reader source = new InputStreamReader(DebugViewsTest.class.getResourceAsStream("/debug.drl"));
        PackageBuilder builder = new PackageBuilder();
        builder.addPackageFromDrl(source);
        RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage(builder.getPackage());
        StatefulSession session = ruleBase.newStatefulSession();
        session.setGlobal("s", "String");
        List list = new ArrayList();
        list.add("Value");
        session.setGlobal("list", list);
        Entry[] globals = ((MapGlobalResolver) session.getGlobalResolver()).getGlobals();
View Full Code Here

Examples of org.drools.core.common.InternalRuleBase.newStatefulSession()

        builder.build( context, Rule.DEFAULT_CONSEQUENCE_NAME );

        InternalRuleBase ruleBase = (InternalRuleBaseRuleBaseFactory.newRuleBase();
        PropagationContextFactory pctxFactory = ruleBase.getConfiguration().getComponentFactory().getPropagationContextFactory();
        ruleBase.addPackage( pkg );
        final WorkingMemory wm = ruleBase.newStatefulSession();

        final Cheese cheddar = new Cheese( "cheddar", 10 );
        final InternalFactHandle f0 = (InternalFactHandle) wm.insert( cheddar );
        final LeftTupleImpl tuple = new LeftTupleImpl( f0, null, true );
        f0.removeLeftTuple(tuple);
View Full Code Here

Examples of org.drools.core.impl.KnowledgeBaseImpl.newStatefulSession()

        KnowledgeBaseImpl rbase = new KnowledgeBaseImpl("ID", conf);
        BuildContext buildContext = new BuildContext(rbase, rbase
                .getReteooBuilder().getIdGenerator());

        InternalWorkingMemory wm = (InternalWorkingMemory) rbase
                .newStatefulSession(true);

        // Overwrite values now taking into account the configuration options.
        context.put(BUILD_CONTEXT, buildContext);
        context.put(WORKING_MEMORY, wm);
View Full Code Here

Examples of org.drools.core.reteoo.ReteooRuleBase.newStatefulSession()

        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

Examples of org.drools.reteoo.ReteooRuleBase.newStatefulSession()

     *
     * @throws IntrospectionException
     */
    public void testLiteralConstraint() throws IntrospectionException {
        final ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
        final InternalWorkingMemory workingMemory = (InternalWorkingMemory) ruleBase.newStatefulSession();

        final ClassFieldReader extractor = store.getReader( Cheese.class,
                                                            "type",
                                                            getClass().getClassLoader() );

View Full Code Here

Examples of org.switchyard.component.common.knowledge.session.KnowledgeSessionFactory.newStatefulSession()

    private Throwable doTestResources(String xml) {
        try {
            ClassLoader loader = getClass().getClassLoader();
            BPMComponentImplementationModel model = _puller.pull(xml, loader);
            KnowledgeSessionFactory factory = KnowledgeSessionFactory.newSessionFactory(model, loader, null, null);
            KnowledgeSession session = factory.newStatefulSession(null);
            session.getStateful().startProcess("TestProcess");
            return null;
        } catch (Throwable t) {
            return t;
        }
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.