Hi Niyas -

I'm also trying to implement similar approach wiht Spring and Drools, so I've done similar search and found some stuff. CHeck out this link:

http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesWithSpringFramework

Using the sample code there I was able to come up with a component that encapsulates both the PackageBuilder and RuleBase - this component is called EventRulBase. Spring builds this component based on the configuration I specify in the aplicaitonContext-myapp.xml file... So the sequence goes something like this:

1) Spring initializes the Beans defined in applicationContext-myapp.xml file at startup. The bean implements an init() method which I instruct Spring to invoke AFTER it finishes setting up all properties on the bean.... in the init() method I setup the components that read the DRL file, compile and initialize the RuleBase object.

2) My EventRuleBase component is a Singleton that can return RuleBase objects from which calling clients can instantiate new Working Memory objects, assert objects and facts into it, fire rules, etc...

I'm still in the process of building it but that's the general flow.

Hope it helps - if you need more let me know.

Regards,
James





Inactive hide details for Niyas <niyasahmed@gmail.com>Niyas <niyasahmed@gmail.com>


          Niyas <niyasahmed@gmail.com>
          Sent by: rules-users-bounces@lists.jboss.org

          02/19/2007 07:48 AM
          Please respond to
          Rules Users List <rules-users@lists.jboss.org>


To

rules-users@lists.jboss.org

cc


Subject

[rules-users] Drools With Spring Framework Problem

Hi all,

I am in need of integrating Drools JBoss Rule Engine with Spring Framework.
I have tried sample rule engine examples in the Drools in the
standalone with the help od drools IDE for eclipse 3.2.
And I also tried some example in the Spring Framework,to know how it
works. I have tried some examples in IOC, MVC and JDBC in the spring
framework.

Now, I want to use both Drools and Spring Framework in such a way that
Spring will have the MVC application and it should validate the rules,
which written in the drools (.drl)

I don't know how to begin with/what are he configuration files needed
to setup. PLease if anyone have the sample coding on Drools with
Spring or any other links willl be very useful.

And also, guide me what are the things need to be know for Spring with
Drools. While I have searched in google, lots of things came up like:

Use JSR94... (which is mentioning to configure RuleServiceProvider,
RuleRuntime, RuleSet..and others..which seeme to be confusing and not
clear)

Whether there are any API for drools with spring that DROOLS is
supporting..like org.drools.spring.metadata.ArgumentMetadataSource. I
don't find these Drools API section
http://labs.jboss.com/file-access/default/members/jbossrules/freezone/docs/3.0.5/apidocs/index.html
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users