Examples of executeWithResults()


Examples of org.drools.StatelessSession.executeWithResults()

        StatelessSession s = rb.newStatelessSession();
        Collection<Object> facts = new LinkedList<Object>();
        facts.add(new String("ping"));
        System.out.print("ping...");
        StatelessSessionResult result = s.executeWithResults(facts);
        for (Iterator it = result.iterateObjects(); it.hasNext();) {
            Object o = it.next();
            if (o instanceof String) {
                System.out.println(((String) o));
            }
View Full Code Here

Examples of org.drools.StatelessSession.executeWithResults()

     *             on illegal rule session state.
     */
    public List executeRules(final List objects,
                             final ObjectFilter filter) throws InvalidRuleSessionException {
        StatelessSession session = newStatelessSession();
        StatelessSessionResult results = session.executeWithResults( objects );
       
        return IteratorToList.convert( results.iterateObjects( new ObjectFilterAdapter( filter ) ) );
    }
   
    public int getType() throws InvalidRuleSessionException {
View Full Code Here

Examples of org.drools.StatelessSession.executeWithResults()

        StatelessSession session = getSession();

        // notice I don't export Cheessery
        session.setGlobalExporter( new CopyIdentifiersGlobalExporter( new String[]{"list"} ) );

        StatelessSessionResult result = session.executeWithResults( (Object) null );

        assertSame( this.list,
                    result.getGlobal( "list" ) );

        // cheesery should be null
View Full Code Here

Examples of org.drools.StatelessSession.executeWithResults()

    public void testCopyIdentifierGlobalExporterTwoValues() throws Exception {
        StatelessSession session = getSession();

        session.setGlobalExporter( new CopyIdentifiersGlobalExporter( new String[]{"list", "cheesery"} ) );

        StatelessSessionResult result = session.executeWithResults( (Object) null );

        assertSame( this.list,
                    result.getGlobal( "list" ) );

        // cheesery should be null
View Full Code Here

Examples of org.drools.StatelessSession.executeWithResults()

        StatelessSession session = getSession();

        // I've not specified any identifiers, so it should do them alll
        session.setGlobalExporter( new CopyIdentifiersGlobalExporter() );

        StatelessSessionResult result = session.executeWithResults( (Object) null );

        assertSame( this.list,
                    result.getGlobal( "list" ) );

        // cheesery should be null
View Full Code Here

Examples of org.drools.StatelessSession.executeWithResults()

        StatelessSession session = getSession();

        // I've not specified any identifiers, so it should do them alll
        session.setGlobalExporter( new ReferenceOriginalGlobalExporter() );

        StatelessSessionResult result = session.executeWithResults( (Object) null );

        assertSame( this.list,
                    result.getGlobal( "list" ) );

        // cheesery should be null
View Full Code Here

Examples of org.drools.StatelessSession.executeWithResults()

        data.add( r3 );
        data.add( r4 );
        data.add( r5 );
        data.add( r6 );

        StatelessSessionResult sessionResult = session.executeWithResults( data );

        Map<Cause, Set<Cause>> map = createOppositesMap( VerifierComponentType.RESTRICTION,
                                                         sessionResult.iterateObjects() );

        assertTrue( (TestBaseOld.causeMapContains(map,
View Full Code Here

Examples of org.drools.StatelessSession.executeWithResults()

        r2.setOrderNumber( 1 );

        data.add( r1 );
        data.add( r2 );

        StatelessSessionResult sessionResult = session.executeWithResults( data );

        Map<Cause, Set<Cause>> map = createOppositesMap( VerifierComponentType.RESTRICTION,
                                                         sessionResult.iterateObjects() );

        assertTrue( (TestBaseOld.causeMapContains(map,
View Full Code Here

Examples of org.drools.StatelessSession.executeWithResults()

        r2.setOrderNumber( 1 );

        data.add( r1 );
        data.add( r2 );

        StatelessSessionResult sessionResult = session.executeWithResults( data );

        Map<Cause, Set<Cause>> map = createOppositesMap( VerifierComponentType.RESTRICTION,
                                                         sessionResult.iterateObjects() );

        assertTrue( (TestBaseOld.causeMapContains(map,
View Full Code Here

Examples of org.drools.StatelessSession.executeWithResults()

        r2.setOrderNumber( 1 );

        data.add( r1 );
        data.add( r2 );

        StatelessSessionResult sessionResult = session.executeWithResults( data );

        Map<Cause, Set<Cause>> map = createOppositesMap( VerifierComponentType.RESTRICTION,
                                                         sessionResult.iterateObjects() );

        assertTrue( (TestBaseOld.causeMapContains(map,
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.