Search in sources :

Example 1 with DMNCompilerConfigurationImpl

use of org.kie.dmn.core.compiler.DMNCompilerConfigurationImpl in project drools by kiegroup.

the class DMNAssemblerService method compilerConfigWithKModulePrefs.

/**
 * Returns a DMNCompilerConfiguration with the specified properties set, and applying the explicited dmnProfiles.
 * @param chainedProperties applies properties --it does not do any classloading nor profile loading based on these properites, just passes the values.
 * @param dmnProfiles applies these DMNProfile(s) to the DMNCompilerConfiguration
 * @return
 */
public static DMNCompilerConfiguration compilerConfigWithKModulePrefs(ChainedProperties chainedProperties, List<DMNProfile> dmnProfiles) {
    DMNCompilerConfigurationImpl config = (DMNCompilerConfigurationImpl) DMNFactory.newCompilerConfiguration();
    Map<String, String> dmnPrefs = new HashMap<>();
    chainedProperties.mapStartsWith(dmnPrefs, ORG_KIE_DMN_PREFIX, true);
    config.setProperties(dmnPrefs);
    for (DMNProfile dmnProfile : dmnProfiles) {
        config.addExtensions(dmnProfile.getExtensionRegisters());
        config.addDRGElementCompilers(dmnProfile.getDRGElementCompilers());
        config.addFEELProfile(dmnProfile);
    }
    return config;
}
Also used : HashMap(java.util.HashMap) DMNProfile(org.kie.dmn.core.compiler.DMNProfile) ExtendedDMNProfile(org.kie.dmn.core.compiler.profiles.ExtendedDMNProfile) DMNCompilerConfigurationImpl(org.kie.dmn.core.compiler.DMNCompilerConfigurationImpl)

Aggregations

HashMap (java.util.HashMap)1 DMNCompilerConfigurationImpl (org.kie.dmn.core.compiler.DMNCompilerConfigurationImpl)1 DMNProfile (org.kie.dmn.core.compiler.DMNProfile)1 ExtendedDMNProfile (org.kie.dmn.core.compiler.profiles.ExtendedDMNProfile)1