Rule Dependency Generator
by Sangrish
Hi
I have been using Drools Rules Engine in our application for past
couple of weeks.
One of the requirements in our project was to let a user (anyone who is
writing/analysing the rules) find out
what other rules a given rule depends upon. There were a few kinds of
dependencies:
1) Object Attribute dependency: The attributes of an object being used in
the conditional part of a rule
might be getting modified in the consequence part of another rule. We
wanted all such rules with each rule having its own dependency list.
2) Rule Salience based dependency. A rule having lower salience should be
executed only after a higher (if any) salience rule has already been
executed.
3) Dependency caused by a specific Rule flow. Rules in a ruleflow group
should be executed only if (if any) Split condition gets satisfied.
4) Agenda flow dependency (i.e., one agenda following another)
We could not find much support for this in the Drools API. Hence we
decided to write our own dependency generator. The tool we are writing
caters to first 3 dependencies. We might even handle the 4th one.
Since Drools is open source, we thought of contributing our bit towards
its development. If the drools team wants I can happily work with them on
getting this functionality plugged in the Drools system.
Thanks
Siddharth
--
View this message in context: http://www.nabble.com/Rule-Dependency-Generator-tp19821365p19821365.html
Sent from the drools - dev mailing list archive at Nabble.com.
16 years, 2 months
IntelliJ registration key for open source projects renewal
by Geoffrey De Smet
Hi guys,
The IntelliJ guys send me a new IntelliJ registration key for open
source projects for a year.
The old one will expire soon.
IANAL, but any drools team member can use it as much as he likes for
open source work only, as far as I know.
I 've forwarded it to mark.
Send me a mail if you want me to forward it to you too.
--
With kind regards,
Geoffrey De Smet
16 years, 2 months
Rule_Execution_Using_JSR-94 API
by Nilshan Parmar
Hello,
I have created few Rules using Drools. I am able execute those rule using
Drools API as well as JSR-94 API when I created them using Drools Eclipse
Plugin and stored on a file system.
Also, I imported same rules in BRMS Repository using Drools-Guvnor. Now, I
have few questions regarding loading/execution of the rules stored in BRMS
repository.
1. How do I load rules stored in BRMS repository? As I understand drool uses
JackRabbit as its Java Content Repository. Do I need to access it via Java
Content API?
2. Is there any way to execute DSL\RuleFlow via JSR-94 API? Does JSR-94
cover these concepts?.
Thanks,
Nilshan.
16 years, 2 months
Roadmap for Drools 5
by Richard Ambridge
Hi all,
Is there a roadmap for release of Drools 5?
When are you expecting GA release?
Cheers
Ric
16 years, 2 months
Deploying drools-guvnor.war from source and running jboss gives error - Could not create Component: org.jboss.seam.core.init
by Chirayu Joshi
Hi,
* I have downloaded source code of guvnor-brms from
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/
* Now I build it with maven using maven install command from command
prompt in the root directory where I took the above source
* It builds successfully and generates drools-guvnor.war on the
target folder of drools-guvnor.
* Now when I deploy it in the jboss deploy directory and run the
jboss I get the following error
17:53:52,149 INFO [TomcatDeployer] deploy, ctxPath=/drools-guvnor,
warUrl=.../tmp/deploy/tmp25062drools-guvnor-exp.war/
17:54:00,039 INFO [STDOUT] ERROR 03-10 17:54:00,024
(Log4JLogger.java:error:119) Exception sending context initi
alized event to listener instance of class
org.jboss.seam.servlet.SeamListener
java.lang.RuntimeException: Could not create Component:
org.jboss.seam.core.init
at
org.jboss.seam.init.Initialization.addComponent(Initialization.java:1033)
at org.jboss.seam.init.Initialization.init(Initialization.java:609)
at
org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
.........
Regards
Chirayu Joshi
16 years, 2 months
file per asset type
by Mark Proctor
What do people think of insisting on a file per type. So functions go in
one file, rules in another and declare models in another. They all end
up in the same package object, but we enforce a separation at both the
file and api level.
kbuilder.addRulesFromURL( url );
kbuilder.addModelFromURL( url );
kbuilder.addFunctionsFromURL( url );
kbuilder.addProcessFromURL( url );
Really more thinking about orthogonality of api and design here. We have
the following situation
kbuilder.addPackageFromXML()
kbuilder.addProcessFromXML()
Processes live in a package, so to a package there is no difference from
a process to a rule - yet we are losing that orthogonality in the api to
handle the special case.
What do people think, I'm just trying to find a better way to get some
language orthogonality. I don't think we are likely to do this, but just
throwing it out for discussion.
I think ideally we would like kbuilder.addResource( url/reader ), but
not sure if we can easily determine each file type, we can't do it by
file extensions as readers have none.
Mark
16 years, 3 months
M2 Guvnor Tomcat Deployment Issues and Resolutions
by David Sinclair
Just a heads up for everyone out there. I needed to make the following
changes to guvnor's POM in order to get the webapp to work properly on
Tomcat. I would imagine some of these issues would appear on JBoss also but
have not tried.
1. Changed seam from 2.1.0.BETA1 to 2.1.0-SNAPSHOT to prevent classloader
problem
POM Changes
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-remoting</artifactId>
<version>2.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>2.1.0-SNAPSHOT</version>
</dependency>
EXCEPTION without change
SEVERE: Exception sending context initialized event to listener instance of
class org.jboss.seam.servlet.SeamListener
java.lang.IllegalStateException: Cannot load
WEB-INF/classes/net/sf/webdav/exceptions/AccessDeniedException.class from
WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@c4fe76
(using getResourceAsStream() returned null)
at
org.jboss.seam.deployment.AbstractDeploymentHandler.getClassFile(AbstractDeploymentHandler.java:41)
at
org.jboss.seam.deployment.ComponentDeploymentHandler.handle(ComponentDeploymentHandler.java:57)
at
org.jboss.seam.deployment.DeploymentStrategy.handle(DeploymentStrategy.java:177)
at
org.jboss.seam.deployment.AbstractScanner.handleItem(AbstractScanner.java:30)
at
org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:141)
at
org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
at
org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
at
org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
at
org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
at
org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
at
org.jboss.seam.deployment.URLScanner.handleDirectory(URLScanner.java:137)
at
org.jboss.seam.deployment.URLScanner.scanDirectories(URLScanner.java:40)
at
org.jboss.seam.deployment.StandardDeploymentStrategy.scan(StandardDeploymentStrategy.java:107)
at
org.jboss.seam.init.Initialization.create(Initialization.java:113)
at
org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2. Added javax.persistence to prevent ClassNotFoundException
POM Changes
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
</dependency>
EXCEPTION without change
SEVERE: Exception sending context initialized event to listener instance of
class org.jboss.seam.servlet.SeamListener
java.lang.RuntimeException: Could not create Component:
org.jboss.seam.core.init
at
org.jboss.seam.init.Initialization.addComponent(Initialization.java:1068)
at org.jboss.seam.init.Initialization.init(Initialization.java:614)
at
org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.NoClassDefFoundError: javax/persistence/Entity
at org.jboss.seam.Seam.getComponentType(Seam.java:109)
at org.jboss.seam.Component.<init>(Component.java:210)
at org.jboss.seam.Component.<init>(Component.java:199)
at
org.jboss.seam.init.Initialization.addComponent(Initialization.java:1052)
... 26 more
Caused by: java.lang.ClassNotFoundException: javax.persistence.Entity
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 30 more
3. Added hibernate-validator to prevent ClassNotFoundException
POM Changes
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.0.0.GA</version>
</dependency>
EXCEPTION without change
SEVERE: Exception sending context initialized event to listener instance of
class org.jboss.seam.servlet.SeamListener
java.lang.RuntimeException: Could not create Component:
org.jboss.seam.international.statusMessages
at
org.jboss.seam.init.Initialization.addComponent(Initialization.java:1068)
at
org.jboss.seam.init.Initialization.installComponents(Initialization.java:984)
at org.jboss.seam.init.Initialization.init(Initialization.java:646)
at
org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at
org.apache.catalina.core.StandardService.start(StandardService.java:516)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.NoClassDefFoundError:
[Lorg/hibernate/validator/InvalidValue;
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.privateGetPublicMethods(Class.java:2547)
at java.lang.Class.privateGetPublicMethods(Class.java:2563)
at java.lang.Class.getMethods(Class.java:1410)
at org.jboss.seam.Component.hasAnnotation(Component.java:1078)
at org.jboss.seam.Component.<init>(Component.java:212)
at org.jboss.seam.Component.<init>(Component.java:199)
at
org.jboss.seam.init.Initialization.addComponent(Initialization.java:1052)
... 27 more
Caused by: java.lang.ClassNotFoundException:
org.hibernate.validator.InvalidValue
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
... 36 more
4. Seam's version of the Java Expression Language was clashing with Tomcat's
POM Changes
- exclude from seam
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
<version>2.1.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
- comment out from POM
<!--<dependency>-->
<!--<groupId>javax.el</groupId>-->
<!--<artifactId>el-api</artifactId>-->
<!--<version>1.2</version>-->
<!--<scope>runtime</scope>-->
<!--</dependency>-->
Exception without change
java.lang.LinkageError: loader constraint violation: when resolving
interface method
"javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Lj
avax/el/ExpressionFactory;" the class loader (instance of
org/apache/jasper/servlet/JasperLoader) of the current class,
org/apache/jsp/index_jsp, and
the class loader (instance of
org/apache/catalina/loader/StandardClassLoader) for resolved class,
javax/servlet/jsp/JspApplicationContext, have differ
ent Class objects for the type javax/el/ExpressionFactory used in the
signature
at org.apache.jsp.index_jsp._jspInit(index_jsp.java:22)
at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
at
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
let me know if we should use different versions then the ones I have listed.
thanks
dave sinclair
16 years, 3 months
Problem with M2 reading package from Guvnor via RuleAgent
by David Sinclair
I have upgrade my application to use the milestone 2 code and am having a
problem loading a package from guvnor via the rule agent. I am getting a
class not found exception for org.drools.rule.PackageCompilationData. Here
is the stack from the app. Looking at the code it appears the
PackageCompilationData has been removed.
RuleAgent(Drools) INFO (Wed Oct 01 11:55:19 EDT 2008): Configuring with
newInstance=false, secondsToRefresh=60
RuleAgent(Drools) INFO (Wed Oct 01 11:55:19 EDT 2008): Configuring package
provider : URLScanner monitoring URLs: http://localhost:8080/drools-guvnor
/org.drools.guvnor.Guvnor/package/com.sungard.cmdb.rules/0.7-SNAPSHOT
PackageName: com.sungard.cmdb.rules
PackageVersion: 0.7-SNAPSHOT
PackageIsLatest: false
PackageIsSource: false
RuleAgent(Drools) EXCEPTION (Wed Oct 01 11:55:22 EDT 2008):
org.drools.rule.PackageCompilationData. Stack trace should follow.
java.lang.ClassNotFoundException: org.drools.rule.PackageCompilationData
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at
org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:85)
at
org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:97)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at org.drools.rule.Package.readExternal(Package.java:198)
at
java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
at
org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:185)
at
org.drools.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:154)
at
org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:47)
at org.drools.agent.URLScanner.readPackage(URLScanner.java:142)
at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:114)
at
org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:90)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:393)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:345)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:330)
at org.drools.agent.RuleAgent.init(RuleAgent.java:246)
at org.drools.agent.RuleAgent.init(RuleAgent.java:195)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:188)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:156)
thanks
dave
16 years, 3 months