aif.fieldValues[0].nature = BaseSingleFieldConstraint.TYPE_LITERAL;
brlAction.getDefinition().add( aif );
dt.getActionCols().add( brlAction );
BRLRuleModel model = new BRLRuleModel( dt );
assertNotNull( model.getAllVariables() );
assertEquals( 4,
model.getAllVariables().size() );
assertTrue( model.getAllVariables().contains( "$p1" ) );
assertTrue( model.getAllVariables().contains( "$c1" ) );
assertTrue( model.getAllVariables().contains( "$ins" ) );
assertTrue( model.getAllVariables().contains( "$aif" ) );
assertNotNull( model.getRHSBoundFacts() );
assertEquals( 2,
model.getRHSBoundFacts().size() );
assertTrue( model.getRHSBoundFacts().contains( "$ins" ) );
assertTrue( model.getRHSBoundFacts().contains( "$aif" ) );
ActionInsertFact r1 = model.getRHSBoundFact( "$ins" );
assertNotNull( r1 );
assertTrue( r1 instanceof BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor );
BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor raif1 = (BRLRuleModel.ActionInsertFactCol52ActionInsertFactAdaptor) r1;
assertEquals( "Person",
raif1.factType );
assertEquals( "rating",
raif1.fieldValues[0].field );
assertEquals( SuggestionCompletionEngine.TYPE_STRING,
raif1.fieldValues[0].type );
assertNull( raif1.fieldValues[0].value );
assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
raif1.fieldValues[0].nature );
ActionInsertFact r2 = model.getRHSBoundFact( "$aif" );
assertNotNull( r2 );
assertTrue( r2 instanceof ActionInsertFact );
ActionInsertFact raif2 = (ActionInsertFact) r2;
assertEquals( "Person",
raif2.factType );