Re: [rules-users] column in OR
in decision tables this isn't possible. Are you also aware that CE 'or' results in sub rule generation, so in fact each logical outcome is internally generated as a separate rule? I recommend you just repeat the rule twice. However it may be you want connective || and on field constraints, just should map fairly easily. Mark Raffaele Viola wrote: Hi all, how can I put two columns in OR Thanks Raffo ___ 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] column in OR
Hi all, how can I put two columns in OR Thanks Raffo ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] column in OR
What do you mean? rule XXX when A() or B() then // do something end ? Edson 2007/9/12, Raffaele Viola [EMAIL PROTECTED]: Hi all, how can I put two columns in OR Thanks Raffo ___ 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] column in OR
yes, but in a decision table regards Raffo 2007/9/12, Edson Tirelli [EMAIL PROTECTED]: What do you mean? rule XXX when A() or B() then // do something end ? Edson 2007/9/12, Raffaele Viola [EMAIL PROTECTED]: Hi all, how can I put two columns in OR Thanks Raffo ___ 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] column contraint + java bean
i got the predicate working. from the docs it seems that predicate is used in the indexing but the eval is not. Is that correct? please confirm that the column constraints cannot access nested objects. many thanks - Lucio Piccoli Director Asterisk-i Pty Ltd Software Design-Develop-Deploy www.asteriski.com with predicate or evals, or preferably try and write your information relationally not nested. Mark [EMAIL PROTECTED] wrote: hi all, having trouble with Drools 3.x syntax. currently using one fact in working memory that is a aggregate of many java beans. However when using the column constraint syntax it does not seem to allow nested getXXX on the column constraint. I have it working using predicate but it just seems verbose. i would like to be able to fire rule when the table object has a player count 0 and the Table.getDealer.getFlop() == null how is this done on Drools 3.x? ie. public class Table{ int playerCount; Dealer dealer; Collection players; } rule start no-loop true when table : Table( playerCount 0 , dealerFlop : dealer-(dealerFlop.getFlop() == null ) ) then System.out.println( start: + table.getDealer().getFlop() ); end many thanks -lp ___ 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] column contraint + java bean
with predicate or evals, or preferably try and write your information relationally not nested. Mark [EMAIL PROTECTED] wrote: hi all, having trouble with Drools 3.x syntax. currently using one fact in working memory that is a aggregate of many java beans. However when using the column constraint syntax it does not seem to allow nested getXXX on the column constraint. I have it working using predicate but it just seems verbose. i would like to be able to fire rule when the table object has a player count 0 and the Table.getDealer.getFlop() == null how is this done on Drools 3.x? ie. public class Table{ int playerCount; Dealer dealer; Collection players; } rule start no-loop true when table : Table( playerCount 0 , dealerFlop : dealer-(dealerFlop.getFlop() == null ) ) then System.out.println( start: + table.getDealer().getFlop() ); end many thanks -lp ___ 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] column binding vs field binding - any performance implications?
Vlad, No noticeable difference in binding fields or columns, but there are really negative perf impacts in using eval(). I'm writing a blog about it. Please try to avoid. I know bellow is just a sample, but it would be so much better if written: Record( field == xxx ) []s Edson Olenin, Vladimir (MOH) wrote: Hi, I wonder if there are any performance implications of choosing column binding vs field binding (I’ll be using bound variable in eval). Eg, in such case: Record($field : field) eval ( $field.equals(“xxx”) ) vs $r: Record() eval ( $r.field.equals(“xxx”) ) Does it start to make difference only when some significant number of variable get bound? Thanks, Vlad ___ 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 3124-6000 Mobile: +55 11 9218-4151 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] [Column(f1=='v1', f2=='v2')] vs [Column(f1=='v1') Column(f2== 'v2')]
Hi, I wonder what is the difference (performance-wise, etc) between these two constructs: Column(f1=='v1', f2=='v2') And Column(f1=='v1') Column(f2=='v2') ? Both of them should select the same 'Column' facts (where Column.f1=='v1' Column.f2='v2'), correct? Is one construct more preferable then another one? Does JBossRules hash only the evaluation result of the 'full column' OR individual field constraints as well? From what I understand, only the full 'Column' is defined as an (alpha?) node while individual constraints within the node can not be further optimized, correct? Meaning, if I have another condition somewhere like this: Column(f1=='v1', f2=='ANOTHER_VAL') [f1=='v1'] constraint would have to be reevaluated again, while if I define constraints through two 'separate' columns and the new constraint as Column(f1=='v1) Column(f2=='ANOTHER_VAL') only the new constraint would have to be reevaluated. Do I understand it right? Thanks! Vlad ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
RE: [rules-users] [Column(f1=='v1', f2=='v2')] vs [Column(f1= ='v1') Column(f2== 'v2')]
Hi, Edson. Thanks for the explanation. Just wanted to clarify one thing. If I have a set of following Column fact objects and I put then into workspace using the 'identity' mode (below are only field values the facts are initialized with, one per line, each line is a separate Column fact): 1) f1='v1', f2='v1' 2) f1='v1', f2='v11' 3) f1='v1', f2='v2' 4) f1='v2', f2='v2' 5) f1='v11', f2='v2' 6) f1='v11', f2='v22 then the condition Column(f1=='v1') Column(f2=='v2') will select facts exactly 5 facts: 1, 2, 3, 4, 5, but NOT 6, correct? Won't the condition above then be the same as: Column(f1=='v1') or Column(f2=='v2') ? Thanks. Vlad PS: any feedback/hints on some other questions I've sent earlier today would be very much appreciated as well! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli Sent: 07 February 2007 13:15 To: Rules Users List Subject: Re: [rules-users] [Column(f1=='v1', f2=='v2')] vs [Column(f1=='v1') Column(f2== 'v2')] Vlad, The constructions are semantically different. In 3.0.x as default, JBoss Rules will not allow the same fact to match more than one column. So if you write: Column(f1=='v1') Column(f2=='v2') Your rule will only match if there are 2 different objects that each match one of the constraints. While, if you write: Column(f1=='v1', f2=='v2') It will require a single object that matches both constraints. Also, the optimizations (indexing, hashing, etc) are done on a field constraint basis. So, if you have one rule with : Column(f1=='v1', f2=='ONE_VAL') And another rule with: Column(f1=='v1', f2=='ANOTHER_VAL') The constraint f1=='v1' will be evaluated only once. Although, to help optimization, you must keep the constraints that repeat over multiple patterns as the first constraints for each collumn, in the same order. []s Edson Olenin, Vladimir (MOH) wrote: Hi, I wonder what is the difference (performance-wise, etc) between these two constructs: Column(f1=='v1', f2=='v2') And Column(f1=='v1') Column(f2=='v2') ? Both of them should select the same 'Column' facts (where Column.f1=='v1' Column.f2='v2'), correct? Is one construct more preferable then another one? Does JBossRules hash only the evaluation result of the 'full column' OR individual field constraints as well? From what I understand, only the full 'Column' is defined as an (alpha?) node while individual constraints within the node can not be further optimized, correct? Meaning, if I have another condition somewhere like this: Column(f1=='v1', f2=='ANOTHER_VAL') [f1=='v1'] constraint would have to be reevaluated again, while if I define constraints through two 'separate' columns and the new constraint as Column(f1=='v1) Column(f2=='ANOTHER_VAL') only the new constraint would have to be reevaluated. Do I understand it right? Thanks! Vlad ___ 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 3124-6000 Mobile: +55 11 9218-4151 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] [Column(f1=='v1', f2=='v2')] vs [Column(f1= ='v1') Column(f2== 'v2')]
Nope. If you have a rule: rule A when Column(f1=='v1') Column(f2=='v2') then // do something end The rule will activate for tuples: [1, 3] [1, 4] [1, 5] [2, 3] [2, 4] [2, 5] [3, 4] [3, 5] Remember that the implicit conditional element is AND. If you write a rule rule A when Column(f1=='v1') or Column(f2=='v2') then // do something end Then it will activate for tuples: [1] [2] [3] [4] [5] []s Edson Olenin, Vladimir (MOH) wrote: Hi, Edson. Thanks for the explanation. Just wanted to clarify one thing. If I have a set of following Column fact objects and I put then into workspace using the 'identity' mode (below are only field values the facts are initialized with, one per line, each line is a separate Column fact): 1) f1='v1', f2='v1' 2) f1='v1', f2='v11' 3) f1='v1', f2='v2' 4) f1='v2', f2='v2' 5) f1='v11', f2='v2' 6) f1='v11', f2='v22 then the condition Column(f1=='v1') Column(f2=='v2') will select facts exactly 5 facts: 1, 2, 3, 4, 5, but NOT 6, correct? Won't the condition above then be the same as: Column(f1=='v1') or Column(f2=='v2') ? Thanks. Vlad PS: any feedback/hints on some other questions I've sent earlier today would be very much appreciated as well! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli Sent: 07 February 2007 13:15 To: Rules Users List Subject: Re: [rules-users] [Column(f1=='v1', f2=='v2')] vs [Column(f1=='v1') Column(f2== 'v2')] Vlad, The constructions are semantically different. In 3.0.x as default, JBoss Rules will not allow the same fact to match more than one column. So if you write: Column(f1=='v1') Column(f2=='v2') Your rule will only match if there are 2 different objects that each match one of the constraints. While, if you write: Column(f1=='v1', f2=='v2') It will require a single object that matches both constraints. Also, the optimizations (indexing, hashing, etc) are done on a field constraint basis. So, if you have one rule with : Column(f1=='v1', f2=='ONE_VAL') And another rule with: Column(f1=='v1', f2=='ANOTHER_VAL') The constraint f1=='v1' will be evaluated only once. Although, to help optimization, you must keep the constraints that repeat over multiple patterns as the first constraints for each collumn, in the same order. []s Edson Olenin, Vladimir (MOH) wrote: Hi, I wonder what is the difference (performance-wise, etc) between these two constructs: Column(f1=='v1', f2=='v2') And Column(f1=='v1') Column(f2=='v2') ? Both of them should select the same 'Column' facts (where Column.f1=='v1' Column.f2='v2'), correct? Is one construct more preferable then another one? Does JBossRules hash only the evaluation result of the 'full column' OR individual field constraints as well? From what I understand, only the full 'Column' is defined as an (alpha?) node while individual constraints within the node can not be further optimized, correct? Meaning, if I have another condition somewhere like this: Column(f1=='v1', f2=='ANOTHER_VAL') [f1=='v1'] constraint would have to be reevaluated again, while if I define constraints through two 'separate' columns and the new constraint as Column(f1=='v1) Column(f2=='ANOTHER_VAL') only the new constraint would have to be reevaluated. Do I understand it right? Thanks! Vlad ___ 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 3124-6000 Mobile: +55 11 9218-4151 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