[rules-users] Drools With Spring Framework Problem

James Depaul jjdepaul at us.ibm.com
Mon Feb 19 10:58:32 EST 2007


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







                                                                           
             Niyas                                                         
             <niyasahmed at gmail                                             
             .com>                                                      To 
             Sent by:                  rules-users at lists.jboss.org         
             rules-users-bounc                                          cc 
             es at lists.jboss.or                                             
             g                                                     Subject 
                                       [rules-users] Drools With Spring    
                                       Framework Problem                   
             02/19/2007 07:48                                              
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
             Rules Users List                                              
             <rules-users at list                                             
               s.jboss.org>                                                
                                                                           
                                                                           




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 at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070219/719c7e77/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20070219/719c7e77/attachment.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic31548.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20070219/719c7e77/attachment-0001.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20070219/719c7e77/attachment-0002.gif 


More information about the rules-users mailing list