@Override
    public KiePMMLDroolsModelWithSources getKiePMMLModelWithSources(final CompilationDTO<T> compilationDTO) {
        logger.trace("getKiePMMLModelWithSources {} {} {}", compilationDTO.getPackageName(),
                     compilationDTO.getFields(), compilationDTO.getModel());
        try {
            final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap = new HashMap<>();
            KiePMMLDroolsAST kiePMMLDroolsAST = getKiePMMLDroolsASTCommon(compilationDTO.getFields(),
                                                                          compilationDTO.getModel(), fieldTypeMap);
            final DroolsCompilationDTO<T> droolsCompilationDTO =
                    DroolsCompilationDTO.fromCompilationDTO(compilationDTO, fieldTypeMap);
            Map<String, String> sourcesMap = getKiePMMLDroolsModelSourcesMap(droolsCompilationDTO);
            PackageDescr packageDescr = getPackageDescr(kiePMMLDroolsAST, compilationDTO.getPackageName());
            String pkgUUID = getPkgUUID("gav", compilationDTO.getPackageName());
            packageDescr.setPreferredPkgUUID(pkgUUID);
            return new KiePMMLDroolsModelWithSources(compilationDTO.getFileName(),
                                                     compilationDTO.getModelName(),
                                                     compilationDTO.getPackageName(),
                                                     compilationDTO.getKieMiningFields(),
                                                     compilationDTO.getKieOutputFields(),
                                                     compilationDTO.getKieTargetFields(),
                                                     sourcesMap,
                                                     pkgUUID,
                                                     packageDescr);
        } catch (Exception e) {
            throw new KiePMMLException(e);
        }
    }
@Test
    void getKiePMMLModelWithSources() {
        final CommonCompilationDTO<Scorecard> compilationDTO =
                CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME,
                                                                       pmml,
                                                                       scorecard,
                                                                       new PMMLCompilationContextMock(),
                                                                       SOURCE_1);
        KiePMMLDroolsModelWithSources retrieved = droolsModelProvider.getKiePMMLModelWithSources(compilationDTO);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved.getSourcesMap()).isEqualTo(SOURCE_MAP);
        String expectedPackageName = compilationDTO.getPackageName();
        assertThat(retrieved.getKModulePackageName()).isEqualTo(expectedPackageName);
        assertThat(retrieved.getName()).isEqualTo(scorecard.getModelName());
        PackageDescr packageDescr = retrieved.getPackageDescr();
        commonVerifyPackageDescr(packageDescr, expectedPackageName);
        assertThat(retrieved).isNotNull();
    }