Re: [rules-users] Drools With Spring Framework Problem

2007-02-20 Thread Edson Tirelli


  Niyas,

  This one seems to be a conflict when using JDT and tomcat. Look at 
the JBoss Rules wiki that I believe someone posted a solution for that 
there.


  []s
  Edson

Niyas wrote:


Hi Edson,

Thanks for your reply.

Yes, you are correct and I have changed the operator ">" . But I am
getting some other error now.

javax.servlet.ServletException: Servlet.init() for servlet insurance
threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) 

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) 

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) 

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) 

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) 

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) 

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) 


java.lang.Thread.run(Thread.java:595)


root cause

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '/home.htm' defined in ServletContext resource
[/WEB-INF/insurance-servlet.xml]: Cannot resolve reference to bean
'ruleBase' while setting bean property 'ruleBase'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ruleBase' defined in ServletContext resource
[/WEB-INF/insurance-servlet.xml]: Initialization of bean failed;
nested exception is java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem; 

org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:190) 

org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106) 

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1046) 

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857) 

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:378) 

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233) 

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) 

org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:537) 

org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:186) 

org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping.initApplicationContext(BeanNameUrlHandlerMapping.java:62) 

org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73) 

org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:84) 

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:277) 

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:395) 

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233) 

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) 

org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:283) 

org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313) 

org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139) 

org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:306) 

org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:251) 

org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:220) 

org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:112) 


javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) 

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) 

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) 

org.apache.coyote.http11.Http11BaseProtocol$Http11Connecti

Re: [rules-users] Drools With Spring Framework Problem

2007-02-20 Thread Niyas

Hi,

WIKI Knowledgebase have a solution for the error
like:org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;

I have added the JANINO compiler in the PackageBuilderConfiguration in
the Java Code: But It's not resolving my problem and the same error
message is coming:

My Code:

public class RuleBaseBeanFactory implements FactoryBean, InitializingBean {

   private List drlResourceList;
   private RuleBase ruleBase;
   private  PackageBuilderConfiguration packageBuilderConfiguration;

public void setDrlResourceList(List drlResourceList) {
   this.drlResourceList = drlResourceList;
   }

   public void afterPropertiesSet() throws Exception {
   Assert.notEmpty(drlResourceList, "drlResourceList must not be empty");
   PackageBuilder builder = (packageBuilderConfiguration != null
? new PackageBuilder(packageBuilderConfiguration) : new
PackageBuilder());
   
packageBuilderConfiguration.setCompiler(packageBuilderConfiguration.JANINO);
   for (Resource resource : drlResourceList) {
   builder.addPackageFromDrl(new
InputStreamReader(resource.getInputStream())); // TODO will use
default encoding which might not be wanted
   }
   ruleBase = RuleBaseFactory.newRuleBase();
   ruleBase.addPackage(builder.getPackage());
   }

   public RuleBase getObject() {
   return ruleBase;
   }

   public Class getObjectType() {
   return RuleBase.class;
   }

   public boolean isSingleton() {
   return true;
   }

   public void
setPackageBuilderConfiguration(PackageBuilderConfiguration
packageBuilderConfiguration) {
   this.packageBuilderConfiguration = packageBuilderConfiguration;
   }
}


Please suggest a solution..


On 2/20/07, Niyas <[EMAIL PROTECTED]> wrote:

Hi Edson,

Thanks for your reply.

Yes, you are correct and I have changed the operator ">" . But I am
getting some other error now.

javax.servlet.ServletException: Servlet.init() for servlet insurance
threw exception

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)


root cause

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '/home.htm' defined in ServletContext resource
[/WEB-INF/insurance-servlet.xml]: Cannot resolve reference to bean
'ruleBase' while setting bean property 'ruleBase'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ruleBase' defined in ServletContext resource
[/WEB-INF/insurance-servlet.xml]: Initialization of bean failed;
nested exception is java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;

org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:190)

org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1046)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:378)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)

org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:537)

org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:186)

org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping.initApplicationContext(BeanNameUrlHandlerMapping.java:62)

org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)

org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:84)

org.springframewor

Re: [rules-users] Drools With Spring Framework Problem

2007-02-20 Thread Niyas

Hi Edson,

Thanks for your reply.

Yes, you are correct and I have changed the operator ">" . But I am
getting some other error now.

javax.servlet.ServletException: Servlet.init() for servlet insurance
threw exception

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)


root cause

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name '/home.htm' defined in ServletContext resource
[/WEB-INF/insurance-servlet.xml]: Cannot resolve reference to bean
'ruleBase' while setting bean property 'ruleBase'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ruleBase' defined in ServletContext resource
[/WEB-INF/insurance-servlet.xml]: Initialization of bean failed;
nested exception is java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;

org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:190)

