@Test(expected = KiePMMLException.class) public void evaluateNoKieBase() { kiePMMLDroolsModel.evaluate("NOT_KIE_BASE", new HashMap<>()); }
@Override public Object evaluate(final Object knowledgeBase, Map<String, Object> requestData) { logger.trace("evaluate {} {}", knowledgeBase, requestData); if (!(knowledgeBase instanceof KieBase)) { throw new KiePMMLException(String.format("Expecting KieBase, received %s", knowledgeBase.getClass().getName())); } final PMML4Result toReturn = getPMML4Result(targetField); String fullClassName = this.getClass().getName(); String packageName = fullClassName.contains(".") ? fullClassName.substring(0, fullClassName.lastIndexOf('.')) : ""; KiePMMLSessionUtils.Builder builder = KiePMMLSessionUtils.builder((KieBase) knowledgeBase, name, packageName, toReturn) .withObjectsInSession(requestData, fieldTypeMap) .withOutputFieldsMap(outputFieldsMap); if (logger.isDebugEnabled()) { builder = builder.withAgendaEventListener(agendaEventListener); } final KiePMMLSessionUtils kiePMMLSessionUtils = builder.build(); kiePMMLSessionUtils.fireAllRules(); return toReturn; }
KiePMMLDroolsModel extends KiePMMLModel { @Override public Object evaluate(final Object knowledgeBase, Map<String, Object> requestData) { logger.trace("evaluate {} {}", knowledgeBase, requestData); if (!(knowledgeBase instanceof KieBase)) { throw new KiePMMLException(String.format("Expecting KieBase, received %s", knowledgeBase.getClass().getName())); } final PMML4Result toReturn = getPMML4Result(targetField); String fullClassName = this.getClass().getName(); String packageName = fullClassName.contains(".") ? fullClassName.substring(0, fullClassName.lastIndexOf('.')) : ""; KiePMMLSessionUtils.Builder builder = KiePMMLSessionUtils.builder((KieBase) knowledgeBase, name, packageName, toReturn) .withObjectsInSession(requestData, fieldTypeMap) .withOutputFieldsMap(outputFieldsMap); if (logger.isDebugEnabled()) { builder = builder.withAgendaEventListener(agendaEventListener); } final KiePMMLSessionUtils kiePMMLSessionUtils = builder.build(); kiePMMLSessionUtils.fireAllRules(); return toReturn; } }
KiePMMLDroolsModel extends KiePMMLModel { @Override public Object evaluate(final Object knowledgeBase, Map<String, Object> requestData) { logger.trace("evaluate {} {}", knowledgeBase, requestData); if (!(knowledgeBase instanceof KieBase)) { throw new KiePMMLException(String.format("Expecting KieBase, received %s", knowledgeBase.getClass().getName())); } final PMML4Result toReturn = getPMML4Result(targetField); String fullClassName = this.getClass().getName(); String packageName = fullClassName.contains(".") ? fullClassName.substring(0, fullClassName.lastIndexOf('.')) : ""; KiePMMLSessionUtils.Builder builder = KiePMMLSessionUtils.builder((KieBase) knowledgeBase, name, packageName, toReturn) .withObjectsInSession(requestData, fieldTypeMap) .withOutputFieldsMap(outputFieldsMap); if (logger.isDebugEnabled()) { builder = builder.withAgendaEventListener(agendaEventListener); } final KiePMMLSessionUtils kiePMMLSessionUtils = builder.build(); kiePMMLSessionUtils.fireAllRules(); return toReturn; } protected  KiePMMLDroolsModel(final String modelName,
                                 final List<KiePMMLExtension> extensions); }
KiePMMLDroolsModel extends KiePMMLModel { @Override public Object evaluate(final Object knowledgeBase, Map<String, Object> requestData) { logger.trace("evaluate {} {}", knowledgeBase, requestData); if (!(knowledgeBase instanceof KieBase)) { throw new KiePMMLException(String.format("Expecting KieBase, received %s", knowledgeBase.getClass().getName())); } final PMML4Result toReturn = getPMML4Result(targetField); String fullClassName = this.getClass().getName(); String packageName = fullClassName.contains(".") ? fullClassName.substring(0, fullClassName.lastIndexOf('.')) : ""; KiePMMLSessionUtils.Builder builder = KiePMMLSessionUtils.builder((KieBase) knowledgeBase, name, packageName, toReturn) .withObjectsInSession(requestData, fieldTypeMap) .withOutputFieldsMap(outputFieldsMap); if (logger.isDebugEnabled()) { builder = builder.withAgendaEventListener(agendaEventListener); } final KiePMMLSessionUtils kiePMMLSessionUtils = builder.build(); kiePMMLSessionUtils.fireAllRules(); return toReturn; } protected  KiePMMLDroolsModel(final String modelName,
                                 final List<KiePMMLExtension> extensions); Map<String, KiePMMLOriginalTypeGeneratedType> getFieldTypeMap(); @Override Object evaluate(final Object knowledgeBase, Map<String, Object> requestData); @Override String getKModulePackageName(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
KiePMMLDroolsModel extends KiePMMLModel { @Override public Object evaluate(final Object knowledgeBase, Map<String, Object> requestData) { logger.trace("evaluate {} {}", knowledgeBase, requestData); if (!(knowledgeBase instanceof KieBase)) { throw new KiePMMLException(String.format("Expecting KieBase, received %s", knowledgeBase.getClass().getName())); } final PMML4Result toReturn = getPMML4Result(targetField); String fullClassName = this.getClass().getName(); String packageName = fullClassName.contains(".") ? fullClassName.substring(0, fullClassName.lastIndexOf('.')) : ""; KiePMMLSessionUtils.Builder builder = KiePMMLSessionUtils.builder((KieBase) knowledgeBase, name, packageName, toReturn) .withObjectsInSession(requestData, fieldTypeMap) .withOutputFieldsMap(outputFieldsMap); if (logger.isDebugEnabled()) { builder = builder.withAgendaEventListener(agendaEventListener); } final KiePMMLSessionUtils kiePMMLSessionUtils = builder.build(); kiePMMLSessionUtils.fireAllRules(); return toReturn; } protected  KiePMMLDroolsModel(final String modelName,
                                 final List<KiePMMLExtension> extensions); Map<String, KiePMMLOriginalTypeGeneratedType> getFieldTypeMap(); @Override Object evaluate(final Object knowledgeBase, Map<String, Object> requestData); @Override String getKModulePackageName(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }