[rules-users] Re: Problems with Global Date Object
Brian Enderle wrote: I would like to create a new Date object representing the current date and use that as a global. I have tried the following: (in Java code) setGlobal(todaysDate, new Date()); (in rules file) global java.utils.Date todaysDate; Is this exactly in your rules file? Then it should be java.util.Date todaysDate; instead. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] add process only - bug ?
hi, I try to add a ruleflow to my rule base : builder.addRuleFlow(RULE_FLOW); Package pkg = builder.getPackage(); ruleBase.addPackage(builder.getPackage()); But !!: java.lang.NullPointerException at org.drools.compiler.PackageBuilder.addRuleFlowsToPackage(PackageBuilder.java:469) at org.drools.compiler.PackageBuilder.getPackage(PackageBuilder.java:449) at mcmipih.rules.demo.service.TestDraft.main(TestDraft.java:31) -- View this message in context: http://www.nabble.com/add-process-only--%3E-bug---tf4334017.html#a12343434 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] exists...
Thanks Edson, Just created JIRA : JBRULES-1136 http://jira.jboss.com/jira/browse/JBRULES-1136 Thomas, I did use StatefulSession... -Sergey From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli Sent: Sunday, August 26, 2007 7:35 AM To: Rules Users List Subject: Re: [rules-users] exists... Manukyan If it is not firing, it is a bug. Although we fixed several related bugs for 4.0.1 that shall be out soon. If you can provide a test case and open a Jira, I can do some further debugging. Essentially, the difference between the rules is that expression in the first rule is being converted into an MVEL expression, because of the nested accessors, while the second is a pure drools expression. []s Edson 2007/8/25, Manukyan, Sergey [EMAIL PROTECTED]: Folks, Using 4.0 GA. Need to have a rule that executes when there exists a Supplier with business status == active. I am inserting Supplier in working memory. I did that : rule #1 when exists( Supplier( businessStatus.status.isActive == true ) ) then System.out.println(FOUND); End But it doesn't work Although other rules like if there is supplier with name = SOME NAME - they work : rule #2 when exists( Supplier( name == SOME NAME ) ) then System.out.println(FOUND); End Any ideas how to make rule #1 work ? Thanks, Sergey ** ** LEGAL DISCLAIMER ** ** This E-mail message and any attachments may contain legally privileged, confidential or proprietary information. If you are not the intended recipient(s), or the employee or agent responsible for delivery of this message to the intended recipient(s), you are hereby notified that any dissemination, distribution or copying of this E-mail message is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete this E-mail message from your computer. ___ 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] collect return random order
Folks, When using collect on List of items with some filter (criteria), I need to have result in the same order as it was received: F.e. I have a list of suppliers : List() : Supplier(FIRST, Status.ACTIVE), Supplier(SECOND, Status.INACTIVE), Supplier(THIRD, Status.INACTIVE) And I need to find first INACTIVE supplier, so it must be SECOND supplier. So doing the following : When $l : List() // list of suppliers $inactive_supp : ArrayList() from collect Supplier(status == Status.INACTIVE) from $l Then System.out.println($l); // prints FIRST, SECOND, THIRD System.out.println($inactive_supp); // prints THIRD, SECOND Instead of SECOND , THIRD So I am getting THIRD supplier instead of SECOND as the result.. Please advise if it is a bug .., or there is another way of doing that... Thanks, -Sergey ** ** LEGAL DISCLAIMER ** ** This E-mail message and any attachments may contain legally privileged, confidential or proprietary information. If you are not the intended recipient(s), or the employee or agent responsible for delivery of this message to the intended recipient(s), you are hereby notified that any dissemination, distribution or copying of this E-mail message is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete this E-mail message from your computer.___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Functionality/Performance Test Results
Hi, Robert, I am very interested in the database access part, because I am also considering to add the database access code into my rule. But my current concern is the performance. It would be very appreciated if can let me know how many times of database access is in your whole test suite, which cost 6 seconds? Is it always validating the same user or randomly picking different users to validate -- if using the same query, database may get result cached which will result a better performance? Did you add any arbitrary object caching in your java code for performance optimization? Thanks in advance, Yang On 8/24/07, Robert Crawford [EMAIL PROTECTED] wrote: Our users are asking to be able to specify custom validations in our application. I've been undecided whether to use a rules engine or write our own dynamic validation code. While it's admittedly still in the toy problem stage, I tried using drools in place of some existing hand-coded validation. The drools version took the SAME amount of time. Then I added another rule, to simulate the types of validations our users want to add, and re-ran. Again, SAME time. Admittedly, database access was the big time consumer -- average of 6 seconds per unit of work, and about 15 units of work per test -- but it was the same for both the rules-based and hand-coded validations. Excellent work, everyone! You've made my life much, much simpler! ___ 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] Storing temp results in eval block
I still have not found a solution to this problem. Nobody has a suggestion? cfili wrote: Hi, I have just started using Drools 4.0 and I am very pleased so far. I do have one question regarding storage of a result from within an eval block. For example if I have the following eval in my rule: eval((value1 /value2) 0.5) Is there a way to store the result of value1/value2 in a temp variable so that it can be accessed in the then part of my rule? I want to avoid recomputing the result again in the then section. Thanks. -- View this message in context: http://www.nabble.com/Storing-temp-results-in-eval-block-tf4225783.html#a12351896 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] Storing temp results in eval block
Not really and that is why it is better to avoid eval() blocks. Can you show what rule are you trying to create? Maybe there is another way of writing it? []s Edson 2007/8/27, cfili [EMAIL PROTECTED]: I still have not found a solution to this problem. Nobody has a suggestion? cfili wrote: Hi, I have just started using Drools 4.0 and I am very pleased so far. I do have one question regarding storage of a result from within an eval block. For example if I have the following eval in my rule: eval((value1 /value2) 0.5) Is there a way to store the result of value1/value2 in a temp variable so that it can be accessed in the then part of my rule? I want to avoid recomputing the result again in the then section. Thanks. -- View this message in context: http://www.nabble.com/Storing-temp-results-in-eval-block-tf4225783.html#a12351896 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 -- 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] collect return random order
Yang, I am was suggesting to have regulation to impose particular order(although it might be a good additional feature as well). Would like to just to keep the order as it was in collect list. Especially if we are returning List that means it is an ordered collection by definition. It looks like somewhere in the internals of collect there is a HashSet, sitead of ArrayList used that changes the order of the items in the incoming list, and that is what I don't agree with... I think it must be a bug, -Sergey From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yang Song Sent: Monday, August 27, 2007 11:28 AM To: Rules Users List Subject: Re: [rules-users] collect return random order I saw someone is requesting LIMIT, here I saw Manukyan is asking for ORDER BY, and also Mark is talking the FROM. Looks like the rule LHS part would become more and more like SQL SELECT statement. :) I think it is the right way. Some Stream Database also extends the SQL to do event aggregation and correlation. The same can be applied to Rule Engine too. Yang On 8/27/07, Manukyan, Sergey [EMAIL PROTECTED] wrote: Folks, When using collect on List of items with some filter (criteria), I need to have result in the same order as it was received: F.e. I have a list of suppliers : List() : Supplier(FIRST, Status.ACTIVE), Supplier(SECOND, Status.INACTIVE), Supplier(THIRD, Status.INACTIVE ) And I need to find first INACTIVE supplier, so it must be SECOND supplier. So doing the following : When $l : List() // list of suppliers $inactive_supp : ArrayList() from collect Supplier(status == Status.INACTIVE) from $l Then System.out.println($l); // prints FIRST, SECOND, THIRD System.out.println($inactive_supp); // prints THIRD, SECOND Instead of SECOND , THIRD So I am getting THIRD supplier instead of SECOND as the result.. Please advise if it is a bug .., or there is another way of doing that... Thanks, -Sergey ** ** LEGAL DISCLAIMER ** ** This E-mail message and any attachments may contain legally privileged, confidential or proprietary information. If you are not the intended recipient(s), or the employee or agent responsible for delivery of this message to the intended recipient(s), you are hereby notified that any dissemination, distribution or copying of this E-mail message is strictly prohibited. If you have received this message in error, please immediately notify the sender and delete this E-mail message from your computer. ___ 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] I can use RuleAgent without .properties file ???
Hi list, I need your help, I need deploy the rules like Web Service, for this, I develop a web service method using the RuleAgent, but the Web Service can't read the .properties file. The question is: Exist any form for initialize RuleAgent without .properties file??? PD1: The problem could be the tomcat, but I am desperate PD2: Sorry for my poor English Thanks :D -- Edgardo IbaƱez O. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Problem in the set variable in the rules
hi list, Y have the next problem in the rules: rule Valida Duracion nula when $v : Validaciones(flag == 0) then $v.setFlag(1); System.out.println( obtenemos flag + $v.getFlag() ); end rule valida Duracion Destino when $v: Validaciones(flag == 0) then $v.setResultado(l); System.out.println( obtenemos+ $v.getResultado()); System.out.println( obtenemos cantidad seg dos + $v.getFlag() ); end the problem is: the flag variable values begin in 0 (in the class in java), in the first rules the change a 1 (setFlag) and Should not execute rule seconds her, But it is executed, why? thanks. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users