i’m open to allowing mixing and matching of annotations and xml configuration. Although what’s published on the qzr sort of goes against the grain of what we are trying to achieve - such as not specifying individual asset files.
public KieServicesBean kieServices() throws KieBuildException {
DroolsResource[] resources = new DroolsResource[]{
new DroolsResource("rules/health-quiz.drl",
ResourcePathType.CLASSPATH,
ResourceType.DRL)};
KieServicesBean bean = new DefaultKieServicesBean(resources);
return bean;
}
While you can do anything from programmatic factories, and you don’t “lose” any functionality, in it’s current form it doesn’t promote convention and configuration approach. I really want to avoid any method code, other than configuring say listeners. Ideally we’d be looking for something like below, that mirrors what we have in the xml already, and avoids authoring any methods at all. I know I could do this in CDI, but I don’t know about Spring. In CDI I can scan for usages of @KBaseConfig. Where I find a @KBaseConfig I can populate the main CDI beans infrastructure, so it treats xml configuration and annotation configuration the same.
@KBaseConfig(name=“kbase1”, packages=“my.domain.fld, my.domain.fld2" )
public static class kbase1Config {
@KSessionConfig(name=“ksession1”, clockType=“pseudo”)
private KieSession kieSession1;
@KSessionConfig(name=“ksession2”, clockType=“realtime”)
private KieSession kieSession2;
}
The above is the same as:
<kbase name==“kbase1”, packages=“my.domain.fld, my.domain.fld2”>
<ksession name=“ksession1” clockType=“pseudo” />
<ksession name=“ksession1” clockType=“realtime” />
</kbase>
Mark