@Test
public void testScorecard() throws Exception {
setKSession( getModelSession( source1, VERBOSE ) );
setKbase( getKSession().getKieBase() );
KieSession kSession = getKSession();
kSession.fireAllRules(); //init model
kSession.getEntryPoint( "in_Age" ).insert( 33.0 );
kSession.getEntryPoint( "in_Occupation" ).insert( "SKYDIVER" );
kSession.getEntryPoint( "in_ResidenceState" ).insert( "KN" );
kSession.getEntryPoint( "in_ValidLicense" ).insert( true );
kSession.fireAllRules(); //init model
FactType scoreCardType = getKbase().getFactType( PMML4Helper.pmmlDefaultPackageName(), "ScoreCard" );
assertNotNull( scoreCardType );
assertEquals( 1, kSession.getObjects( new ClassObjectFilter( scoreCardType.getFactClass() ) ).size() );
Object scoreCard = kSession.getObjects( new ClassObjectFilter( scoreCardType.getFactClass() ) ).iterator().next();
System.out.print( reportWMObjects( kSession )
);
assertEquals( "SampleScore", scoreCardType.get( scoreCard, "modelName" ) );
assertEquals( 41.345, scoreCardType.get( scoreCard, "score" ) );