Hello,
I am using KIE Drools Workbench 6.0.2 deployed on a Tomcat 7.0 server on Windows. I have deployed the execution server on the same Tomcat server. I can successfully execute and test rules that I create through the web editor.
I would like to execute rules based on facts which are stored in a database (postgres). So far I just can't make it work, and I believe I am missing something in the setup
My understanding is that to do so, I can configure Hibernate and Bitronix Transation Manager to map facts classes to the database, so here is what I did:
- Added a new datasource in TOMCAT_HOME\conf\resources.properties
- Added a new persistence unit with reference to the datasource in TOMCAT_HOME\webapps\drools\WEB-INF\classes\META-INF\persistence.xml
- Added annotations in the data object source code:
import javax.persistence.*;
@PersistenceContext(name="org.csb.domain")
@Entity
@Table(name="ServiceOfferings")
And also the @Id on the Id of the entity.
That's it, but the rule does not trigger even though the condition is met (tested using a test case), and I don't see anything in the logs. I have seen on the web that some people create a hibernate session and pass it as a global variable to the rule. That being said I am not sure in which file I should put that (if it's required).
Could anyone please help ?
Thanks,