@Test public void getKiePMMLDroolsASTCommon() { final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap = new HashMap<>(); KiePMMLDroolsAST retrieved = droolsModelProvider.getKiePMMLDroolsASTCommon(pmml.getDataDictionary(), pmml.getTransformationDictionary(), scorecard, fieldTypeMap); commonVerifyKiePMMLDroolsAST(retrieved, fieldTypeMap); commonVerifyFieldTypeMap(fieldTypeMap, pmml.getDataDictionary().getDataFields(), pmml.getTransformationDictionary().getDerivedFields(), scorecard.getLocalTransformations().getDerivedFields()); }
protected KiePMMLDroolsAST getKiePMMLDroolsASTCommon(final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final T model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap) { addTransformationsDerivedFields(fieldTypeMap, transformationDictionary, model.getLocalTransformations()); List<KiePMMLDroolsType> types = fieldTypeMap.values() .stream().map(kiePMMLOriginalTypeGeneratedType -> { String type = DATA_TYPE.byName(kiePMMLOriginalTypeGeneratedType.getOriginalType()).getMappedClass().getSimpleName(); return new KiePMMLDroolsType(kiePMMLOriginalTypeGeneratedType.getGeneratedType(), type); }) .collect(Collectors.toList()); types.addAll(KiePMMLDataDictionaryASTFactory.factory(fieldTypeMap).declareTypes(dataDictionary)); return getKiePMMLDroolsAST(dataDictionary, model, fieldTypeMap, types); }
DroolsModelProvider implements ModelImplementationProvider<T, E> { protected KiePMMLDroolsAST getKiePMMLDroolsASTCommon(final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final T model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap) { addTransformationsDerivedFields(fieldTypeMap, transformationDictionary, model.getLocalTransformations()); List<KiePMMLDroolsType> types = fieldTypeMap.values() .stream().map(kiePMMLOriginalTypeGeneratedType -> { String type = DATA_TYPE.byName(kiePMMLOriginalTypeGeneratedType.getOriginalType()).getMappedClass().getSimpleName(); return new KiePMMLDroolsType(kiePMMLOriginalTypeGeneratedType.getGeneratedType(), type); }) .collect(Collectors.toList()); types.addAll(KiePMMLDataDictionaryASTFactory.factory(fieldTypeMap).declareTypes(dataDictionary)); return getKiePMMLDroolsAST(dataDictionary, model, fieldTypeMap, types); } }
DroolsModelProvider implements ModelImplementationProvider<T, E> { protected KiePMMLDroolsAST getKiePMMLDroolsASTCommon(final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final T model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap) { addTransformationsDerivedFields(fieldTypeMap, transformationDictionary, model.getLocalTransformations()); List<KiePMMLDroolsType> types = fieldTypeMap.values() .stream().map(kiePMMLOriginalTypeGeneratedType -> { String type = DATA_TYPE.byName(kiePMMLOriginalTypeGeneratedType.getOriginalType()).getMappedClass().getSimpleName(); return new KiePMMLDroolsType(kiePMMLOriginalTypeGeneratedType.getGeneratedType(), type); }) .collect(Collectors.toList()); types.addAll(KiePMMLDataDictionaryASTFactory.factory(fieldTypeMap).declareTypes(dataDictionary)); return getKiePMMLDroolsAST(dataDictionary, model, fieldTypeMap, types); }  }
DroolsModelProvider implements ModelImplementationProvider<T, E> { protected KiePMMLDroolsAST getKiePMMLDroolsASTCommon(final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final T model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap) { addTransformationsDerivedFields(fieldTypeMap, transformationDictionary, model.getLocalTransformations()); List<KiePMMLDroolsType> types = fieldTypeMap.values() .stream().map(kiePMMLOriginalTypeGeneratedType -> { String type = DATA_TYPE.byName(kiePMMLOriginalTypeGeneratedType.getOriginalType()).getMappedClass().getSimpleName(); return new KiePMMLDroolsType(kiePMMLOriginalTypeGeneratedType.getGeneratedType(), type); }) .collect(Collectors.toList()); types.addAll(KiePMMLDataDictionaryASTFactory.factory(fieldTypeMap).declareTypes(dataDictionary)); return getKiePMMLDroolsAST(dataDictionary, model, fieldTypeMap, types); }  @Override E getKiePMMLModel(final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final T model, final Object kBuilder); @Override E getKiePMMLModelFromPlugin(final String packageName, final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final T model, final Object kBuilder); PackageDescr getPackageDescr(final KiePMMLDroolsAST kiePMMLDroolsAST, final String packageName); abstract E getKiePMMLDroolsModel(final DataDictionary dataDictionary,
                                            final TransformationDictionary transformationDictionary,
                                            final T model,
                                            final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap); abstract KiePMMLDroolsAST getKiePMMLDroolsAST(final DataDictionary dataDictionary,
                                                         final T model,
                                                         final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap,
                                                         final List<KiePMMLDroolsType> types); abstract Map<String, String> getKiePMMLDroolsModelSourcesMap(final DataDictionary dataDictionary,
                                                                        final TransformationDictionary transformationDictionary,
                                                                        final T model,
                                                                        final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap,
                                                                        final String packageName); }
DroolsModelProvider implements ModelImplementationProvider<T, E> { protected KiePMMLDroolsAST getKiePMMLDroolsASTCommon(final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final T model, final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap) { addTransformationsDerivedFields(fieldTypeMap, transformationDictionary, model.getLocalTransformations()); List<KiePMMLDroolsType> types = fieldTypeMap.values() .stream().map(kiePMMLOriginalTypeGeneratedType -> { String type = DATA_TYPE.byName(kiePMMLOriginalTypeGeneratedType.getOriginalType()).getMappedClass().getSimpleName(); return new KiePMMLDroolsType(kiePMMLOriginalTypeGeneratedType.getGeneratedType(), type); }) .collect(Collectors.toList()); types.addAll(KiePMMLDataDictionaryASTFactory.factory(fieldTypeMap).declareTypes(dataDictionary)); return getKiePMMLDroolsAST(dataDictionary, model, fieldTypeMap, types); }  @Override E getKiePMMLModel(final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final T model, final Object kBuilder); @Override E getKiePMMLModelFromPlugin(final String packageName, final DataDictionary dataDictionary, final TransformationDictionary transformationDictionary, final T model, final Object kBuilder); PackageDescr getPackageDescr(final KiePMMLDroolsAST kiePMMLDroolsAST, final String packageName); abstract E getKiePMMLDroolsModel(final DataDictionary dataDictionary,
                                            final TransformationDictionary transformationDictionary,
                                            final T model,
                                            final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap); abstract KiePMMLDroolsAST getKiePMMLDroolsAST(final DataDictionary dataDictionary,
                                                         final T model,
                                                         final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap,
                                                         final List<KiePMMLDroolsType> types); abstract Map<String, String> getKiePMMLDroolsModelSourcesMap(final DataDictionary dataDictionary,
                                                                        final TransformationDictionary transformationDictionary,
                                                                        final T model,
                                                                        final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap,
                                                                        final String packageName);  }