org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1046)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:378)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)

org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:537)

org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:186)

org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping.initApplicationContext(BeanNameUrlHandlerMapping.java:62)

org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)

org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:84)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:277)

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:395)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)

org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:283)

org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)

org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)

org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:306)

org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:251)

org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:220)

org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:112)
javax.servlet.GenericServlet.init(GenericServlet.java:211)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

org.apache.tomcat.

Re: [rules-users] Drools With Spring Framework Problem

2007-02-20 Thread Edson Tirelli
  
   Hi Niyas,


   This is something I faced yesterday but did not had the time to work 
on it yet. Basically, 2 problems:


1. Error message is crap... we need to improve that.

2. It should not be raising any error. The error means you have a String 
attribute you are trying to compare using operators like >, <, >=, <=. 
Example:


Person( name > 'Edson' )

   And I think the above should work but is not working. I will open a 
JIRA for that.
   Meanwhile, if you need to have such constraint, a workaround is to 
use a predicate:


Person( $n : name, ( $n.compareTo( 'Edson' ) > 0 ) )

   []s
   Edson


Niyas wrote:


I have tried of using the sample coding given the link given by you:
But i am getting the following error:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ruleBase' defined in ServletContext resource
[/WEB-INF/insurance-servlet.xml]: Initialization of bean failed;
nested exception is java.lang.RuntimeException: Operator '40' does not
exist for StringEvaluator
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:403) 

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233) 

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145) 

org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277) 

org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313) 

org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139) 

org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:306) 

org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:251) 

org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:220) 

org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:112) 


javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) 

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) 

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) 

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) 

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) 

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) 

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) 


java.lang.Thread.run(Thread.java:595)

My insurance-servlet.xml:


class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/> 













class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 



/WEB-INF/jsp/   



.jsp
   


   







type="org.springframework.core.io.Resource">classpath:/com/sample/Approval.drl 






class="org.drools.compiler.PackageBuilderConfiguration">




   





On 2/19/07, Olenin, Vladimir (MOH) <[EMAIL PROTECTED]> wrote:

Check out 'Spring Modules' subproject - it has a DROOLS integration 
module.
Haven't used it myself yet, so not sure whether it's 
mature/compatible with

most recent release.

https://springmodules.dev.java.net/docs/reference/0.7/html/jsr94.html#d0e570 


9

https://springmodules.dev.java.net/

Vlad


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Niyas
Sent: 19 February 2007 09:49
To: rules-users@lists.jboss.org
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

Re: [rules-users] Drools With Spring Framework Problem

2007-02-20 Thread Niyas

I have tried of using the sample coding given the link given by you:
But i am getting the following error:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'ruleBase' defined in ServletContext resource
[/WEB-INF/insurance-servlet.xml]: Initialization of bean failed;
nested exception is java.lang.RuntimeException: Operator '40' does not
exist for StringEvaluator

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:403)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)

org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)

org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)

org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)

org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:139)

org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:306)

org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:251)

org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:220)

org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:112)
javax.servlet.GenericServlet.init(GenericServlet.java:211)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)

org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)

org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)

My insurance-servlet.xml:
















/WEB-INF/jsp/


.jsp
   


 






classpath:/com/sample/Approval.drl








   




On 2/19/07, Olenin, Vladimir (MOH) <[EMAIL PROTECTED]> wrote:

Check out 'Spring Modules' subproject - it has a DROOLS integration module.
Haven't used it myself yet, so not sure whether it's mature/compatible with
most recent release.

https://springmodules.dev.java.net/docs/reference/0.7/html/jsr94.html#d0e570
9

https://springmodules.dev.java.net/

Vlad


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Niyas
Sent: 19 February 2007 09:49
To: rules-users@lists.jboss.org
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
_

RE: [rules-users] Drools With Spring Framework Problem

2007-02-19 Thread Olenin, Vladimir (MOH)
Check out 'Spring Modules' subproject - it has a DROOLS integration module.
Haven't used it myself yet, so not sure whether it's mature/compatible with
most recent release.

https://springmodules.dev.java.net/docs/reference/0.7/html/jsr94.html#d0e570
9

https://springmodules.dev.java.net/

Vlad
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Niyas
Sent: 19 February 2007 09:49
To: rules-users@lists.jboss.org
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
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools With Spring Framework Problem

2007-02-19 Thread James Depaul

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 
 <[EMAIL PROTECTED] 
 .com>  To
 Sent by:  rules-users@lists.jboss.org 
 rules-users-bounc  cc
 [EMAIL PROTECTED] 
 g Subject
   [rules-users] Drools With Spring
   Framework Problem   
 02/19/2007 07:48  
 AM
   
   
 Please respond to 
 Rules Users List  
 <[EMAIL PROTECTED] 
   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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users