KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
List<ObjectTypeNode> nodes = ((InternalRuleBase)((KnowledgeBaseImpl)kbase).ruleBase).getRete().getObjectTypeNodes();
ObjectTypeNode node = null;
for ( ObjectTypeNode n : nodes ) {
if ( ((ClassObjectType)n.getObjectType()).getClassType() == Person.class ) {
node = n;
break;
}
}
BetaNode betaanode = (BetaNode) node.getSinkPropagator().getSinks()[0];
BetaNodeFieldConstraint[] constraint = ( BetaNodeFieldConstraint[] ) betaanode.getConstraints();
PredicateConstraint c = ( PredicateConstraint ) constraint[0];
assertTrue( c.getPredicateExpression() instanceof PredicateExpression );
assertTrue( c.getPredicateExpression() instanceof CompiledInvoker );
assertTrue( !(c.getPredicateExpression() instanceof MVELPredicateExpression ) );