((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",
10 );
final Cheese cheddar = new Cheese( "cheddar",
10 );
final InternalFactHandle f0 = (InternalFactHandle) wm.insert( cheddar );
LeftTuple tuple = new LeftTuple( f0,
null,
true );
final InternalFactHandle f1 = (InternalFactHandle) wm.insert( stilton );
tuple = new LeftTuple( tuple,
new RightTuple( f1,
null ),
null,
true );
final Cheese brie = new Cheese( "brie",
20 );
final InternalFactHandle f2 = (InternalFactHandle) wm.insert( brie );
assertTrue( returnValue.isAllowed( extractor,
f2,
tuple,
wm,
retValContext ) );
brie.setPrice( 18 );
wm.update( f2,
brie );
assertFalse( returnValue.isAllowed( extractor,
f2,
tuple,
wm,