Re: [rules-users] expert: usage of ruleflow-groups
oh! I'm so sorry... typos in XML are impossible to detect :( Again, thank you so much for your help. I'll correct this and will use the agenda-groups the way you suggested. _ miguel On Wed, May 5, 2010 at 10:01 AM, Wolfgang Laun wolfgang.l...@gmail.comwrote: How did you specify the agenda group in the XML? There aren't much checks being done in XML handling, so it's easy to slip up. Here's how I interpret the XML schema: rule name=myrule rule-attribute name=agenda-group value=group42/ ... -W 2010/5/5 miguel machado mls.mach...@gmail.com: Hi, Yeah, i think this might be a bug indeed. I just tried converting to DRL using the dumper and the agenda-group item doesn't show up in the generated DRL file. It is possible that that this tag isn't being interpreted for the same reason it isn't being converted into the DRL format. Can someone please confirm this? Anyway, if this doesn't work.. is there any kind of workaround? Maybe using ruleflow-group's or any other technique? Thank you. _ miguel On Wed, May 5, 2010 at 9:11 AM, Wolfgang Laun wolfgang.l...@gmail.com wrote: If you don't have auto-focus, rules from other agenda groups should not fire. XML should not matter. A bug might be possible, e.g., due to misinterpretation of the rules in XML. -W -- To understand what is recursion you must first understand recursion ___ 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 -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Chained Rules
there is the 'extends' feature.. i guess that's what you're looking for. rule xyz ... end rule abc extends xyz... ... end it's been recently talked about in this forum. _ miguel On Tue, May 4, 2010 at 10:46 AM, djb dbrownel...@hotmail.com wrote: Hi all, I know there are some basic ways to chain rules together, by setting flags in consequences that are checked in the conditions of other rules... but in a large system based on rule templates, where thousands of rules are generated, it is not feasible to chain rules in this manner, especially when they are chained in a somewhat arbitrary fashion (eg. True if Rule 130 AND Rule 200 AND Rule 480 fire) has anyone had this situation before? would I need to execute this as a post-processing step? or, is there any design pattern that will allow rules to be chained, preferably in a manageable way? regards, Daniel -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Chained-Rules-tp775491p775491.html 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 -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Need Sample Java Code
You can also write your rules in DRL which is much, much easier (especially in eclipse) and then convert it to XML, like this: public static synchronized String convertDrlToXmlRule(String drlRule) throws DroolsParserException { DrlParser parser = new DrlParser(); PackageDescr descr = parser.parse(drlRule); XmlDumper dumper = new XmlDumper(); String xmlDumped = dumper.dump(descr); // XmlPackageReader xmlReader = new XmlPackageReader(); return xmlDumped; } Also, there are some examples in the documentation pages. _ miguel 2010/5/5 Esteban Aliverti esteban.alive...@gmail.com You can always take a look at the tests in the source code. 2010/5/5 ashok kumar softwarebudd...@gmail.com Hi Team, I need sample java code that on Drools v5.0.. can anyone share the rule XML file format along with the sample code that fires the rules defined in XML? Do i need to save the file with '.xml' extension or it will be XML data in .drl file? Please throw some light on this.. Thanks, JFly. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Esteban Aliverti ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how exists works exactly?
Olá Antonio, // retract all of it just in case for (Object fact : ksession.getFactHandles()) { ksession.retract((FactHandle) fact); } Hope this helps. _ miguel 2010/5/5 Antonio Neto antoniosouzan...@gmail.com Hi, Thank you very much for all replies. I've tried also with not ( EPackage(...)), but the result is the same. I think that I remove the EClass from the facts in my solution, but they continue in my workingMemory. How I can see the facts of the workingMemory object (and how remove it)? Thanks Best regards Antonio 2010/5/5 fgad...@genigraph.fr Hi Antonio, Documentation states that the complement to not is exists, whereas not keyword is used to match the absence of a fact (in Working Memory), and exists keyword is used to test the existence of one or more facts (in Working memory). So if you want to test that a fact is not in working memory, then you should use the not(MyClass()) pattern. Hope this helps, Francois. Antonio Neto antoniosouzan...@gmail.com a écrit : Any idea? Please... 2010/5/4 Antonio Neto antoniosouzan...@gmail.com Hi all, I don't know exactly why I have a problem in my exists function. I've tried many different ways, but it does not work. Anybody could help me, please? I have the following rules: *rule diff when $var1: EReference(name == employee) $var2: EClass(name == Company, EAllReferences contains $var1) not (exists( EPackage(EClassifiers contains $var2 ) )) then insertLogical(new IntConstraintOccurrence(diff, 10)); end rule ClassesNotReferenced when $q1 : EClass(); $q2 : EPackage(EClassifiers contains $q1); not( exists ( EReference(EType == $q1) )); then insertLogical(new IntConstraintOccurrence(ClassesNotReferenced, 1, $q1)); end* and in my facts (and my EPackage) I have 4 instances of EClass Company with a EReference employee, and another EClass Person. I still have a move that removes EClasses in my Drools Solver. I need to have only one classe Company after processing. But it removes only the EClass Person, when it was supposed to remove one EClass Person and 3 ECLasses Company. Leaving one EClass Company in the end. The problem is: when Drools tries to remove a EClass Person it thinks that the EClass Company does not exists. But in fact there are 3 others. Any clue about it, please ? Thanks Bests regards Antonio ___ 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 -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rule fires while condition is false
Hi there, er.. why don't you remove your eval and just evaluate in the object binding? $var = TypeOfObject( netRepaymentAmountAbilityIncludingLiabilities = 0.65) Other than that, i don't think a lotta people are still using drools4 and i have no idea why that is happening. Apparently, it makes no sense :-/ _ miguel On Thu, May 6, 2010 at 5:53 AM, Shai Bentin s...@centimia.com wrote: I'm running drools 4. It has been running for a long time with no issues. I have this weird issue now and I'm wondering what can explain this. I have the following rule defined. rule netRepaymentWithLiabilities1 agenda-group autoUnderwriting when #conditions enrichedApplication: EnrichedApplicationVersionTO() eval (enrichedApplication.getNetRepaymentAmountAbilityIncludingLiabilities() = 0.65) decision: Decision() then #actions System.out.println(!! + (enrichedApplication.getNetRepaymentAmountAbilityIncludingLiabilities() = 0.65)); decision.setDecision(APPROVED, NetRepaymentWthLiblt); end This rule invokes although 'enrichedApplication.getNetRepaymentAmountAbilityIncludingLiabilities()' 1. More over in the then part it prints 'false', so how come it invoked while the condition is not fulfilled? What can cause this? Shai ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Bug in not ???
This is not entirely true: you may have different objects in memory in such a way that both fires rule. In this case, if you had two (or more!) AccountHolders for the same Employment, each of those having different BusinessName's associated, both rules (with and without the 'not') would fire. Does that make sense? _ miguel 2010/5/5 tom.e.mur...@wellsfargo.com The following rule fires both when the “not” is there, and also if the “not” is commented out. Clearly, both cannot be true, so there is something wrong somewhere. -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] how exists works exactly?
Oi Miguel, when I try this in the doMove method using the workingMemory instead of ksession I got this error Exception in thread main java.lang.UnsupportedOperationException: this is implementedby StatefulKnowledgeImpl at org.drools.reteoo.ReteooWorkingMemory.getFactHandles (ReteooWorkingMemory.java:363) ... ... Any idea? Obrigado Antonio 2010/5/6 miguel machado mls.mach...@gmail.com Olá Antonio, // retract all of it just in case for (Object fact : ksession.getFactHandles()) { ksession.retract((FactHandle) fact); } Hope this helps. _ miguel 2010/5/5 Antonio Neto antoniosouzan...@gmail.com Hi, Thank you very much for all replies. I've tried also with not ( EPackage(...)), but the result is the same. I think that I remove the EClass from the facts in my solution, but they continue in my workingMemory. How I can see the facts of the workingMemory object (and how remove it)? Thanks Best regards Antonio 2010/5/5 fgad...@genigraph.fr Hi Antonio, Documentation states that the complement to not is exists, whereas not keyword is used to match the absence of a fact (in Working Memory), and exists keyword is used to test the existence of one or more facts (in Working memory). So if you want to test that a fact is not in working memory, then you should use the not(MyClass()) pattern. Hope this helps, Francois. Antonio Neto antoniosouzan...@gmail.com a écrit : Any idea? Please... 2010/5/4 Antonio Neto antoniosouzan...@gmail.com Hi all, I don't know exactly why I have a problem in my exists function. I've tried many different ways, but it does not work. Anybody could help me, please? I have the following rules: *rule diff when $var1: EReference(name == employee) $var2: EClass(name == Company, EAllReferences contains $var1) not (exists( EPackage(EClassifiers contains $var2 ) )) then insertLogical(new IntConstraintOccurrence(diff, 10)); end rule ClassesNotReferenced when $q1 : EClass(); $q2 : EPackage(EClassifiers contains $q1); not( exists ( EReference(EType == $q1) )); then insertLogical(new IntConstraintOccurrence(ClassesNotReferenced, 1, $q1)); end* and in my facts (and my EPackage) I have 4 instances of EClass Company with a EReference employee, and another EClass Person. I still have a move that removes EClasses in my Drools Solver. I need to have only one classe Company after processing. But it removes only the EClass Person, when it was supposed to remove one EClass Person and 3 ECLasses Company. Leaving one EClass Company in the end. The problem is: when Drools tries to remove a EClass Person it thinks that the EClass Company does not exists. But in fact there are 3 others. Any clue about it, please ? Thanks Bests regards Antonio ___ 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 -- To understand what is recursion you must first understand recursion ___ 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] how exists works exactly?
No idea.. that piece of code works for me, using drools 5.0.1 :-/ 2010/5/6 Antonio Neto antoniosouzan...@gmail.com Oi Miguel, when I try this in the doMove method using the workingMemory instead of ksession I got this error Exception in thread main java.lang.UnsupportedOperationException: this is implementedby StatefulKnowledgeImpl at org.drools.reteoo.ReteooWorkingMemory.getFactHandles (ReteooWorkingMemory.java:363) ... ... Any idea? Obrigado Antonio 2010/5/6 miguel machado mls.mach...@gmail.com Olá Antonio, // retract all of it just in case for (Object fact : ksession.getFactHandles()) { ksession.retract((FactHandle) fact); } Hope this helps. _ miguel 2010/5/5 Antonio Neto antoniosouzan...@gmail.com Hi, Thank you very much for all replies. I've tried also with not ( EPackage(...)), but the result is the same. I think that I remove the EClass from the facts in my solution, but they continue in my workingMemory. How I can see the facts of the workingMemory object (and how remove it)? Thanks Best regards Antonio 2010/5/5 fgad...@genigraph.fr Hi Antonio, Documentation states that the complement to not is exists, whereas not keyword is used to match the absence of a fact (in Working Memory), and exists keyword is used to test the existence of one or more facts (in Working memory). So if you want to test that a fact is not in working memory, then you should use the not(MyClass()) pattern. Hope this helps, Francois. Antonio Neto antoniosouzan...@gmail.com a écrit : Any idea? Please... 2010/5/4 Antonio Neto antoniosouzan...@gmail.com Hi all, I don't know exactly why I have a problem in my exists function. I've tried many different ways, but it does not work. Anybody could help me, please? I have the following rules: *rule diff when $var1: EReference(name == employee) $var2: EClass(name == Company, EAllReferences contains $var1) not (exists( EPackage(EClassifiers contains $var2 ) )) then insertLogical(new IntConstraintOccurrence(diff, 10)); end rule ClassesNotReferenced when $q1 : EClass(); $q2 : EPackage(EClassifiers contains $q1); not( exists ( EReference(EType == $q1) )); then insertLogical(new IntConstraintOccurrence(ClassesNotReferenced, 1, $q1)); end* and in my facts (and my EPackage) I have 4 instances of EClass Company with a EReference employee, and another EClass Person. I still have a move that removes EClasses in my Drools Solver. I need to have only one classe Company after processing. But it removes only the EClass Person, when it was supposed to remove one EClass Person and 3 ECLasses Company. Leaving one EClass Company in the end. The problem is: when Drools tries to remove a EClass Person it thinks that the EClass Company does not exists. But in fact there are 3 others. Any clue about it, please ? Thanks Bests regards Antonio ___ 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 -- To understand what is recursion you must first understand recursion ___ 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 -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Smooks Data Loader uses
Other than the examples shown in the docs, i don't think i can help. I'll have to ask someone familiar with drools AND smooks. _ miguel On Wed, May 5, 2010 at 9:50 AM, JNaylies jerome.nayl...@sogeti.com wrote: no one could help me? maybe something is not clear. Please tell me what ;) Regards Jérôme -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Smooks-Data-Loader-uses-tp773488p778366.html 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 -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Bug in not ???
Actually, in the light of day, I see why it behaved as it did. It doesn't seem to be caused by the AccountHolder as such, but more the Employment object - if there are two of them, one with an accountholder and BusinessName that met the criteria, and one without, then the rule will fire whether the not is used or not, just on different instances of Employment. Thanks for triggering the thought process, Miguel. Tom Murphy Business Process Consultant Wells Fargo HCFG - CORE Deal Decisioning Platform 800 S. Jordan Creek Parkway | West Des Moines, IA 50266 MAC: X2301-01B Office: 515 324 4853 | Mobile: 515 423 4334 This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of miguel machado Sent: Thursday, May 06, 2010 4:19 AM To: Rules Users List Subject: Re: [rules-users] Bug in not ??? This is not entirely true: you may have different objects in memory in such a way that both fires rule. In this case, if you had two (or more!) AccountHolders for the same Employment, each of those having different BusinessName's associated, both rules (with and without the 'not') would fire. Does that make sense? _ miguel 2010/5/5 tom.e.mur...@wellsfargo.commailto:tom.e.mur...@wellsfargo.com The following rule fires both when the not is there, and also if the not is commented out. Clearly, both cannot be true, so there is something wrong somewhere. -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rule fires while condition is false
Could the rules be changing the values outside of a modify block? Please try this (untested) rule as a test. It binds the value on the left hand side. rule netRepaymentWithLiabilities1TEST agenda-group autoUnderwriting when ea: EnrichedApplicationVersionTO(amount : netRepaymentAmountAbilityIncludingLiabilities = 0.65) decision: Decision() then System.out.println(!!! + amount + !!! + ea.getNetRepaymentAmountAbilityIncludingLiabilities() ); decision.setDecision(APPROVED, NetRepaymentWthLiblt); end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rule fires while condition is false
Thanks, I did this and saw that 'amount' was 0, although netRepayment was 1.04, after looking at it a bit further I found the problem. When I create the workspace I insert EnrichedApplicationVersion, I run some rules from a different agenda and then I cleared the agenda (however did not retract the enrichedApplication). I then do some more things and insert the value of NetRepayment value to the EnrichedApplication, I re insert it to the workspace and then I run the rules. It seems that drools did not re evaluate the EnrichedApplication again and thus the value of NetRepayement as fas as it was concerned was 0. retracting EnrichedApplication or creating a new workspace solves this problem. Thanks. Shai בתאריך 06/05/10 17:13, ציטוט Jared Davis: Could the rules be changing the values outside of a modify block? Please try this (untested) rule as a test. It binds the value on the left hand side. rule netRepaymentWithLiabilities1TEST agenda-group autoUnderwriting when ea: EnrichedApplicationVersionTO(amount : netRepaymentAmountAbilityIncludingLiabilities = 0.65) decision: Decision() then System.out.println(!!! + amount + !!! + ea.getNetRepaymentAmountAbilityIncludingLiabilities() ); decision.setDecision(APPROVED, NetRepaymentWthLiblt); 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] rule fires while condition is false
Shai wrote: --snip-- I then do some more things and insert the value of NetRepayment value to the EnrichedApplication, I re insert it to the workspace and then I run the rules. It seems that drools did not re evaluate the EnrichedApplication again and thus the value of NetRepayement as fas as it was concerned was 0. --snip-- For the rules engine to re-evaluate objects, you need to tell it when they change. Even though the NetRepayment fact was updated in the engine, there is no link defined in the rules engine between it and the EnrichedApplication. I'm assuming the calculation method getNetRepaymentAmountAbilityIncludingLiabilities() uses this value. Perhaps it would be worth investigating moving the method implementation to a rule. If not, ensure that all object/variables used in the method do not change once the EnrichedApplication is inserted. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/rule-fires-while-condition-is-false-tp780685p781431.html 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] Bug in not ???
glad i could help. _ miguel 2010/5/6 tom.e.mur...@wellsfargo.com Actually, in the light of day, I see why it behaved as it did. It doesn’t seem to be caused by the AccountHolder as such, but more the Employment object – if there are two of them, one with an accountholder and BusinessName that met the criteria, and one without, then the rule will fire whether the not is used or not, just on different instances of Employment. Thanks for triggering the thought process, Miguel. *Tom Murphy* *Business Process Consultant Wells Fargo HCFG - CORE Deal Decisioning Platform 800 S. Jordan Creek Parkway | West Des Moines, IA 50266 MAC: **X2301-01B** **Office: **515 324 4853** | **Mobile: 515 423 4334** **This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.* *From:* rules-users-boun...@lists.jboss.org [mailto: rules-users-boun...@lists.jboss.org] *On Behalf Of *miguel machado *Sent:* Thursday, May 06, 2010 4:19 AM *To:* Rules Users List *Subject:* Re: [rules-users] Bug in not ??? This is not entirely true: you may have different objects in memory in such a way that both fires rule. In this case, if you had two (or more!) AccountHolders for the same Employment, each of those having different BusinessName's associated, both rules (with and without the 'not') would fire. Does that make sense? _ miguel 2010/5/5 tom.e.mur...@wellsfargo.com The following rule fires both when the “not” is there, and also if the “not” is commented out. Clearly, both cannot be true, so there is something wrong somewhere. -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] rule fires while condition is false
I think you need to use modify for that to happen. Otherwise, it doesn't get re-evaluated. Or maybe it did, but you're using the no-loop / lock-on-active attributes. _ miguel On Thu, May 6, 2010 at 3:51 PM, Shai Bentin s...@centimia.com wrote: It seems that drools did not re evaluate the EnrichedApplication again and thus the value of NetRepayement as fas as it was concerned was 0. -- To understand what is recursion you must first understand recursion ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] drools-server - how to find cause of ERROR 500: Internal Server Error.
Hi Ron, Are you using the trunk version of the Drools Server project? can you share with us the messages that you are sending to the server? Greetings! On Thu, May 6, 2010 at 12:15 PM, ron riley r.ri...@lse.ac.uk wrote: Hi I don't get any log output when I get 500s from drools-server running in tomcat 6, I suspect the error may be caused by something to do with the message that is passed in (examples work ok) - is there any way to enable log output for 500s, or debug output? thanks Ron Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/planningAndCorporatePolicy/legalandComplianceTeam/legal/disclaimer.htm ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Frequently updated facts and truth maintenance
Hello, Recently I've been using Drools (version 5.0.1) to build a small sensor monitoring application and have run into memory consumption issues that seem to be related to logically inserted facts. The way it is set up there are Sensor facts which carry numerically encoded flags that can signal certain properties about that Sensor. My intent was to create rules to detect these flags and insert marker facts in order to abstract how flagging is handled and make it easier for other rules to use this information. Here is an example of the rules I'm using: declare DeltaFlagged sensor : Sensor @key end rule Delta Flagged agenda-group delta flag inference auto-focus true when $sensor:Sensor(eval(isDeltaFlag(flag))) then DeltaFlagged flagged = new DeltaFlagged(); flagged.setSensor($sensor); insertLogical(flagged); end Each Sensor is updated at regular intervals from outside of the rule engine, several hundred times a day. Similar to the examples given here ( http://blog.athico.com/2007/03/writing-rules-for-monitoring-and-time.html). This works very well for short periods of time. However, after many days of operation I can observe a clear memory leak trend. When I inspect a memory dump I see that there are many LogicalDependency objects created and stored by the truth maintenance system (on the order of several million) for each flag fact that has been logically inserted. Only one fact is being inserted per Sensor as expected. I am working under the impression that Drool's truth maintenance should not be recording duplicate dependencies, so I'm wondering what I have done wrong with the equals() and hashcode() methods of my objects to cause Drools to treat each activation of this rule as a new dependency. My Sensor objects use the default hashcode and equals methods. Thank you in advance. Bill ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile)))
I am trying to execute a proof of concept. I have some code that runs a rule. It works in Eclipse, but for some reason doesnt in Netbeans. I want to get it working within a POJO Service Engine in Glassfish ESB and have is execute as part of a BPEL orchestration. It does not throw an exception, but it steps over that one piece of code public void xmlImpl(String is) throws JAXBException, FileNotFoundException, Exception { try { // unmarshal xml file // JAXBElementEnrollmentRequest enrollment = jaxbUnmarshalFromInputStream(is); EnrollmentRequest enrollment = jaxbUnmarshalFromInputStream(is); // setup rules engine RuleRunner rule = new RuleRunner(); String[] rules = {../rules/834rules.drl}; // execute rules on xml file try { RuleBase ruleBase = RuleBaseFactory.newRuleBase(); PackageBuilder builder = new PackageBuilder(); for (String ruleFile : rules) { System.out.println(Loading file: + ruleFile); builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile))); } Package pkg = builder.getPackage(); ruleBase.addPackage(pkg); WorkingMemory workingMemory = ruleBase.newStatefulSession(); Object fact = new Object(); fact.equals(enrollment); System.out.println(Inserting fact: + fact); workingMemory.insert(fact); System.out.println(Firing Rules); workingMemory.fireAllRules(); } catch (Exception e) { e.printStackTrace(); } // marshall changes out to xml file jaxbMarshalToOutputStream(enrollment, new FileOutputStream(F:/data/workspaces/enrollmentPOC/data/xmlenrollment.xml)); } catch (JAXBException je) { je.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { try { } catch (Exception ex) { java.util.logging.Logger.getLogger(global).log(java.util.logging.Level.SEVERE, null, ex); } return; } } If anyone has any suggestions I would appreciate them. At this point I'm stuck Thanks -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p781934.html 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] Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile)))
Are you using Drools 4.x for a particular reason? I suggest you to try with 5.x On Thu, May 6, 2010 at 2:56 PM, mikexr m...@bigfatnuthin.com wrote: I am trying to execute a proof of concept. I have some code that runs a rule. It works in Eclipse, but for some reason doesnt in Netbeans. I want to get it working within a POJO Service Engine in Glassfish ESB and have is execute as part of a BPEL orchestration. It does not throw an exception, but it steps over that one piece of code public void xmlImpl(String is) throws JAXBException, FileNotFoundException, Exception { try { // unmarshal xml file // JAXBElementEnrollmentRequest enrollment = jaxbUnmarshalFromInputStream(is); EnrollmentRequest enrollment = jaxbUnmarshalFromInputStream(is); // setup rules engine RuleRunner rule = new RuleRunner(); String[] rules = {../rules/834rules.drl}; // execute rules on xml file try { RuleBase ruleBase = RuleBaseFactory.newRuleBase(); PackageBuilder builder = new PackageBuilder(); for (String ruleFile : rules) { System.out.println(Loading file: + ruleFile); builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile))); } Package pkg = builder.getPackage(); ruleBase.addPackage(pkg); WorkingMemory workingMemory = ruleBase.newStatefulSession(); Object fact = new Object(); fact.equals(enrollment); System.out.println(Inserting fact: + fact); workingMemory.insert(fact); System.out.println(Firing Rules); workingMemory.fireAllRules(); } catch (Exception e) { e.printStackTrace(); } // marshall changes out to xml file jaxbMarshalToOutputStream(enrollment, new FileOutputStream(F:/data/workspaces/enrollmentPOC/data/xmlenrollment.xml)); } catch (JAXBException je) { je.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { try { } catch (Exception ex) { java.util.logging.Logger.getLogger(global).log(java.util.logging.Level.SEVERE, null, ex); } return; } } If anyone has any suggestions I would appreciate them. At this point I'm stuck Thanks -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p781934.html 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 -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile)))
Noe using drools 5. On May 6, 2010 12:08 PM, salaboy [via Drools - Java Rules Engine] ml-node+781968-2097692314-238...@n3.nabble.comml-node%2b781968-2097692314-238...@n3.nabble.com wrote: Are you using Drools 4.x for a particular reason? I suggest you to try with 5.x On Thu, May 6, 2010 at 2:56 PM, mikexr [hidden email]http://user/SendEmail.jtp?type=nodenode=781968i=0 wrote: I am trying to execute a proof of concept. I have some code that runs a rule. It works in Eclipse, but for some reason doesnt in Netbeans. I want to get it working within a POJO Service Engine in Glassfish ESB and have is execute as part of a BPEL orchestration. It does not throw an exception, but it steps over that one piece of code public void xmlImpl(String is) throws JAXBException, FileNotFoundException, Exception { try { // unmarshal xml file // JAXBElementEnrollmentRequest enrollment = jaxbUnmarshalFromInputStream(is); EnrollmentRequest enrollment = jaxbUnmarshalFromInputStream(is); // setup rules engine RuleRunner rule = new RuleRunner(); String[] rules = {../rules/834rules.drl}; // execute rules on xml file try { RuleBase ruleBase = RuleBaseFactory.newRuleBase(); PackageBuilder builder = new PackageBuilder(); for (String ruleFile : rules) { System.out.println(Loading file: + ruleFile); builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile))); } Package pkg = builder.getPackage(); ruleBase.addPackage(pkg); WorkingMemory workingMemory = ruleBase.newStatefulSession(); Object fact = new Object(); fact.equals(enrollment); System.out.println(Inserting fact: + fact); workingMemory.insert(fact); System.out.println(Firing Rules); workingMemory.fireAllRules(); } catch (Exception e) { e.printStackTrace(); } // marshall changes out to xml file jaxbMarshalToOutputStream(enrollment, new FileOutputStream(F:/data/workspaces/enrollmentPOC/data/xmlenrollment.xml)); } catch (JAXBException je) { je.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { try { } catch (Exception ex) { java.util.logging.Logger.getLogger(global).log(java.util.logging.Level.SEVERE, null, ex); } return; } } If anyone has any suggestions I would appreciate them. At this point I'm stuck Thanks -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p781934.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=781968i=1 https://lists.jboss.org/mailman/listinfo/rules-users -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=781968i=2 https://lists.jboss.org/mailman/listinfo/rules-users -- View message @ http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p781968.html To unsubscribe from Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile))), click herehttp://drools-java-rules-engine.46999.n3.nabble.com/subscriptions/Unsubscribe.jtp?code=bWlrZUBiaWdmYXRudXRoaW4uY29tfDc4MTkzNHwyMDQzOTAwMDY2. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p782001.html 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] Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile)))
On Thu, May 6, 2010 at 8:56 PM, mikexr m...@bigfatnuthin.com wrote: WorkingMemory workingMemory = ruleBase.newStatefulSession(); Object fact = new Object(); fact.equals(enrollment); System.out.println(Inserting fact: + fact); workingMemory.insert(fact); These lines are strange: - Inserting a plain Object? - Why call equals()? System.out.println(Firing Rules); workingMemory.fireAllRules(); ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile)))
You are using the old apis, take a look at the docs about the 5 version to update your code. If you are working with maven, it should work on eclipse and netbeans. I'm a netbeans user and I got all my examples running. 2010/5/6 mikexr m...@bigfatnuthin.com Noe using drools 5. On May 6, 2010 12:08 PM, salaboy [via Drools - Java Rules Engine] [hidden email] http://user/SendEmail.jtp?type=nodenode=782001i=0 wrote: Are you using Drools 4.x for a particular reason? I suggest you to try with 5.x On Thu, May 6, 2010 at 2:56 PM, mikexr [hidden email]http://user/SendEmail.jtp?type=nodenode=781968i=0 wrote: I am trying to execute a proof of concept. I have some code that runs a rule. It works in Eclipse, but for some reason doesnt in Netbeans. I want to get it working within a POJO Service Engine in Glassfish ESB and have is execute as part of a BPEL orchestration. It does not throw an exception, but it steps over that one piece of code public void xmlImpl(String is) throws JAXBException, FileNotFoundException, Exception { try { // unmarshal xml file // JAXBElementEnrollmentRequest enrollment = jaxbUnmarshalFromInputStream(is); EnrollmentRequest enrollment = jaxbUnmarshalFromInputStream(is); // setup rules engine RuleRunner rule = new RuleRunner(); String[] rules = {../rules/834rules.drl}; // execute rules on xml file try { RuleBase ruleBase = RuleBaseFactory.newRuleBase(); PackageBuilder builder = new PackageBuilder(); for (String ruleFile : rules) { System.out.println(Loading file: + ruleFile); builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile))); } Package pkg = builder.getPackage(); ruleBase.addPackage(pkg); WorkingMemory workingMemory = ruleBase.newStatefulSession(); Object fact = new Object(); fact.equals(enrollment); System.out.println(Inserting fact: + fact); workingMemory.insert(fact); System.out.println(Firing Rules); workingMemory.fireAllRules(); } catch (Exception e) { e.printStackTrace(); } // marshall changes out to xml file jaxbMarshalToOutputStream(enrollment, new FileOutputStream(F:/data/workspaces/enrollmentPOC/data/xmlenrollment.xml)); } catch (JAXBException je) { je.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { try { } catch (Exception ex) { java.util.logging.Logger.getLogger(global).log(java.util.logging.Level.SEVERE, null, ex); } return; } } If anyone has any suggestions I would appreciate them. At this point I'm stuck Thanks -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p781934.html Sent from the Drools - User mailing list archive at Nabble.com. ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=781968i=1 https://lists.jboss.org/mailman/listinfo/rules-users -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=781968i=2 https://lists.jboss.org/mailman/listinfo/rules-users -- View message @ http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p781968.html To unsubscribe from Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile))), click here. -- View this message in context: Re: Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile)))http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p782001.html Sent from the Drools - User mailing list archivehttp://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.htmlat Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___
Re: [rules-users] Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile)))
http://n3.nabble.com/file/n782087/drools_api.gif no i am using the 5.0 api ( see image ) -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p782087.html 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] Does not execute = builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile)))
Sorry wrong code for (String ruleFile : rules) { System.out.println(Loading file: + ruleFile); builder.addPackageFromDrl(new InputStreamReader(this.getClass().getResourceAsStream(ruleFile))); } Package pkg = builder.getPackage(); ruleBase.addPackage(pkg); WorkingMemory workingMemory = ruleBase.newStatefulSession(); System.out.println(Inserting fact: + enrollment); workingMemory.insert(enrollment); System.out.println(Firing Rules); workingMemory.fireAllRules(); } catch (Exception e) { e.printStackTrace(); } -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Does-not-execute-builder-addPackageFromDrl-new-InputStreamReader-this-getClass-getResourceAsStream-r-tp781934p782099.html 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] Can't make OR Diverge Gateway (Split OR) work
Hi all, I have this simple BPMN2 flow. http://n3.nabble.com/file/n782279/orflow.jpg When I use a XOR Diverge Gateway exclusiveGateway everything works fine. It also works fine for AND Diverge Gateway parallelGateway. But when I use OR Diverge Gateway complexGateway Drools complains that [Split node 'Gateway' [4] has no type.] http://n3.nabble.com/file/n782279/exeption.jpg As far as I can see it does have a type of complexGateway and this is how it looks in the flow definition: complexGateway id=_4 name=Gateway g:x=96 g:y=96 g:width=49 g:height=49 gatewayDirection=diverging / Am I missing something here? Did anyone implemented an OR complexGateway node in a BPMN2 flow successfully? I appreciate any help. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Can-t-make-OR-Diverge-Gateway-Split-OR-work-tp782279p782279.html 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] Can't make OR Diverge Gateway (Split OR) work
in the editor, go to the properties panel and select the type option. did you do that? On Thu, May 6, 2010 at 5:26 PM, nanic23 nani...@hotmail.com wrote: Hi all, I have this simple BPMN2 flow. http://n3.nabble.com/file/n782279/orflow.jpg When I use a XOR Diverge Gateway exclusiveGateway everything works fine. It also works fine for AND Diverge Gateway parallelGateway. But when I use OR Diverge Gateway complexGateway Drools complains that [Split node 'Gateway' [4] has no type.] http://n3.nabble.com/file/n782279/exeption.jpg As far as I can see it does have a type of complexGateway and this is how it looks in the flow definition: complexGateway id=_4 name=Gateway g:x=96 g:y=96 g:width=49 g:height=49 gatewayDirection=diverging / Am I missing something here? Did anyone implemented an OR complexGateway node in a BPMN2 flow successfully? I appreciate any help. Thanks, Nick. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Can-t-make-OR-Diverge-Gateway-Split-OR-work-tp782279p782279.html 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 -- - http://salaboy.wordpress.com - http://www.jbug.com.ar - Salatino Salaboy Mauricio - ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users