Package org.drools.rule

Examples of org.drools.rule.ContextEntry


                       previousDeclarations,
                       localDeclarations,
                       returnValue,
                       returnValueDescr );

        ContextEntry retValContext = returnValue.createContextEntry();

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        final InternalWorkingMemory wm = (InternalWorkingMemory) ruleBase.newStatefulSession();

        final Cheese stilton = new Cheese( "stilton",
                                           10 );

        final Cheese cheddar = new Cheese( "cheddar",
                                           10 );
        final InternalFactHandle f0 = (InternalFactHandle) wm.insert( cheddar );
        ReteTuple tuple = new ReteTuple( f0 );

        final InternalFactHandle f1 = (InternalFactHandle) wm.insert( stilton );
        tuple = new ReteTuple( tuple,
                               f1 );

        final Cheese brie = new Cheese( "brie",
                                        20 );
       
        ContextEntry ctx = returnValue.createContextEntry();
       
        assertTrue( returnValue.isAllowed( extractor,
                                           brie,
                                           tuple,
                                           wm,
View Full Code Here


        }
    }

    public ContextEntry createContextEntry() {
        if (declarations.length == 0) return null;
        ContextEntry contextEntry = new MvelContextEntry(declarations);
        if (isUnification) {
            contextEntry = new UnificationContextEntry(contextEntry, declarations[0]);
        }
        return contextEntry;
    }
View Full Code Here

     */
    @Before
    public void setUp() {
        // create mock objects
        constraint = mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mock( ContextEntry.class );

        when( constraint.createContextEntry() ).thenReturn( c );

        this.rule = new Rule( "test-rule" );
        this.context = new PropagationContextImpl( 0,
View Full Code Here

     */
    @Before
    public void setUp() {
        // create mock objects
        constraint = mock(BetaNodeFieldConstraint.class);
        final ContextEntry c = mock(ContextEntry.class);

        when(constraint.createContextEntry()).thenReturn(c);

        this.rule = new Rule("test-rule");
        this.context = new PropagationContextImpl(0,
View Full Code Here

     * Setup the BetaNode used in each of the tests
     */
    public void setUp() {
        // create mock objects
        constraint = mockery.mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mockery.mock( ContextEntry.class );
       
        // set mock objects expectations
        mockery.checking( new Expectations() {{
            // allowed calls and return values
            allowing( constraint ).createContextEntry(); will(returnValue(c));
View Full Code Here

     * @throws IntrospectionException
     */
    public void setUp() throws IntrospectionException {
        // create mock objects
        constraint = mockery.mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mockery.mock( ContextEntry.class );

        // set mock objects expectations
        mockery.checking( new Expectations() {
            {
                // allowed calls and return values
View Full Code Here

     */
    @Before
    public void setUp() {
        // create mock objects
        constraint = mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mock( ContextEntry.class );

        when( constraint.createContextEntry() ).thenReturn( c );

        this.rule = new Rule( "test-rule" );
        this.context = new PropagationContextImpl( 0,
View Full Code Here

     */
    @Before
    public void setUp() throws IntrospectionException {
        // create mock objects
        constraint = mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mock( ContextEntry.class );
       
        when( constraint.createContextEntry() ).thenReturn(c);

        this.rule = new Rule( "test-rule" );
        this.context = new PropagationContextImpl( 0,
View Full Code Here

                       returnValueDescr,
                       analysis );
       
        ((MVELReturnValueExpression)returnValue.getExpression()).compile((MVELDialectRuntimeData) pkgBuilder.getPackageRegistry( pkg.getName() ).getDialectRuntimeRegistry().getDialectData( "mvel" ));

        ContextEntry retValContext = returnValue.createContextEntry();

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        final InternalWorkingMemory wm = (InternalWorkingMemory) ruleBase.newStatefulSession();

        final Cheese stilton = new Cheese( "stilton",
View Full Code Here

     * @throws IntrospectionException
     */
    public void setUp() throws IntrospectionException {
        // create mock objects
        constraint = mockery.mock( BetaNodeFieldConstraint.class );
        final ContextEntry c = mockery.mock( ContextEntry.class );

        // set mock objects expectations
        mockery.checking( new Expectations() {
            {
                // allowed calls and return values
View Full Code Here

TOP

Related Classes of org.drools.rule.ContextEntry

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.