KiePMMLSessionUtils { private KiePMMLSessionUtils(final KieBase knowledgeBase, final String modelName, final String packageName, final PMML4Result pmml4Result) { this.modelName = modelName; this.packageName = packageName; kieSession = getKieSession(knowledgeBase); commands = new ArrayList<>(); commands.add(COMMAND_FACTORY_SERVICE.newInsert(new KiePMMLStatusHolder())); commands.add(COMMAND_FACTORY_SERVICE.newInsert(pmml4Result)); commands.add(COMMAND_FACTORY_SERVICE.newSetGlobal(PMML4_RESULT_IDENTIFIER, pmml4Result)); } private  KiePMMLSessionUtils(final KieBase knowledgeBase, final String modelName, final String packageName, final PMML4Result pmml4Result); static Builder builder(final KieBase knowledgeBase, final String modelName, final String packageName, final PMML4Result pmml4Result); void fireAllRules();  }
@Test public void kiePMMLSessionUtils() { List<Command> retrieved = kiePMMLSessionUtils.commands; assertNotNull(retrieved); assertEquals(3, retrieved.size()); assertTrue(retrieved.get(0) instanceof InsertObjectCommand); InsertObjectCommand insertObjectCommand = (InsertObjectCommand) retrieved.get(0); assertEquals("DEFAULT", insertObjectCommand.getEntryPoint()); assertNotNull(insertObjectCommand.getObject()); assertTrue(insertObjectCommand.getObject() instanceof KiePMMLStatusHolder); KiePMMLStatusHolder kiePMMLStatusHolder = (KiePMMLStatusHolder) insertObjectCommand.getObject(); assertEquals(0.0, kiePMMLStatusHolder.getAccumulator(), 0.0); assertNull(kiePMMLStatusHolder.getStatus()); assertTrue(retrieved.get(1) instanceof InsertObjectCommand); insertObjectCommand = (InsertObjectCommand) retrieved.get(1); assertEquals("DEFAULT", insertObjectCommand.getEntryPoint()); assertNotNull(insertObjectCommand.getObject()); assertTrue(insertObjectCommand.getObject() instanceof PMML4Result); assertEquals(PMML4_RESULT, insertObjectCommand.getObject()); assertTrue(retrieved.get(2) instanceof SetGlobalCommand); SetGlobalCommand setGlobalCommand = (SetGlobalCommand) retrieved.get(2); assertEquals("$pmml4Result", setGlobalCommand.getIdentifier()); assertTrue(setGlobalCommand.getObject() instanceof PMML4Result); assertEquals(PMML4_RESULT, setGlobalCommand.getObject()); }