Monday, November 12, 2007

Injecting Transactions Into Rules

First of all, some guys may think this slightly strange. With due respect to rules and not making them procedural, there are several business use case where from the THEN part, there is a need to call the web service. I was experimenting this thought on JBoss Rules, Quick Rules etc rule engine. But interestingly , all these rule engine never stops me calling the Web Service but there is no transaction control over it (distributed transaction). Thanks to java open source world and jboss rules guys, I can play with their code.

How can we inject transaction? Thanks to Spring and declarative transactions, this is very much feasible. So here was my game plan in nut shell, introduce a new attribute in the JBoss Rule grammar named "Transaction" and at the time of rule execution run the spring container and inject the declarative transactions.

No comments: