Re: [rules-users] Simple JBoss Rules Sample
Hi Robert, Have you tried the drools 4.0.0 examples ? http://labs.jboss.com/ drools/downloads regards Fernando Meyer http://fmeyer.org [EMAIL PROTECTED] PGP: 0xD804DDFB On Aug 3, 2007, at 1:33 AM, Robert Burdick wrote: Hello All: I am brand new to JBoss Rules / Drools development. I have found the examples with the version 3.0.6 download extremely unenlightening. Can anyone point me to a simple starter application to get a feel for how all of this works? A simple thick client GUI or command line application would be great. Preferably not just a collection og JUnit TestCases, but a real application, no matter how simple, that shows how to exercise the rules engine from Java would be very helpful to me. Thanks, Robert ___ 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] Problems Extending the Golfer example - Cartesian joins ??
Hi Mark, After all the hard work you guys have put into drools recently I hope you had a good holiday. Has anybody had a chance to look at this? Simon On 20/07/07, Mark Proctor [EMAIL PROTECTED] wrote: we'll look into this to see where the memory is going. but won't be for another week or so - I'm currently on holiday. Mark Simon French wrote: Hi, After attending a session with Mark Proctor in London I was inspired to play around with Drools in a slightly different way than we use it for in the workplace, and try and solve a puzzle. Unfortunately I couldn't get Drools to solve it as I kept getting memory problems (I believe are cartesian joins being the problem), so I decided to extend the golfer example to see if I got the same problem I added two new names and a new integer property, club // create all possible Golfer objects String[] names = new String[] { Fred, Joe, Bob, Tom, Des, Terry }; String[] colors = new String[] { red, blue, plaid, orange,black, white }; int[] positions = new int[] { 1, 2, 3, 4, 5, 6 }; int[] clubs = new int[] {9,8,7,4,5,5}; for ( int n = 0; n names.length; n++ ) { for ( int c = 0; c colors.length; c++ ) { for ( int p = 0; p positions.length; p++ ) { for ( int q = 0; q clubs.length; q++ ) { session.insert(new Golfer( names[n], colors[c], positions[p], clubs[q]) ); Then changed the golder.drl to: package com.sample import com.sample.Golfer; rule Golfer Riddle when // A golfer named Fred, Golfer( name == Fred, $fredsPosition : position, $fredsColor : color, $fredsClub : club ) // Der Golfer hinter Fred trägt blau Golfer( $unknownsName : name != Fred, $unknownsPosition : position == ( $fredsPosition + 1 ), $unknownsColor : color == blue, color != $fredsColor, $unknownsClub : club == 5 ) // Joe steht an zweiter Stelle Golfer( name == Joe, $joesPosition : position == 2, position != $fredsPosition, $joesColor : color != $fredsColor, $joesClub : club == 5 ) // Bob traegt Karo Golfer( name == Bob, name != $unknownsName, $bobsPosition : position != $fredsPosition, position != $unknownsPosition, position != $joesPosition, $bobsColor : color == plaid, color != $fredsColor, color != $joesColor, color != $unknownsColor, $bobsClub : club $joesClub ) // Tom ist nicht 1. oder 4., traegt kein Orange Golfer( $tomsName : name == Tom, $tomsPosition : position != 1, position != 4, position != $fredsPosition, position != $joesPosition, position != $bobsPosition, $tomsColor : color != orange, color != blue, color != $fredsColor, color != $joesColor, color != $bobsColor ) Golfer ( $des : name == Des, $desPosition : position $fredsPosition, $desColor : color != blue, color != $fredsColor, color != $joesColor, color != $bobsColor ) Golfer ( $terry : name == Terry, $terryPosition : position $desPosition, $terryColor : color != blue, color != $fredsColor, color != $joesColor, color != $bobsColor ) then System.out.println( Fred + $fredsPosition + + $fredsColor ); System.out.println( Joe + $joesPosition + + $joesColor ); System.out.println( Bob + $bobsPosition + + $bobsColor ); System.out.println( Tom + $tomsPosition + + $tomsColor ); System.out.println ( Des + $desPosition + + $desColor ); System.out.println( terry + $terryPosition + + $terryColor ); end After a couple of minutes of processing I got:- Exception in thread main java.lang.OutOfMemoryError: Java heap space I also changed java memory allocation with -Xms1640M -Xmx1640M (The most I can allocate on my PC), and tried running it as a stateless session too. Is there anything else I can do, or is this simply pushing drools too far (surely not!!) ? I'm very keen on pushing this technology as much as possible in our workplace and I'd really appreciate any help. Thanks in advance Simon -- ___ rules-users mailing list [EMAIL PROTECTED]://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
Re: [rules-users] Golfer Example: Why will the example get two equal result ?
Is there a bug in the golfer example? Someonew want to submit patch? Mark Dr. Gernot Starke wrote: a half answer: I behaved the same in 3.0.6... imho it's the unknown variables that get instantiated differently... but I did not investigate much further... suggestion: ignore - make your own rules behave better :-) Gernot When I test the Golfer example in Drools4.0 environment. I found the rule was matched twice but print same result. I try to override equals() and hashCode() method in Golfer Object, but no change happen. Who can tell me the reason that happened? Thanks. Jason Wang ___ 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] Problems Extending the Golfer example - Cartesian joins ??
I must admit I didn't check against this example. But we did find a memory leak. Each activation remembers its parent activation, this chain was never getting nulled, which meant for recursive algorithms it went out of memory very quickly - this is now fixed. Maybe you can check trunk and make sure that fixes our problem? Trunk is broken at the moment, while we do MVEL updates, but should be fixed in a few hours. I'll message the list when it is - you won't need to build anything yourself as you will then be able to get the latest snapshot to try from here http://cruisecontrol.jboss.com/cc/artifacts/jboss-rules. Mark Simon French wrote: Hi Mark, After all the hard work you guys have put into drools recently I hope you had a good holiday. Has anybody had a chance to look at this? Simon On 20/07/07, * Mark Proctor* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: we'll look into this to see where the memory is going. but won't be for another week or so - I'm currently on holiday. Mark Simon French wrote: Hi, After attending a session with Mark Proctor in London I was inspired to play around with Drools in a slightly different way than we use it for in the workplace, and try and solve a puzzle. Unfortunately I couldn't get Drools to solve it as I kept getting memory problems (I believe are cartesian joins being the problem), so I decided to extend the golfer example to see if I got the same problem I added two new names and a new integer property, club // create all possible Golfer objects String[] names = new String[] { Fred, Joe, Bob, Tom, Des, Terry }; String[] colors = new String[] { red, blue, plaid, orange,black, white }; int[] positions = new int[] { 1, 2, 3, 4, 5, 6 }; int[] clubs = new int[] {9,8,7,4,5,5}; for ( int n = 0; n names.length; n++ ) { for ( int c = 0; c colors.length; c++ ) { for ( int p = 0; p positions.length; p++ ) { for ( int q = 0; q clubs.length; q++ ) { session.insert(new Golfer( names[n], colors[c], positions[p], clubs[q]) ); Then changed the golder.drl to: package com.sample import com.sample.Golfer; rule Golfer Riddle when // A golfer named Fred, Golfer( name == Fred, $fredsPosition : position, $fredsColor : color, $fredsClub : club ) // Der Golfer hinter Fred trägt blau Golfer( $unknownsName : name != Fred, $unknownsPosition : position == ( $fredsPosition + 1 ), $unknownsColor : color == blue, color != $fredsColor, $unknownsClub : club == 5 ) // Joe steht an zweiter Stelle Golfer( name == Joe, $joesPosition : position == 2, position != $fredsPosition, $joesColor : color != $fredsColor, $joesClub : club == 5 ) // Bob traegt Karo Golfer( name == Bob, name != $unknownsName, $bobsPosition : position != $fredsPosition, position != $unknownsPosition, position != $joesPosition, $bobsColor : color == plaid, color != $fredsColor, color != $joesColor, color != $unknownsColor, $bobsClub : club $joesClub ) // Tom ist nicht 1. oder 4., traegt kein Orange Golfer( $tomsName : name == Tom, $tomsPosition : position != 1, position != 4, position != $fredsPosition, position != $joesPosition, position != $bobsPosition, $tomsColor : color != orange, color != blue, color != $fredsColor, color != $joesColor, color != $bobsColor ) Golfer ( $des : name == Des, $desPosition : position $fredsPosition, $desColor : color != blue, color != $fredsColor, color != $joesColor, color != $bobsColor ) Golfer ( $terry : name == Terry, $terryPosition : position $desPosition, $terryColor : color != blue, color != $fredsColor, color != $joesColor, color != $bobsColor ) then System.out.println( Fred + $fredsPosition + + $fredsColor ); System.out.println( Joe + $joesPosition + + $joesColor ); System.out.println( Bob + $bobsPosition + + $bobsColor ); System.out.println( Tom +
Re: [rules-users] SAP Netweaver
I don't think it would be possible to get the Drools IDE working with a version of Eclipse 2, its just too old. I've not heard of anyone getting Drools to work with SAP, but a few years back I did get Drools to work in PeopleSoft I created a bridge to Drools from PeopleCode using the provided interfaces. Mark Heyns, Juan wrote: Hi, I have posed the question on IRC before: Has anybody used JBoss Rules with SAP Netweaver application server? I am curious whether anybody has managed to integrate the eclipse plugins into the the SAP NetWeaver Developer Studio (which is Eclipse 2.1.2 based btw). If anyone has any experiences to share, please let me know. Otherwise I will give some feedback after my attempt. Regards Juan Employees of Lonmin Platinum (Lonplats) are not authorised to conclude electronic transactions or to enter into electronic agreements on behalf of Lonplats. Any electronic signature (other than an advanced electronic signature as defined in the Electronic Communications and Transactions Act of 2003) added to a data message (such as an email or an attachment to an (email) ostensibly on behalf of Lonplats by a Lonplats employee shall not be legally binding on Lonplats and Lonplats shall incur no liability of any nature whatsoever, directly or indirectly, arising from such act on the part of it's employee. It is further recorded that nothing (other than an advanced electronic signature) inserted into any data message emanating from Lonplats shall be construed as constituting an electronic signature ___ 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] RuleFlow process has no id !?
There is a bug in ruleflow where if the .rfm is created after the .rf the .rfm no longer gets updated. The simple answer is to close the .rf and re-open it, everything should be fine after that. This is fixed in trunk and will go into the 4.0.1 release next week. Mark hypnosat7 wrote: Hi, I draw a rule flow with only 2 ruleFlowGroup, I set the process id in the properties view but when I tried to check my rule flow I had this : ruleFlow process has no id this is my ruleFlowTest.rf file : org.drools.ruleflow.core.impl.RuleFlowProcessImpl id=1 nodes id=2 entry long2/long org.drools.ruleflow.core.impl.RuleSetNodeImpl id=3 ruleFlowGroupruleSet1/ruleFlowGroup id2/id nameRuleSet1/name incomingConnections id=4 org.drools.ruleflow.core.impl.ConnectionImpl id=5 type1/type from class=org.drools.ruleflow.core.impl.StartNodeImpl id=6 id1/id nameStart/name incomingConnections id=7/ outgoingConnections id=8 org.drools.ruleflow.core.impl.ConnectionImpl reference=5/ /outgoingConnections /from to class=org.drools.ruleflow.core.impl.RuleSetNodeImpl reference=3/ /org.drools.ruleflow.core.impl.ConnectionImpl /incomingConnections outgoingConnections id=9 org.drools.ruleflow.core.impl.ConnectionImpl id=10 type1/type from class=org.drools.ruleflow.core.impl.RuleSetNodeImpl reference=3/ to class=org.drools.ruleflow.core.impl.RuleSetNodeImpl id=11 ruleFlowGroupruleSet2/ruleFlowGroup id3/id nameRuleSet2/name incomingConnections id=12 org.drools.ruleflow.core.impl.ConnectionImpl reference=10/ /incomingConnections outgoingConnections id=13 org.drools.ruleflow.core.impl.ConnectionImpl id=14 type1/type from class=org.drools.ruleflow.core.impl.RuleSetNodeImpl reference=11/ to class=org.drools.ruleflow.core.impl.EndNodeImpl id=15 id5/id nameEnd/name incomingConnections id=16 org.drools.ruleflow.core.impl.ConnectionImpl reference=14/ /incomingConnections outgoingConnections id=17/ /to /org.drools.ruleflow.core.impl.ConnectionImpl /outgoingConnections /to /org.drools.ruleflow.core.impl.ConnectionImpl /outgoingConnections /org.drools.ruleflow.core.impl.RuleSetNodeImpl /entry entry long1/long org.drools.ruleflow.core.impl.StartNodeImpl reference=6/ /entry entry long3/long org.drools.ruleflow.core.impl.RuleSetNodeImpl reference=11/ /entry entry long5/long org.drools.ruleflow.core.impl.EndNodeImpl reference=15/ /entry /nodes variables id=18/ lastNodeId5/lastNodeId nameruleFlowTest/name typeRuleFlow/type /org.drools.ruleflow.core.impl.RuleFlowProcessImpl ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Finally block equivalent in Drools
Is there anyway to make sure that a particular rule gets fired before exiting in Drools 3.0.6 4.0? Some thing synonyms to the finally block in java. Thanks in Advance. -- View this message in context: http://www.nabble.com/Finally-block-equivalent-in-Drools-tf4214256.html#a11989235 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] Finally block equivalent in Drools
This can be achieved with Agenda Groups. Put your main application into its own agenda-group and then the exit rule leave in the MAIN agenda-group. then when your application agenda-group has finished it will pop and evaluate anything that is left in MAIN. Mark Dr. Gernot Starke wrote: Try a catchall-rule like the following: rule catchall when eval (true ) then System.out.println(catchall); // your catchall code goes here end The LHS (condition part) of this is always true, therefore this rule will always be scheduled for execution. IMHO it should always fire last due to the prioritization-strategy (complex rules first...) hope it helps, Gernot http://rbs.gernotstarke.de Am 03.08.2007 um 21:12 schrieb McShiv: Is there anyway to make sure that a particular rule gets fired before exiting in Drools 3.0.6 4.0? Some thing synonyms to the finally block in java. Thanks in Advance. -- View this message in context: http://www.nabble.com/Finally-block-equivalent-in-Drools-tf4214256.html#a11989235 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 Dr. Gernot Starke Doing IT Right --- Willi-Lauf Allee 43, D-50858 Köln [EMAIL PROTECTED], +49 (0) 177 - 728 2570 http://www.gernotstarke.de Blog: http://it-and-more.blogspot.com Das freie Portal für Software-Architekten: http://www.arc42.de ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] drools-example-brms
Fernando, Thanks for the update. I downloaded and tried the updated zip on the downloads page and the serialVersionUID issue is fixed. There is still one problem with the example. When you run the example (following all the instructions) I get a ClassNotFoundException: org.drools.rule.builder.dialect.mvel.MVELDialect$ModifyInterceptor (see stack below). I think the example needs to include the drools-compiler-4.0.0.jar in the eclipse project classpath as I suggested in my original post. Regards Shahad RuleAgent(insuranceconfig) EXCEPTION (Sat Aug 04 00:42:54 BST 2007): org.drools.rule.builder.dialect.mvel.MVELDialect$ModifyInterceptor. Stack trace should follow. java.lang.ClassNotFoundException: org.drools.rule.builder.dialect.mvel.MVELDialect$ModifyInterceptor at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at java.io.ObjectInputStream.resolveClass(Unknown Source) at org.drools.common.DroolsObjectInputStream.resolveClass( DroolsObjectInputStream.java:74) at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.util.HashMap.readObject(Unknown Source) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at java.io.ObjectStreamClass.invokeReadObject(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at java.util.HashMap.readObject(Unknown Source) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at java.io.ObjectStreamClass.invokeReadObject(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at org.drools.rule.Package.readExternal(Package.java:184) at java.io.ObjectInputStream.readExternalData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.readObject(Unknown Source) at org.drools.agent.HttpClientImpl.fetchPackage(HttpClientImpl.java:54) at org.drools.agent.URLScanner.readPackage(URLScanner.java:137) at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:109) at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:88) at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:297) at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:265) at org.drools.agent.RuleAgent.configure(RuleAgent.java:251) at org.drools.agent.RuleAgent.init(RuleAgent.java:183) at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:192) 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) RuleAgent(insuranceconfig) WARNING (Sat Aug 04 00:42:54 BST 2007): Was unable
[rules-users] Performance Tuning
I am trying to improve performance on a Large DataSet, few Rules app and came accross these two properties, which by default is false: RuleBaseConfiguration.PROPERTY_INDEX_LEFT_BETA_MEMORY RuleBaseConfiguration.PROPERTY_HASH_ALPHA_NODES What do they mean actually? How and when should I use them? I am trying to chase a O(n^2) performance problem that I understand it is probably caused by the way I coded the rules, but it seems that I need to deepen my understanding to actually find the hotspots. Are there any techniques (that I probably dont know) that can help me find what rule(s) is causing the issue? As always thanks for previous answers - Yuri ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users