use of org.kie.internal.utils.ChainedProperties in project drools by kiegroup.
the class ClassLevel method findJavaVersion.
private static void findJavaVersion(ClassLoader classLoader) {
ChainedProperties chainedProperties = ChainedProperties.getChainedProperties(classLoader);
if (chainedProperties.getProperty("drools.dialect.java", null) == null) {
chainedProperties = ChainedProperties.getChainedProperties(ClassGenerator.class.getClassLoader());
}
javaVersion = findJavaVersion(chainedProperties);
}
use of org.kie.internal.utils.ChainedProperties in project jbpm by kiegroup.
the class EmailNotificationPublisherTest method setUp.
@Before
public void setUp() throws Exception {
System.setProperty("org.jbpm.email.templates.dir", new File("src/test/resources/templates").getAbsolutePath());
TemplateManager.reset();
ChainedProperties props = ChainedProperties.getChainedProperties("email.conf", ClassLoaderUtil.getClassLoader(null, getClass(), false));
emailHost = props.getProperty("mail.smtp.host", "localhost");
emailPort = props.getProperty("mail.smtp.port", "2345");
wiser = new Wiser();
wiser.setHostname(emailHost);
wiser.setPort(Integer.parseInt(emailPort));
wiser.start();
Thread.sleep(200);
connection = new Connection(emailHost, emailPort);
userInfo = new DefaultUserInfo(true);
}
use of org.kie.internal.utils.ChainedProperties in project jbpm by kiegroup.
the class EmailWorkItemHandlerTest method setUp.
@Before
public void setUp() throws Exception {
System.setProperty("org.jbpm.email.templates.dir", new File("src/test/resources/templates").getAbsolutePath());
TemplateManager.reset();
ChainedProperties props = ChainedProperties.getChainedProperties("email.conf", ClassLoaderUtil.getClassLoader(null, getClass(), false));
emailHost = props.getProperty("mail.smtp.host", "localhost");
emailPort = props.getProperty("mail.smtp.port", "2345");
wiser = new Wiser();
wiser.setHostname(emailHost);
wiser.setPort(Integer.parseInt(emailPort));
wiser.start();
Thread.sleep(200);
}
use of org.kie.internal.utils.ChainedProperties in project jbpm by kiegroup.
the class TaskReminderTest method setup.
@Before
public void setup() {
final ChainedProperties props = ChainedProperties.getChainedProperties("email.conf", ClassLoaderUtil.getClassLoader(null, getClass(), false));
wiser = new Wiser();
wiser.setHostname(props.getProperty("mail.smtp.host", "localhost"));
wiser.setPort(Integer.parseInt(props.getProperty("mail.smtp.port", "2345")));
wiser.start();
try {
Thread.sleep(1000);
} catch (Throwable t) {
// Do nothing
}
pds = setupPoolingDataSource();
emf = Persistence.createEntityManagerFactory("org.jbpm.services.task");
this.taskService = (InternalTaskService) HumanTaskServiceFactory.newTaskServiceConfigurator().entityManagerFactory(emf).getTaskService();
}
use of org.kie.internal.utils.ChainedProperties in project drools by kiegroup.
the class DMNAssemblerService method getDMNProfiles.
private List<DMNProfile> getDMNProfiles(KnowledgeBuilderImpl kbuilderImpl) {
ChainedProperties chainedProperties = kbuilderImpl.getBuilderConfiguration().getChainedProperties();
List<DMNProfile> dmnProfiles = new ArrayList<>();
dmnProfiles.addAll(getDefaultDMNProfiles(chainedProperties));
Map<String, String> dmnProfileProperties = new HashMap<>();
chainedProperties.mapStartsWith(dmnProfileProperties, DMN_PROFILE_PREFIX, false);
if (!dmnProfileProperties.isEmpty()) {
try {
for (Map.Entry<String, String> dmnProfileProperty : dmnProfileProperties.entrySet()) {
DMNProfile dmnProfile = (DMNProfile) kbuilderImpl.getRootClassLoader().loadClass(dmnProfileProperty.getValue()).newInstance();
dmnProfiles.add(dmnProfile);
}
return dmnProfiles;
} catch (Exception e) {
kbuilderImpl.addBuilderResult(new DMNKnowledgeBuilderError(ResultSeverity.WARNING, "Trying to load a non-existing Kie DMN profile " + e.getLocalizedMessage()));
logger.error("Trying to load a non-existing Kie DMN profile {}", e.getLocalizedMessage(), e);
kbuilderImpl.addBuilderResult(new DMNKnowledgeBuilderError(ResultSeverity.WARNING, "DMN Compiler configuration contained errors, will fall-back using empty-configuration compiler."));
logger.warn("DMN Compiler configuration contained errors, will fall-back using empty-configuration compiler.");
}
}
return dmnProfiles;
}
Aggregations