setting consequence exception handler
by kenneth.westelinck@telenet.be
All,
I want to configure my drools through spring (version 6.0.1). This is working fine, thanks to kie-spring. Now, I want to configure a consequence exception handler. In drools 5 this was configured like this:
<drools:configuration>
<drools:mbeans enabled="true" />
<drools:event-processing-mode mode="STREAM" />
<drools:consequenceExceptionHandler handler="com.sample.MyConsequenceExceptionHandler" />
</drools:configuration>
For 6.0.1, after some debugging, I've managed to set it throught a system property:
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject">
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="java.lang.System" />
<property name="targetMethod" value="getProperties" />
</bean>
</property>
<property name="targetMethod" value="putAll" />
<property name="arguments">
<util:properties>
<prop key="drools.consequenceExceptionHandler">com.sample.MyConsequenceExceptionHandler</prop>
</util:properties>
</property>
</bean>
I don't think this is the way to go however, so I'm wondering how to do this properly for drools 6.0.1.
Thanks!
regards,
Kenneth