[rules-users] Some serious problems while authoring rules
I am facing some serious blocking issues while writing few rules. In the rule below, a1, a2 are Double objects. When i have the first statement in the rule EMIAgainstProperty( obj : a1 ), the rule does not firewhen i comment and re phrase the second line as emi : EMIAgainstProperty( a2 = ( * new* Double(10* 1.5 )) ), the rule is fired. Why is the first line making the rule not to fire. I have reported a similar problem yesterday, but could not find a resolution. On the other hand, i am unable to refer a1 directly to say a1.doubleValue() in the second line, it throws up and error. Any help??? What is the way out? * rule* Test *when* EMIAgainstProperty( obj : a1 ) emi : EMIAgainstProperty( a2 = ( *new* Double(obj.doubleValue() * 1.5 )) ) *then * System.out.println( Passed ); * end * ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Hello Mark
Mark, Have you released the final version of 4.0.0. Under the download page http://labs.jboss.com/jbossrules/downloads i see the MR3 listed. Thanks Natraj ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Some serious problems while authoring rules
Hi, please list your EMIAgainsProperty class... Gernot I am facing some serious blocking issues while writing few rules. In the rule below, a1, a2 are Double objects. When i have the first statement in the rule EMIAgainstProperty( obj : a1 ), the rule does not firewhen i comment and re phrase the second line as emi : EMIAgainstProperty( a2 = ( * new* Double(10* 1.5 )) ), the rule is fired. Why is the first line making the rule not to fire. I have reported a similar problem yesterday, but could not find a resolution. On the other hand, i am unable to refer a1 directly to say a1.doubleValue() in the second line, it throws up and error. Any help??? What is the way out? * rule* Test *when* EMIAgainstProperty( obj : a1 ) emi : EMIAgainstProperty( a2 = ( *new* Double(obj.doubleValue() * 1.5 )) ) *then * System.out.println( Passed ); * end * ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Dr. Gernot Starke Willi-Lauf Allee 43, D-50858 Köln Tel. +49 (0) 177 - 728 2570 Mail: [EMAIL PROTECTED] http://www.gernotstarke.de http://www.arc42.de ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] custom rule creation/parsing
On Mon, Jul 16, 2007 at 05:03:28PM +0100, Mark Proctor wrote: descr's cover the full range of the drl language. I recommend you parse some drl files into descrs, and look at the creates AST with your debugger. Okay, I took some simple example from Drools examples (HelloWorldExample) and tried to reverse engineer package object in Eclipse debugger, but looks like the package object doesn't contain any objects from descr package. I assume I need to compile that Package object somehow? Could somebody please point me to the right way in getting solid knowledge of how can I build custom package descriptor w/o any DRL/XML - but from my custom rule descriptors/storage? Thank you in advance! -- Eugene N Dzhurinsky ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] org.drools.common.RuleFlowGroupNode
When I fire my rules with a giving rule flow I have this exception : java.lang.ClassCastException: org.drools.common.RuleFlowGroupNode cannot be cast to org.drools.spi.Activation at org.drools.ruleflow.instance.impl.RuleFlowSplitInstanceImpl.trigger(RuleFlowSplitInstanceImpl.java:90) at org.drools.ruleflow.instance.impl.RuleFlowSequenceNodeInstanceImpl.triggerCompleted(RuleFlowSequenceNodeInstanceImpl.java:38) at org.drools.common.RuleFlowGroupImpl$DeactivateCallback.execute(RuleFlowGroupImpl.java:212) at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1135) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:394) at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:384) Any help pls ? -- View this message in context: http://www.nabble.com/org.drools.common.RuleFlowGroupNode-tf4108894.html#a11684418 Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] NoClassDefFoundError for BaseObjectClassFieldExtractor when running in Tomcat
It seems to be a bug, please could you open a Ticket in jira and provide additional information for that? Thanks Fernando Meyer http://fmeyer.org [EMAIL PROTECTED] PGP: 0xD804DDFB On Jul 18, 2007, at 9:16 AM, Jesse Stockall wrote: The NoClassDefFoundError exception is thrown from within drools code, so it's obviously in the classpath. The problem appears to be with the mechanism used by drools to load it's own code. Jesse On Wed, 2007-18-07 at 02:14 -0300, Fernando Meyer wrote: You should add the drools-core library as a required dependency. Fernando Meyer http://fmeyer.org [EMAIL PROTECTED] PGP: 0xD804DDFB On Jul 17, 2007, at 9:55 AM, Jesse Stockall wrote: Tomcat 5.5 Java 1.5 jbossrules-4.0.0.12865MR3 I have an instance of Drools running inside a webapp deployed on Tomcat. The rules have been compiled ahead of time and are loaded in with: InputStream is = PolicyRuntime.class.getResourceAsStream(name); DroolsObjectInputStream in = new DroolsObjectInputStream(is); Package p = (Package) in.readObject(); When run outside Tomcat it loads fine, when run inside Tomcat I get: java.lang.NoClassDefFoundError: org/drools/base/extractors/ BaseObjectClassFieldExtractor at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at org.drools.base.ClassFieldExtractorFactory $ByteArrayClassLoader.defineClass(ClassFieldExtractorFactory.java: 455) at org.drools.base.ClassFieldExtractorFactory.getClassFieldExtractor (ClassFieldExtractorFactory.java:114) at org.drools.base.ClassFieldExtractor.init (ClassFieldExtractor.java:77) at org.drools.base.ClassFieldExtractor.init (ClassFieldExtractor.java:57) at org.drools.base.ClassFieldExtractorCache.getExtractor (ClassFieldExtractorCache.java:35) at org.drools.base.ClassFieldExtractor.readResolve (ClassFieldExtractor.java:72) I've tried adding DroolsObjectInputStream.class.getClassLoader () , PolicyRuntime.class.getClassLoader() and Thread.currentThread ().getContextClassLoader() to the constructor of the DroolsObjectInputStream but none had any effect. Thanks Jesse ___ 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 ___ 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] JBossRules and JAVA Servlet / JSP
You are getting an error at run time. Make sure you include all the required drools jars in your run time class path. THis will resolve the issue. If you are using an eclipse launch config, it is very easy to set the class path jars. You need to know that compile time libraries and run time libraries have to indicated separately. Thanks Natraj On 7/19/07, Mohammed JBossRules [EMAIL PROTECTED] wrote: Hello, I'm a new user for JBossRules, and I'm feeling like turning around since a while, so i thought that sole body could help... I'm using JBossRules(V4.0.0.12865MR3) on eclipse (Version: 3.3.0 Build id: I20070621-1340) on MS-Windows XP and Java(TM) SE Runtime Environment (build 1.6.0_01-b06) now the problem is how to use my rules (simple rules in a DRL file) in a dynamic project based on JSP/Servlets... i've imported the compiler, the core, jsr94, decisiontable, and also the core 3.2.3 jars to my build path , but when i try to execute the same code i'm having errors like: The import org.drools cannot be resolved but i have imported the core!! what's wrong? help please regards ___ 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
[rules-users] Modifying the fact more than once within a rule
Hello All, Has anyone faced a situation where a fact gets modified more than once within a given DRL. The modification is required so that the other rules properly fire based on the consequence of the earlier. I am able to get through the modifyRetract() and modifyInsert() once in a rule consequence, but the second time i do it, it goes into an infinite loop and results in out of memory. Why is it that i cant modify the object more than once. In such a case, how to deal with business scenarios which need this. Also, is it possible to handle the execution of another DRL within one DRL. Thanks Natraj Gudla ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] JBossRules and JAVA Servlet / JSP
http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesTomcat Mohammed JBossRules wrote: Hello, I'm a new user for JBossRules, and I'm feeling like turning around since a while, so i thought that sole body could help... I'm using JBossRules(V4.0.0.12865MR3) on eclipse (Version: 3.3.0 Build id: I20070621-1340) on MS-Windows XP and Java(TM) SE Runtime Environment (build 1.6.0_01-b06) now the problem is how to use my rules (simple rules in a DRL file) in a dynamic project based on JSP/Servlets... i've imported the compiler, the core, jsr94, decisiontable, and also the core 3.2.3 jars to my build path , but when i try to execute the same code i'm having errors like: The import org.drools cannot be resolved but i have imported the core!! what's wrong? help please regards ___ 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] custom rule creation/parsing
Look ath te PackageBuilder src and the addFromDrl - you'll see there the first bit of code that builds the descr. Also look the DrlParserTest which parses code segments and checks the resulting descrs. Mark Eugeny N Dzhurinsky wrote: On Mon, Jul 16, 2007 at 05:03:28PM +0100, Mark Proctor wrote: descr's cover the full range of the drl language. I recommend you parse some drl files into descrs, and look at the creates AST with your debugger. Okay, I took some simple example from Drools examples (HelloWorldExample) and tried to reverse engineer package object in Eclipse debugger, but looks like the package object doesn't contain any objects from descr package. I assume I need to compile that Package object somehow? Could somebody please point me to the right way in getting solid knowledge of how can I build custom package descriptor w/o any DRL/XML - but from my custom rule descriptors/storage? Thank you in advance! ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Some serious problems while authoring rules
You do understand that what you have there is a cross product, you'll need two objects to match against that - were you expecting this to wokr against and on the same single EMIAgainstProperty object? Mark Natraj Gudla wrote: I am facing some serious blocking issues while writing few rules. In the rule below, a1, a2 are Double objects. When i have the first statement in the rule EMIAgainstProperty( obj : a1 ), the rule does not firewhen i comment and re phrase the second line as emi : EMIAgainstProperty( a2 = ( *new* Double(10* 1.5 )) ), the rule is fired. Why is the first line making the rule not to fire. I have reported a similar problem yesterday, but could not find a resolution. On the other hand, i am unable to refer a1 directly to say a1.doubleValue () in the second line, it throws up and error. Any help??? What is the way out? * rule * Test *when* EMIAgainstProperty( obj : a1 ) emi : EMIAgainstProperty( a2 = ( *new* Double(obj.doubleValue() * 1.5 )) ) *then* System.out.println( Passed );* end * ___ 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] Proposal: Collect Case Studies
Someone has a subproject for a solver framework, see the taseree project at sourceforce, when it has matured it will become part of the main release in the drools-solver project directory. I'm sure Geoffrey would love any additional help. I already plan to extend this for Genetic Algorithms, as that is my academic background. Mark Ellen Zhao wrote: Hi folks, I used to buy some hardware from here and played with their configurator: http://www.alternate.de/html/includeStaticBig.html?treeName=KONFIGURATORENfile=BuildersIncLevel1=; (The page is in German but they have graphic icons around it's not hard to understand) If you choose an amd based motherboard and an Intel CPU together, their web configuration will warn you and you have to re-choose. I do not really know how they implemented it but I thought a rule-based implementation is very suitable for such kind of thing. I ran into a combinatorial optimization problem recently. At the first thought, any Rete-based rule engine is not really the right tool for searching optimal solutions in a *huge* solution space. But when I started to implement my algorithm, it turns out that Drools can still possibly help me in two places. I decided to use Monte Carlo optimization algorithms, for my problem the most interesting candidates are evolution strategy and genetic algorithms. Before I start to randomly poll elements from the solution space, I could use drools to efficiently filter out the absolutely unwanted elements (this has its drawbacks too...depends on how tolerate to the end result the end users *want* to be). My filter condition changes very often (it would depends on the things like personal preference of a particular user, etc), so using drools for filtering makes sense. The filtering does effectively reduce the solution space. And then, drools could be used to calculate the global score after each poll from the solution space. If I use the genetic algorithm, the mixing rules could also be defined in a .drl file (which will be very easy to change, and yes, it needs frequent changes when I want to tune the system). The gene mixing could also be running in Drools' working memory. There might be some performance gain against straight iteration + data manipulation in a single java procedure. But I have not implemented it yet (will start coding from tomorrow), so far not sure about the performance gain. if anything turns out good, I'd be glad to report. Regards, Ellen N. Zhao On 7/18/07, Dr. Gernot Starke [EMAIL PROTECTED] wrote: Hi Drools-users, to further promote JBoss-Drools I suggest to compile a few practical application scenarios or case-studies. A few of you gave hints on your application domains as answer to Re: [rules-users] Entreprise using Drools with success. I am most willing to document examples, as long as you provide enough details (plus sample rules...). What about a section in the JBoss-Drools-Wiki? I'll start writing a sample one of these days - so far see my first ideas on content-based routing: http://rbs.gernotstarke.de/samples/samples/routing.html feedback welcome Gernot ___ 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Re: Entreprise using Drools with success
heh, can I quote this in my blog? Actually if people want to send me their findings, don't have to mention your employers I can do this anonymously, then I'll put them all up together on the blog :) Mark Matt Geis wrote: Not quite able to say who I work for, but we run a brokerage app for which we licensed the source code. We've been running/modding the app for the last 3 years, so it's pretty much our app now, in terms of how familiar we are with it, and how much we've changed/tuned it. That being said, our app had a custom rules engine, with a bloated XML language, etc. In evaluating Drools, I tested out commission calculation. We have about 40 scenarios, so I created 1000 trades of each type, put them in a collection, and shuffled it. Commission calculation in our old rules engine took about 38000ms, and Drools did it in about 250ms. So, the speed, and the fact that to download it, read the docs, write all the rules using a DSL, and write and run the test took me only about 4 hours (never having seen Drools before) led me to think that it merited a closer look. Matt Yahoo! oneSearch: Finally, mobile search that gives answers, not web links. http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC ___ 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] Proposal: Collect Case Studies
That would be fantastic, I'm useless at coming up with examples, I think that's true for most devs :) The wiki is open to all, and over time we can figure out how to better present the information - maybe even put it towards part of a book. I want to wait till the next release (end of this year) so that we are complete - we still need backward chaining, analytics, ontology modelling, testing, decision trees and I also want ruleflow to mature a bit more - then we should be a complete platform and ready for a book :) There are two additional community projects that, if they get finished, would make great complimentary techs to the book. Someone is working on a pluggeable belief subsystem (fuzzy logic, uncertaintity) as part of their Phd and someone else on a solver framework built on top of Drools. My aim has always been to build an AI platform, not just a rules engine, so those projects certainly help in that direction. Mark Dr. Gernot Starke wrote: Hi Drools-users, to further promote JBoss-Drools I suggest to compile a few practical application scenarios or case-studies. A few of you gave hints on your application domains as answer to Re: [rules-users] Entreprise using Drools with success. I am most willing to document examples, as long as you provide enough details (plus sample rules...). What about a section in the JBoss-Drools-Wiki? I'll start writing a sample one of these days - so far see my first ideas on content-based routing: http://rbs.gernotstarke.de/samples/samples/routing.html feedback welcome Gernot ___ 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] Using Rule Flow
I have just updated conways game of life example to use ruleflow, the agenda group one still exists. So execute ConwayAgendaGroupRun and ConwayRuleFlowGroupRun to run the two examples. AgendaGroupDelegate and RueFlowDelegate show the two different implementations. Mark Natraj Gudla wrote: Hi, Has any one used Rule FLow with 4.0.0. I am looking for some help on how to use rule flow, where to mention the drl file name. How to use it in the java invoker classes. I have tried something, created a TestRuleFlow.rf, then added a rule group, gave it a group name as drl file name. When i use the PackageBuilder to add the rule flow, it throws the following exception _ com.thoughtworks.xstream.alias.CannotResolveClassException _: org.drools.ruleflow.core.impl.RuleFlowProcess : org.drools.ruleflow.core.impl.RuleFlowProcess at com.thoughtworks.xstream.mapper.DefaultMapper.realClass( _DefaultMapper.java:35_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.XmlFriendlyMapper.realClass( _XmlFriendlyMapper.java:44_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass( _ClassAliasingMapper.java:49_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass( _DynamicProxyMapper.java:46_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.ArrayMapper.realClass( _ArrayMapper.java:70_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.CachingMapper.realClass( _CachingMapper.java:27_) at com.thoughtworks.xstream.core.TreeUnmarshaller.start( _TreeUnmarshaller.java:95_) at com.thoughtworks.xstream.core.ReferenceByIdMarshallingStrategy.unmarshal( _ReferenceByIdMarshallingStrategy.java:12_) at com.thoughtworks.xstream.XStream.unmarshal( _XStream.java:552_) at com.thoughtworks.xstream.XStream.unmarshal( _XStream.java:540_) at com.thoughtworks.xstream.XStream.fromXML( _XStream.java:490_) at org.drools.compiler.ProcessBuilder.addProcessFromFile( _ProcessBuilder.java:76_) at org.drools.compiler.PackageBuilder.addRuleFlow( _PackageBuilder.java:199_) at com.drools.sample.ParseDRL.readRuleFromDrl( _ParseDRL.java:72_) at com.drools.sample.ParseDRL.main( _ParseDRL.java:23_)_ com.thoughtworks.xstream.alias.CannotResolveClassException _: org.drools.ruleflow.core.impl.RuleFlowProcess : org.drools.ruleflow.core.impl.RuleFlowProcess at com.thoughtworks.xstream.mapper.DefaultMapper.realClass( _DefaultMapper.java:35_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.XmlFriendlyMapper.realClass( _XmlFriendlyMapper.java:44_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass( _ClassAliasingMapper.java:49_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass( _DynamicProxyMapper.java:46_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.ArrayMapper.realClass( _ArrayMapper.java:70_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( _MapperWrapper.java:18_) at com.thoughtworks.xstream.mapper.CachingMapper.realClass( _CachingMapper.java:27_) at com.thoughtworks.xstream.core.TreeUnmarshaller.start( _TreeUnmarshaller.java:95_) at com.thoughtworks.xstream.core.ReferenceByIdMarshallingStrategy.unmarshal( _ReferenceByIdMarshallingStrategy.java:12_) at com.thoughtworks.xstream.XStream.unmarshal( _XStream.java:552_) at com.thoughtworks.xstream.XStream.unmarshal( _XStream.java:540_) at com.thoughtworks.xstream.XStream.fromXML( _XStream.java:490_) at
Re: [rules-users] JBossRules and JAVA Servlet / JSP
hello, i've got it :); what i shoult import into my build path was not the core and compiler but all the set contained in the drools library, maybe that would help someone later here is the list of jars antlr-runtime.jar drools-compiler.jar drools-core.jar drools-decisiontables.jar drools-documentation.jar drools-jsr94.jar jsr94.jar junit.jar jxl.jar mvel14.jar xercesImpl.jar xml-apis.jar xpp3.jar xstream.jar with kind regards, Mohammed JBossRules wrote: Hello, I'm a new user for JBossRules, and I'm feeling like turning around since a while, so i thought that sole body could help... I'm using JBossRules(V4.0.0.12865MR3) on eclipse (Version: 3.3.0 Build id: I20070621-1340) on MS-Windows XP and Java(TM) SE Runtime Environment (build 1.6.0_01-b06) now the problem is how to use my rules (simple rules in a DRL file) in a dynamic project based on JSP/Servlets... i've imported the compiler, the core, jsr94, decisiontable, and also the core 3.2.3 jars to my build path , but when i try to execute the same code i'm having errors like: The import org.drools cannot be resolved but i have imported the core!! what's wrong? help please regards ___ 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] Some serious problems while authoring rules
you have two patterns, there for you need two objects - it's a cross product. Try using an eval instead of a predicate, then you can bind all your variables on the first line, and eval them on the next line. Until you move to 4.0 there is no clean way to do this. Mark Natraj Gudla wrote: Yes, infact i expected both the conditions to work against the same object in the working memory? Is it not possible? For this scenario, drools has not been allowing me to do a comparison amongst two attributes of the same class. When i do so, it complains of not being to resolve the variable. Some thing like a1 a2 does not work. I am forced to create a declaration and then use it to compare. If i do so, the run time thing fails. How do i get around to compare two attributes from the same class. Something like a1 a2 or say a1 (a2 * 1.5) Thanks Natraj On 7/19/07, *Mark Proctor* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: You do understand that what you have there is a cross product, you'll need two objects to match against that - were you expecting this to wokr against and on the same single EMIAgainstProperty object? Mark Natraj Gudla wrote: I am facing some serious blocking issues while writing few rules. In the rule below, a1, a2 are Double objects. When i have the first statement in the rule EMIAgainstProperty( obj : a1 ), the rule does not firewhen i comment and re phrase the second line as emi : EMIAgainstProperty( a2 = ( *new* Double(10* 1.5 )) ), the rule is fired. Why is the first line making the rule not to fire. I have reported a similar problem yesterday, but could not find a resolution. On the other hand, i am unable to refer a1 directly to say a1.doubleValue () in the second line, it throws up and error. Any help??? What is the way out? * rule *Test *when* EMIAgainstProperty( obj : a1 ) emi : EMIAgainstProperty( a2 = ( *new* Double(obj.doubleValue() * 1.5 )) ) *then* System.out.println( Passed );* end * ___ rules-users mailing list rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org mailto:rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: Re: [rules-users] JBossRules and JAVA Servlet / JSP
hello, Thank you all for your replays; as you've suggested, what i should import into my build path was not the core and compiler but all the set contained in the drools library, maybe that would help someone later! here is the list of jars antlr-runtime.jar drools-compiler.jar drools-core.jar drools-decisiontables.jar drools-documentation.jar drools-jsr94.jar jsr94.jar junit.jar jxl.jar mvel14.jar xercesImpl.jar xml-apis.jar xpp3.jar xstream.jar and thankyou Mark for the link, with kind regards, Natraj Gudla wrote: You are getting an error at run time. Make sure you include all the required drools jars in your run time class path. THis will resolve the issue. If you are using an eclipse launch config, it is very easy to set the class path jars. You need to know that compile time libraries and run time libraries have to indicated separately. Thanks Natraj On 7/19/07, *Mohammed JBossRules* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hello, I'm a new user for JBossRules, and I'm feeling like turning around since a while, so i thought that sole body could help... I'm using JBossRules(V4.0.0.12865MR3) on eclipse (Version: 3.3.0 Build id: I20070621-1340) on MS-Windows XP and Java(TM) SE Runtime Environment (build 1.6.0_01-b06) now the problem is how to use my rules (simple rules in a DRL file) in a dynamic project based on JSP/Servlets... i've imported the compiler, the core, jsr94, decisiontable, and also the core 3.2.3 jars to my build path , but when i try to execute the same code i'm having errors like: The import org.drools cannot be resolved but i have imported the core!! what's wrong? help please regards ___ rules-users mailing list rules-users@lists.jboss.org mailto: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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Using Rule Flow
Mark, Did you place them at http://labs.jboss.com/jbossrules/downloads . I dont see them available here. Thanks Natraj On 7/19/07, Mark Proctor [EMAIL PROTECTED] wrote: I have just updated conways game of life example to use ruleflow, the agenda group one still exists. So execute ConwayAgendaGroupRun and ConwayRuleFlowGroupRun to run the two examples. AgendaGroupDelegate and RueFlowDelegate show the two different implementations. Mark Natraj Gudla wrote: Hi, Has any one used Rule FLow with 4.0.0. I am looking for some help on how to use rule flow, where to mention the drl file name. How to use it in the java invoker classes. I have tried something, created a TestRuleFlow.rf, then added a rule group, gave it a group name as drl file name. When i use the PackageBuilder to add the rule flow, it throws the following exception * com.thoughtworks.xstream.alias.CannotResolveClassException *: org.drools.ruleflow.core.impl.RuleFlowProcess : org.drools.ruleflow.core.impl.RuleFlowProcess at com.thoughtworks.xstream.mapper.DefaultMapper.realClass( *DefaultMapper.java:35*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.XmlFriendlyMapper.realClass( *XmlFriendlyMapper.java:44*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass( *ClassAliasingMapper.java:49*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass( *DynamicProxyMapper.java:46*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.ArrayMapper.realClass( *ArrayMapper.java:70*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.CachingMapper.realClass( *CachingMapper.java:27*) at com.thoughtworks.xstream.core.TreeUnmarshaller.start( *TreeUnmarshaller.java:95*) at com.thoughtworks.xstream.core.ReferenceByIdMarshallingStrategy.unmarshal( *ReferenceByIdMarshallingStrategy.java:12*) at com.thoughtworks.xstream.XStream.unmarshal( *XStream.java:552*) at com.thoughtworks.xstream.XStream.unmarshal( *XStream.java:540*) at com.thoughtworks.xstream.XStream.fromXML( *XStream.java:490*) at org.drools.compiler.ProcessBuilder.addProcessFromFile( *ProcessBuilder.java:76*) at org.drools.compiler.PackageBuilder.addRuleFlow( *PackageBuilder.java:199*) at com.drools.sample.ParseDRL.readRuleFromDrl( *ParseDRL.java:72*) at com.drools.sample.ParseDRL.main( *ParseDRL.java:23*)* com.thoughtworks.xstream.alias.CannotResolveClassException *: org.drools.ruleflow.core.impl.RuleFlowProcess : org.drools.ruleflow.core.impl.RuleFlowProcess at com.thoughtworks.xstream.mapper.DefaultMapper.realClass( *DefaultMapper.java:35*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.XmlFriendlyMapper.realClass( *XmlFriendlyMapper.java:44*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass( *ClassAliasingMapper.java:49*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass( *DynamicProxyMapper.java:46*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.ArrayMapper.realClass( *ArrayMapper.java:70*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.MapperWrapper.realClass( *MapperWrapper.java:18*) at com.thoughtworks.xstream.mapper.CachingMapper.realClass( *CachingMapper.java:27*) at com.thoughtworks.xstream.core.TreeUnmarshaller.start( *TreeUnmarshaller.java:95*) at com.thoughtworks.xstream.core.ReferenceByIdMarshallingStrategy.unmarshal( *ReferenceByIdMarshallingStrategy.java:12*) at com.thoughtworks.xstream.XStream.unmarshal( *XStream.java:552*) at com.thoughtworks.xstream.XStream.unmarshal(
Re: Re: [rules-users] JBossRules and JAVA Servlet / JSP
hello, Thank you all for your replays; as you've suggested, what i should import into my build path was not the core and compiler but all the set contained in the drools library, maybe that would help someone later! here is the list of jars antlr-runtime.jar drools-compiler.jar drools-core.jar drools-decisiontables.jar drools-documentation.jar drools-jsr94.jar jsr94.jar junit.jar jxl.jar mvel14.jar xercesImpl.jar xml-apis.jar xpp3.jar xstream.jar and thankyou Mark for the link, with kind regards, Natraj Gudla wrote: You are getting an error at run time. Make sure you include all the required drools jars in your run time class path. THis will resolve the issue. If you are using an eclipse launch config, it is very easy to set the class path jars. You need to know that compile time libraries and run time libraries have to indicated separately. Thanks Natraj On 7/19/07, *Mohammed JBossRules* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hello, I'm a new user for JBossRules, and I'm feeling like turning around since a while, so i thought that sole body could help... I'm using JBossRules(V4.0.0.12865MR3) on eclipse (Version: 3.3.0 Build id: I20070621-1340) on MS-Windows XP and Java(TM) SE Runtime Environment (build 1.6.0_01-b06) now the problem is how to use my rules (simple rules in a DRL file) in a dynamic project based on JSP/Servlets... i've imported the compiler, the core, jsr94, decisiontable, and also the core 3.2.3 jars to my build path , but when i try to execute the same code i'm having errors like: The import org.drools cannot be resolved but i have imported the core!! what's wrong? help please regards ___ rules-users mailing list rules-users@lists.jboss.org mailto: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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
RE: [rules-users] Entreprise using Drools with success
Hi, We are using Drools VERY succesfuly around 3 years (We started with version 2.x). And it has being so usefull that now we have a very big system running on more than one customer in telecom market. Main (Obvious) Advantages: 1-All open source and community envolvment benefits (Well tested code, new and innovative use cases, new features added quickly, source code availableand many more) 2-Very simple, quick, cheap and clean implementation of new features. 3-No need to re-build entire system due to new or changes in business rules/needs, VERY high degree of flexibility and freedom 4-Knowledge is almost explicit and start to become formal for the organization 5-You can build framworks that accepts different Object Models and Rules, while all the infra-structure supporting it is the same, so with basically same code we can build different solutions. This leads to rocket-time implementations and extremally short learning curves. What we use Drools for? 1-As a rules engine as usual 2-For reporting stuff (Good for generating reports with different views of data, very easy to reformat dates, numbers and so on...) 3-For discimination networks (We are affraid of shadow facts on this :) ) Currently we do have a server running around 300 rules, where we assert millions of facts at once. The objective is to guide and rate telecom usage events. We are able to apply those 300 rules over 20 Milion facts and get results (Guided and Rated) around 1 hour(Note: First we have to read many binary files, perform a charset conversion on data, load it in our object model, assert objects in working memory, apply around 200 rules to enrich the data, assert again in a new working memory, and rate the events accessing external RDBMS databases - caching results of course). Acctually what we do is to in batch/server workflow assert those facts twice (Two working memories) in sequence. The first one is to enrich the data (Discrimination Network...) and instead of modifying the events here, we just go to next step and then assert those facts again and apply rating rules. It seams to perform better. Issues and Cares: 1-Avoid at ANY cost cartesian products. It kills you. This is a common mistake, easy to do, easy to detect (Symptons are typical...Slow down performance, memory consuption is very high, application will probably swap), hard to find where it is and easy to solve. 2-Memory consumption is always an issue 3-Have a very good design to access external databases (If possible, think about on having a database cache running outside your JVM) 4-Follows Edson Tirelli's tips and tricks. 5-Be carefull with numbers and dates formatting, conversion and calculation (as in my experience Java performs poorly on this area) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anstis, Michael (M.) Sent: quarta-feira, 18 de julho de 2007 11:10 To: Rules Users List Subject: RE: [rules-users] Entreprise using Drools with success We short-listed Drools against ILOG and Fair Issac. V4.0 was to be the technical winner but for (a) per CPU support cost and (b) internal politics. It was (and still is) a shame we had to sell out :-( Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Sam-Bodden Sent: 18 July 2007 15:01 To: Rules Users List Subject: Re: [rules-users] Entreprise using Drools with success We deployed a Drools based solution to a client in the pharmaceutical distribution world (Fortune 100 company :-). We used Drools to power the decisions an interactive voice ordering system. A small number of rules initially but growing constantly based on user metrics. System has been running for a couple of years now. On 7/18/07, Geoffrey Wiseman [EMAIL PROTECTED] wrote: On 7/18/07, hypnosat7 [EMAIL PROTECTED] wrote: Is there any companies which used Drools successfully ? Tell us more about your experiences, I need it to make decision I've worked at a company that used it internally in its product before, although I don't work there now. It worked well for us; and everything I've seen about subsequent releases implies it's better than ever. Now, that's not to say that any of us can predict your success; it does depend on how you plan on using it, but for the most part, I'd say Drools / JBoss Rules is a relatively easy-to-use, powerful and performant choice for many of the things people consider using it for. - Geoffrey -- Geoffrey Wiseman ___ 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] [resolved] JBossRules and JAVA Servlet / JSP
HI, Thank you all for your replays; as you've suggested, what i should import into my build path was not the core and compiler but all the set contained in the drools library, maybe that would help someone later! here is the list of jars antlr-runtime.jar drools-compiler.jar drools-core.jar drools-decisiontables.jar drools-documentation.jar drools-jsr94.jar jsr94.jar junit.jar jxl.jar mvel14.jar xercesImpl.jar xml-apis.jar xpp3.jar xstream.jar thankyou Mark for the li,k with kind regards, Natraj Gudla wrote: You are getting an error at run time. Make sure you include all the required drools jars in your run time class path. THis will resolve the issue. If you are using an eclipse launch config, it is very easy to set the class path jars. You need to know that compile time libraries and run time libraries have to indicated separately. Thanks Natraj On 7/19/07, *Mohammed JBossRules* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hello, I'm a new user for JBossRules, and I'm feeling like turning around since a while, so i thought that sole body could help... I'm using JBossRules(V4.0.0.12865MR3) on eclipse (Version: 3.3.0 Build id: I20070621-1340) on MS-Windows XP and Java(TM) SE Runtime Environment (build 1.6.0_01-b06) now the problem is how to use my rules (simple rules in a DRL file) in a dynamic project based on JSP/Servlets... i've imported the compiler, the core, jsr94, decisiontable, and also the core 3.2.3 jars to my build path , but when i try to execute the same code i'm having errors like: The import org.drools cannot be resolved but i have imported the core!! what's wrong? help please regards ___ rules-users mailing list rules-users@lists.jboss.org mailto: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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Loading more than 10000 rules
Hello, I am using drools 3.0.6 for a retail customer. We have the current problem that we can not add more than 1 rules. After this, the system increases its memory and runs out of memory. Is there a limit ? Thanks Nicolas Heron ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Accessing maps (hashmaps) keys and values in rules
We are using Maps (HashMaps) in our rules and the only way we have found to access keys and values in the Map in the when clauses is thru use on eval() which I know is a big no-no by rules purists. Is there a better way, maybe some shorthand I'm not familiar with to deal with Maps in the when clause? Thanks, Dennis ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] The effect of not using shadow facts
Edson, I think I've discovered the problem. In the file Rete.java, in the method assertObject, there is a check for shadow proxy like below: Class cls = object.getClass(); if ( object instanceof ShadowProxy ) { cls = cls.getSuperclass(); } If the class being proxied was final, and your new logic chose an interface of that class to build a proxy from, then the superclass is Object.class. This leads to an incorrect selection of cachedNodes further down in the method. I've traced this through the debugger with my object types, and it does show that a node for a SortieStatus is being given an object of type LaunchRecoveryStatusShadowProxy, which is not compatible. Perhaps theres a different way to determine the type of object such that type LaunchRecoveryStatusShadowProxy will return LaunchRecoveryStatus rather than Object. Please take a look and let me know if I need to provide more info. Thanks, -Chris West On 7/18/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, What seems to be happening us that your SortieStatus interface has a state attribute. Drools is trying to read this attribute value and cast it to LaunchRecoveryStatusShadowProxy what is causing the problems... Best way to solve would be to have the code so I can debug. Is it possible to isolate it and send me? []s Edson 2007/7/18, Chris West [EMAIL PROTECTED]: Edson, It is certainly possible to create a JDK proxy with only some of the interfaces that are present on the delegate object that you are proxying, but in my case, my proxies have all the interfaces of the underlying object. The top two lines of the call stack I sent shows the following: Exception in thread main java.lang.ClassCastException: ascc.status.FlightOpsStatusBoard$LaunchRecoveryStatusShadowProxy at org.drools.base.ascc.status.AirPlanStatusBoard$SortieStatus$getState.getValue(Unknown Source) What's strange here is that the ClassCastException seems to be caused by casting an object of type SortieStatus to type LaunchRecoveryStatusShadowProxy, if I'm reading that right. The types SortieStatus and LaunchRecoveryStatus are both interfaces in my code, and they never appear on the same fact object (so no SortieStatus will ever be a LaunchRecoveryStatus and vice-versa). So I'm wondering why the cast is occuring, since it is not possible to work. The unfortunate part is I cannot see into the class where the cast is occurring, as it is a generated class created by drools. -Chris West On 7/18/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, For the solution to work, it is important that a superclass or interface matches all the ObjectTypes in your rulebase that your final class (proxy) matches... I guess that is the case with JDK proxies, isn't it? []s Edson 2007/7/18, Chris West [EMAIL PROTECTED] : Edson, I downloaded and built the latest from the trunk of the repository. I applied this new build toward my test case, and it seemed to fix the problem. However, when I applied it to my real project, it still exhibits the problem. If I discover more information about the problem I'll let you know. Thanks, Chris West On 7/17/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, I found and developed an intermediate solution that shall work for your proxies. If it is not possible to create a shadow fact for a class that is asserted (because the class is final or whatever), the engine goes up in the class hierarchy, looking for a class or interface for which is possible to create the proxy, but that still matches all ObjectTypes available in the rule base matched by the original class. The analysis is a bit complex, specially because new rules with new object types can be dynamically added to the rule base, but I believe the solution will work for JDK proxies and the most common proxy frameworks out there, that usually don't proxy multiple unrelated interfaces at once. So, I ask you please to get latest snapshot from the repository and try it out for your use case and report back to the list the results, since seems there are a few other people using similar things. Thanks, Edson 2007/7/17, Chris West [EMAIL PROTECTED]: Is that still true if the equals() and hashcode() methods are only based on the identity fields of the object (which cannot change)? -Chris West On 7/17/07, Mark Proctor [EMAIL PROTECTED] wrote: you only need to use modifyRetract if the object is inserted. The reason for this is if you change field values on your facts we will not be able to remove them from our various internal hashmaps; thus the need to remove first prior to any changes, then make the changes and then insert it
Re: [rules-users] Loading more than 10000 rules
Heron, There is no hard limit on rules, but you may need indeed to tune jvm configuration to be able to handle such number of rules. Are you running out of permgen? What are your memory settings? In your use case, must all the 1 rules be in the same rulebase? Is it possible to partition the rules into multiple rulebases? []s Edson 2007/7/19, Héron Nicolas [EMAIL PROTECTED]: Hello, I am using drools 3.0.6 for a retail customer. We have the current problem that we can not add more than 1 rules. After this, the system increases its memory and runs out of memory. Is there a limit ? Thanks Nicolas Heron ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli Software Engineer - JBoss Rules Core Developer Office: +55 11 3529-6000 Mobile: +55 11 9287-5646 JBoss, a division of Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] drools-example-brms
use double \ in your config. file ex. D:\\workspace2\\drools-example-brms\\cache Fernando Meyer http://fmeyer.org [EMAIL PROTECTED] PGP: 0xD804DDFB On Jul 19, 2007, at 9:31 AM, David Nogueras wrote: Hi, I´m trying to run the brms sample and i get the next output: RuleAgent(insuranceconfig) INFO (Thu Jul 19 14:27:44 CEST 2007): Configuring with newInstance=true, secondsToRefresh=30 RuleAgent(insuranceconfig) INFO (Thu Jul 19 14:27:44 CEST 2007): Configuring package provider : URLScanner monitoring URLs: http:// localhost:8080/drools-jbrms/org.drools.brms.JBRMS/package/ org.acme.insurance/David2 with local cache dir of D:\workspace2 \drools-example-brms\cache RuleAgent(insuranceconfig) WARNING (Thu Jul 19 14:27:44 CEST 2007): Falling back to local cache. java.lang.NullPointerException at org.drools.agent.FileScanner.readPackage(FileScanner.java:101) at org.drools.agent.FileScanner.getChangeSet (FileScanner.java:79) at org.drools.agent.FileScanner.loadPackageChanges (FileScanner.java:57) at org.drools.agent.URLScanner.loadPackageChanges (URLScanner.java:93) at org.drools.agent.RuleAgent.checkForChanges (RuleAgent.java:291) at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:259) at org.drools.agent.RuleAgent.configure(RuleAgent.java:228) at org.drools.agent.RuleAgent.init(RuleAgent.java:160) at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:169) at org.acme.insurance.launcher.InsuranceBusiness.loadRuleBase (InsuranceBusiness.java:26) at org.acme.insurance.launcher.InsuranceBusiness.executeExample (InsuranceBusiness.java:14) at org.acme.insurance.launcher.MainClass.main(MainClass.java:13) could someone help me? ___ 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] Accessing maps (hashmaps) keys and values in rules
Denis, If you are using latest build from trunk (I'm not sure it already works in MR3), you can use a simplified MVEL syntax: when Person( address[business].phone == ) then ... end Although, the above will be converted into an inline-eval. Not as bad as a top level eval, but still more costly then using regular fields. []s Edson 2007/7/19, Ryan, Dennis (Dennis) [EMAIL PROTECTED]: We are using Maps (HashMaps) in our rules and the only way we have found to access keys and values in the Map in the when clauses is thru use on eval() which I know is a big no-no by rules purists. Is there a better way, maybe some shorthand I'm not familiar with to deal with Maps in the when clause? Thanks, Dennis ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli Software Engineer - JBoss Rules Core Developer Office: +55 11 3529-6000 Mobile: +55 11 9287-5646 JBoss, a division of Red Hat @ www.jboss.com ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] The effect of not using shadow facts
Chris, Right on the spot. I changed other references, but this one passed unnoticed. The correct is: Class cls = null; if ( object instanceof ShadowProxy ) { cls = ((ShadowProxy)object).getShadowedObject().getClass(); } else { cls = object.getClass(); } I made a text search this time and found no other occurence of this problem. I commited the fix in revision #13637. Take a look and let me know if you still has problems. Thank you a lot, Edson 2007/7/19, Chris West [EMAIL PROTECTED]: Edson, I think I've discovered the problem. In the file Rete.java, in the method assertObject, there is a check for shadow proxy like below: Class cls = object.getClass(); if ( object instanceof ShadowProxy ) { cls = cls.getSuperclass(); } If the class being proxied was final, and your new logic chose an interface of that class to build a proxy from, then the superclass is Object.class. This leads to an incorrect selection of cachedNodes further down in the method. I've traced this through the debugger with my object types, and it does show that a node for a SortieStatus is being given an object of type LaunchRecoveryStatusShadowProxy, which is not compatible. Perhaps theres a different way to determine the type of object such that type LaunchRecoveryStatusShadowProxy will return LaunchRecoveryStatus rather than Object. Please take a look and let me know if I need to provide more info. Thanks, -Chris West On 7/18/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, What seems to be happening us that your SortieStatus interface has a state attribute. Drools is trying to read this attribute value and cast it to LaunchRecoveryStatusShadowProxy what is causing the problems... Best way to solve would be to have the code so I can debug. Is it possible to isolate it and send me? []s Edson 2007/7/18, Chris West [EMAIL PROTECTED]: Edson, It is certainly possible to create a JDK proxy with only some of the interfaces that are present on the delegate object that you are proxying, but in my case, my proxies have all the interfaces of the underlying object. The top two lines of the call stack I sent shows the following: Exception in thread main java.lang.ClassCastException: ascc.status.FlightOpsStatusBoard$LaunchRecoveryStatusShadowProxy at org.drools.base.ascc.status.AirPlanStatusBoard$SortieStatus$getState.getValue(Unknown Source) What's strange here is that the ClassCastException seems to be caused by casting an object of type SortieStatus to type LaunchRecoveryStatusShadowProxy, if I'm reading that right. The types SortieStatus and LaunchRecoveryStatus are both interfaces in my code, and they never appear on the same fact object (so no SortieStatus will ever be a LaunchRecoveryStatus and vice-versa). So I'm wondering why the cast is occuring, since it is not possible to work. The unfortunate part is I cannot see into the class where the cast is occurring, as it is a generated class created by drools. -Chris West On 7/18/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, For the solution to work, it is important that a superclass or interface matches all the ObjectTypes in your rulebase that your final class (proxy) matches... I guess that is the case with JDK proxies, isn't it? []s Edson 2007/7/18, Chris West [EMAIL PROTECTED] : Edson, I downloaded and built the latest from the trunk of the repository. I applied this new build toward my test case, and it seemed to fix the problem. However, when I applied it to my real project, it still exhibits the problem. If I discover more information about the problem I'll let you know. Thanks, Chris West On 7/17/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, I found and developed an intermediate solution that shall work for your proxies. If it is not possible to create a shadow fact for a class that is asserted (because the class is final or whatever), the engine goes up in the class hierarchy, looking for a class or interface for which is possible to create the proxy, but that still matches all ObjectTypes available in the rule base matched by the original class. The analysis is a bit complex, specially because new rules with new object types can be dynamically added to the rule base, but I believe the solution will work for JDK proxies and the most common proxy frameworks out there, that usually don't proxy multiple unrelated interfaces at once. So, I ask you please to get latest snapshot from the repository and try it out for your use case and report back to the list the results, since seems there are a few other
Re: [rules-users] The effect of not using shadow facts
Edson, Thanks for incorporating this fix. The good news is that it fixes that problem. The bad news for me is that I'm now experiencing a different problem (where my rules are not firing). I'll look into my new problem a little deeper. Thanks again. -Chris West On 7/19/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, Right on the spot. I changed other references, but this one passed unnoticed. The correct is: Class cls = null; if ( object instanceof ShadowProxy ) { cls = ((ShadowProxy)object).getShadowedObject().getClass(); } else { cls = object.getClass(); } I made a text search this time and found no other occurence of this problem. I commited the fix in revision #13637. Take a look and let me know if you still has problems. Thank you a lot, Edson 2007/7/19, Chris West [EMAIL PROTECTED]: Edson, I think I've discovered the problem. In the file Rete.java, in the method assertObject, there is a check for shadow proxy like below: Class cls = object.getClass(); if ( object instanceof ShadowProxy ) { cls = cls.getSuperclass(); } If the class being proxied was final, and your new logic chose an interface of that class to build a proxy from, then the superclass is Object.class. This leads to an incorrect selection of cachedNodes further down in the method. I've traced this through the debugger with my object types, and it does show that a node for a SortieStatus is being given an object of type LaunchRecoveryStatusShadowProxy, which is not compatible. Perhaps theres a different way to determine the type of object such that type LaunchRecoveryStatusShadowProxy will return LaunchRecoveryStatus rather than Object. Please take a look and let me know if I need to provide more info. Thanks, -Chris West On 7/18/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, What seems to be happening us that your SortieStatus interface has a state attribute. Drools is trying to read this attribute value and cast it to LaunchRecoveryStatusShadowProxy what is causing the problems... Best way to solve would be to have the code so I can debug. Is it possible to isolate it and send me? []s Edson 2007/7/18, Chris West [EMAIL PROTECTED]: Edson, It is certainly possible to create a JDK proxy with only some of the interfaces that are present on the delegate object that you are proxying, but in my case, my proxies have all the interfaces of the underlying object. The top two lines of the call stack I sent shows the following: Exception in thread main java.lang.ClassCastException: ascc.status.FlightOpsStatusBoard$LaunchRecoveryStatusShadowProxy at org.drools.base.ascc.status.AirPlanStatusBoard$SortieStatus$getState.getValue(Unknown Source) What's strange here is that the ClassCastException seems to be caused by casting an object of type SortieStatus to type LaunchRecoveryStatusShadowProxy, if I'm reading that right. The types SortieStatus and LaunchRecoveryStatus are both interfaces in my code, and they never appear on the same fact object (so no SortieStatus will ever be a LaunchRecoveryStatus and vice-versa). So I'm wondering why the cast is occuring, since it is not possible to work. The unfortunate part is I cannot see into the class where the cast is occurring, as it is a generated class created by drools. -Chris West On 7/18/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, For the solution to work, it is important that a superclass or interface matches all the ObjectTypes in your rulebase that your final class (proxy) matches... I guess that is the case with JDK proxies, isn't it? []s Edson 2007/7/18, Chris West [EMAIL PROTECTED] : Edson, I downloaded and built the latest from the trunk of the repository. I applied this new build toward my test case, and it seemed to fix the problem. However, when I applied it to my real project, it still exhibits the problem. If I discover more information about the problem I'll let you know. Thanks, Chris West On 7/17/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, I found and developed an intermediate solution that shall work for your proxies. If it is not possible to create a shadow fact for a class that is asserted (because the class is final or whatever), the engine goes up in the class hierarchy, looking for a class or interface for which is possible to create the proxy, but that still matches all ObjectTypes available in the rule base matched by the original class. The analysis is a bit complex, specially because new rules with
Re: [rules-users] The effect of not using shadow facts
Ouch! Is all that trouble a result of using JDK proxies in drools? If it is, I think it is the case of us developing a whole set of unit and integration tests for this specific scenario, since none of our tests are triggering errors... Thanks and please keep me posted of your progress or any problems you find. []s Edson 2007/7/19, Chris West [EMAIL PROTECTED]: Edson, Thanks for incorporating this fix. The good news is that it fixes that problem. The bad news for me is that I'm now experiencing a different problem (where my rules are not firing). I'll look into my new problem a little deeper. Thanks again. -Chris West On 7/19/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, Right on the spot. I changed other references, but this one passed unnoticed. The correct is: Class cls = null; if ( object instanceof ShadowProxy ) { cls = ((ShadowProxy)object).getShadowedObject().getClass(); } else { cls = object.getClass(); } I made a text search this time and found no other occurence of this problem. I commited the fix in revision #13637. Take a look and let me know if you still has problems. Thank you a lot, Edson 2007/7/19, Chris West [EMAIL PROTECTED]: Edson, I think I've discovered the problem. In the file Rete.java, in the method assertObject, there is a check for shadow proxy like below: Class cls = object.getClass(); if ( object instanceof ShadowProxy ) { cls = cls.getSuperclass(); } If the class being proxied was final, and your new logic chose an interface of that class to build a proxy from, then the superclass is Object.class. This leads to an incorrect selection of cachedNodes further down in the method. I've traced this through the debugger with my object types, and it does show that a node for a SortieStatus is being given an object of type LaunchRecoveryStatusShadowProxy, which is not compatible. Perhaps theres a different way to determine the type of object such that type LaunchRecoveryStatusShadowProxy will return LaunchRecoveryStatus rather than Object. Please take a look and let me know if I need to provide more info. Thanks, -Chris West On 7/18/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, What seems to be happening us that your SortieStatus interface has a state attribute. Drools is trying to read this attribute value and cast it to LaunchRecoveryStatusShadowProxy what is causing the problems... Best way to solve would be to have the code so I can debug. Is it possible to isolate it and send me? []s Edson 2007/7/18, Chris West [EMAIL PROTECTED]: Edson, It is certainly possible to create a JDK proxy with only some of the interfaces that are present on the delegate object that you are proxying, but in my case, my proxies have all the interfaces of the underlying object. The top two lines of the call stack I sent shows the following: Exception in thread main java.lang.ClassCastException: ascc.status.FlightOpsStatusBoard$LaunchRecoveryStatusShadowProxy at org.drools.base.ascc.status.AirPlanStatusBoard$SortieStatus$getState.getValue(Unknown Source) What's strange here is that the ClassCastException seems to be caused by casting an object of type SortieStatus to type LaunchRecoveryStatusShadowProxy, if I'm reading that right. The types SortieStatus and LaunchRecoveryStatus are both interfaces in my code, and they never appear on the same fact object (so no SortieStatus will ever be a LaunchRecoveryStatus and vice-versa). So I'm wondering why the cast is occuring, since it is not possible to work. The unfortunate part is I cannot see into the class where the cast is occurring, as it is a generated class created by drools. -Chris West On 7/18/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, For the solution to work, it is important that a superclass or interface matches all the ObjectTypes in your rulebase that your final class (proxy) matches... I guess that is the case with JDK proxies, isn't it? []s Edson 2007/7/18, Chris West [EMAIL PROTECTED] : Edson, I downloaded and built the latest from the trunk of the repository. I applied this new build toward my test case, and it seemed to fix the problem. However, when I applied it to my real project, it still exhibits the problem. If I discover more information about the problem I'll let you know. Thanks, Chris West On 7/17/07, Edson Tirelli [EMAIL PROTECTED] wrote: Chris, I found and
Re: [rules-users] frequency of digest posts
I just went no mail because of this. At least with Nabble, I just get one email per day :) Matt Geis wrote: Why is it that the digest comes almost as frequently as individual emails? I've received eight separate digest emails in the last five hours, and I can only assume I'll get another ten or so by the end of the day? I subscribe because I like to keep up on what's going on with JBoss Rules, but there is a reason I chose digest as my delivery option, after all. Can an admin throttle the flow a little bit? It seems like someone has defined a threshhold whereby if 2 KB of text accumulate, it's time to drain the queue and send out a digest. Thanks, Matt Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=listsid=396545469 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- View this message in context: http://www.nabble.com/frequency-of-digest-posts-tf4098501.html#a11695210 Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Predicate expression effect on performance
What is the extent of the performance impact caused by using predicate expressions? Check( amount == $amount ) or Check( $amt : amount - (isSameAmount($amt, $amount) ) My understanding is that once asserted the amount property will be cached in the shadow fact, is the result of isSameAmount(...) also cached? thanks, -- yuri ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Modifying the fact more than once within a rule
Hello Edson, It is the modifications in different rule consequences and not the single one. I have pasted the 4 rules which are involved here... My frist two rules are mutually exclusive as are the next two. When i execute, Calculate Business Profit,1 fires, followed by Calcualte AIC. As soon as this second rule fires, i see the system going into an infinite loop, reevluating all the rules once again. the no-loop true does not work here. I have a business scenario where i need to modify the object in the second rule, as there are further rules which use it. Is this an expected behavior??? Or is My Code wrong? *rule Calculate Business profit,1* salience 1000 no-loop true when emi : EMIAgainstProperty ( businessProfit2 (businessProfit1 * 1.5) ) then modifyRetract(emi); emi.setBusinessProfit((emi.getBusinessProfit1 ()+emi.getBusinessProfit2())/2); modifyInsert(emi); end *rule Calculate Business profit,2* salience 999 no-loop true when emi : EMIAgainstProperty ( businessProfit2 = (businessProfit1 * 1.5) ) then modifyRetract(emi); emi.setBusinessProfit(emi.getBusinessProfit2()); modifyInsert(emi); end *rule Calculate AIC* salience 998 no-loop true when emi: EMIAgainstProperty( businessProfit ( businessProfit1 * 2) ) then System.out.println( AIC +emi.getBusinessProfit()); modifyRetract(emi); emi.setAIC(emi.getBusinessProfit1()*2); modifyInsert(emi); end *rule Calculate AIC1* no-loop true salience 997 when emi: EMIAgainstProperty( businessProfit = ( businessProfit1 * 2) ) then modifyRetract(emi); System.out.println( AIC Less +emi.getBusinessProfit()); emi.setAIC(emi.getBusinessProfit()); modifyInsert(emi); end On 7/19/07, Edson Tirelli [EMAIL PROTECTED] wrote: Natraj, You mean modifying twice inside the same rule consequence? There should be no problem in modifying a fact twice inside the same consequence besides wasted effort, so if you are going into an infinite loop, that is a bug. Would you please open a JIRA with a test case showing the problem? Having said that, there is no reason to modify a fact twice inside the same consequence block, so if that is the case, you may also check your code again. Now, if you are talking about modifying a fact in the consequence of 2 different rules, then you need to verify if your modification is not causing rules to be reevaluated and fired in loops, what is possible to happen and you need to fix your rules to avoid that. []s Edson 2007/7/19, Natraj Gudla [EMAIL PROTECTED]: Hello All, Has anyone faced a situation where a fact gets modified more than once within a given DRL. The modification is required so that the other rules properly fire based on the consequence of the earlier. I am able to get through the modifyRetract() and modifyInsert() once in a rule consequence, but the second time i do it, it goes into an infinite loop and results in out of memory. Why is it that i cant modify the object more than once. In such a case, how to deal with business scenarios which need this. Also, is it possible to handle the execution of another DRL within one DRL. Thanks Natraj Gudla ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Edson Tirelli Software Engineer - JBoss Rules Core Developer Office: +55 11 3529-6000 Mobile: +55 11 9287-5646 JBoss, a division of Red Hat @ www.jboss.com ___ 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] Loading more than 10000 rules
If you see the error out of PermSpace you can increase perm space. Another strategy, is to build the rules, in chunks, say 1000 at a time, take the Package object, and *then* add it to the rulebase. That may make it easier. You will need more then the default space on the heap for this I would expect. On 7/20/07, Héron Nicolas [EMAIL PROTECTED] wrote: Hello, I am using drools 3.0.6 for a retail customer. We have the current problem that we can not add more than 1 rules. After this, the system increases its memory and runs out of memory. Is there a limit ? Thanks Nicolas Heron ___ 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] Predicate expression effect on performance
In a sense, yes - but its the result of the comparison that is cached really. In the case you described, it is subrule generation. So either side of the or is like a separate rule. In version 3, the result of isSameAmount (ie if it was true or false) is cached. Things will only be re-checked if the Check fact changes (and the engine knows about the change). Note that this checking happens as you are asserting objects, not when you fireAllRules necessarily. On 7/20/07, Yuri de Wit [EMAIL PROTECTED] wrote: What is the extent of the performance impact caused by using predicate expressions? Check( amount == $amount ) or Check( $amt : amount - (isSameAmount($amt, $amount) ) My understanding is that once asserted the amount property will be cached in the shadow fact, is the result of isSameAmount(...) also cached? thanks, -- yuri ___ 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] Predicate expression effect on performance
(sorry, the OR was not part of the sample rule: I was just considering the same rule written in two different ways) I am seeing a considerable performance problem with my rules and I am trying to narrow down why. I have a small number or rules but hundreds of thousands of facts. At first the assertion goes very fast but it quickly degrades as more facts are asserted. I already reordered the predicates (I have between 8-12 predicates in most rules and reordered them more restrictive first) and saw some improvements, but not nearly enough. Then thought about to what extent predicate expressions where hitting me. Per what you say that cant be the reason. If Check is updated (as you mentioned) would that be equivalent to reasserting it into memory? I keep a status as a property of Check that get updated somewhat often. thanks, On 7/20/07, Michael Neale [EMAIL PROTECTED] wrote: In a sense, yes - but its the result of the comparison that is cached really. In the case you described, it is subrule generation. So either side of the or is like a separate rule. In version 3, the result of isSameAmount (ie if it was true or false) is cached. Things will only be re-checked if the Check fact changes (and the engine knows about the change). Note that this checking happens as you are asserting objects, not when you fireAllRules necessarily. On 7/20/07, Yuri de Wit [EMAIL PROTECTED] wrote: What is the extent of the performance impact caused by using predicate expressions? Check( amount == $amount ) or Check( $amt : amount - (isSameAmount($amt, $amount) ) My understanding is that once asserted the amount property will be cached in the shadow fact, is the result of isSameAmount(...) also cached? thanks, -- yuri ___ 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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users