[rules-users] Rule Templates and null values

2010-02-26 Thread Bernd Rücker
Hi all.



I question myself if I can get the Rule Templates to works like it is in
Excel: If one “parameter” is not set (null), the whole line of the
template is skipped?



Since we want to build a template for a lot of rules, fed from a database.
There some conditions can be null, so they should not be included in the
rule at all. Has anybody an idea to this? I haven’t found anything,
neither in the docs, nor in the testcases…



Thanks a lot

Bernd



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rule Templates and null values

2010-02-26 Thread Bernd Rücker
Okay, digging more into the source code I found the method
“replaceOptionals” which does exactly what I need. So despite the missing
docs, a line IS skipped if the according parameter used in that line is
null. Perfect :-)



Sorry for the interruption…



Von: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Bernd Rücker
Gesendet: Freitag, 26. Februar 2010 12:30
An: rules-users@lists.jboss.org
Betreff: [rules-users] Rule Templates and null values



Hi all.



I question myself if I can get the Rule Templates to works like it is in
Excel: If one “parameter” is not set (null), the whole line of the
template is skipped?



Since we want to build a template for a lot of rules, fed from a database.
There some conditions can be null, so they should not be included in the
rule at all. Has anybody an idea to this? I haven’t found anything,
neither in the docs, nor in the testcases…



Thanks a lot

Bernd



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rule Templates and null values

2010-02-26 Thread Pavel Tavoda
Enlighten us. Where is this method and how to use it? I'm also interested.

Palo

2010/2/26 Bernd Rücker bernd.ruec...@camunda.com:
 Okay, digging more into the source code I found the method
 “replaceOptionals” which does exactly what I need. So despite the missing
 docs, a line IS skipped if the according parameter used in that line is
 null. Perfect :-)



 Sorry for the interruption…



 Von: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Bernd Rücker
 Gesendet: Freitag, 26. Februar 2010 12:30
 An: rules-users@lists.jboss.org
 Betreff: [rules-users] Rule Templates and null values



 Hi all.



 I question myself if I can get the Rule Templates to works like it is in
 Excel: If one “parameter” is not set (null), the whole line of the template
 is skipped?



 Since we want to build a template for a lot of rules, fed from a database.
 There some conditions can be null, so they should not be included in the
 rule at all. Has anybody an idea to this? I haven’t found anything, neither
 in the docs, nor in the testcases…



 Thanks a lot

 Bernd



 ___
 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 Templates and null values

2010-02-26 Thread Bernd Rücker
It works out of the box. So in this example:

12 rule Cheese fa...@{row.rownumber}
13 when
14Person(age == @{age})
15Cheese(type == @{type})
16 then
17list.add(@{log});
18 end

If you provide age=null, line 14 is not included in the rule
automatically.



-Ursprüngliche Nachricht-
Von: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Pavel Tavoda
Gesendet: Freitag, 26. Februar 2010 14:46
An: Rules Users List
Betreff: Re: [rules-users] Rule Templates and null values

Enlighten us. Where is this method and how to use it? I'm also interested.

Palo

2010/2/26 Bernd Rücker bernd.ruec...@camunda.com:
 Okay, digging more into the source code I found the method
 “replaceOptionals” which does exactly what I need. So despite the
missing
 docs, a line IS skipped if the according parameter used in that line is
 null. Perfect :-)



 Sorry for the interruption…



 Von: rules-users-boun...@lists.jboss.org
 [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Bernd Rücker
 Gesendet: Freitag, 26. Februar 2010 12:30
 An: rules-users@lists.jboss.org
 Betreff: [rules-users] Rule Templates and null values



 Hi all.



 I question myself if I can get the Rule Templates to works like it is in
 Excel: If one “parameter” is not set (null), the whole line of the
template
 is skipped?



 Since we want to build a template for a lot of rules, fed from a
database.
 There some conditions can be null, so they should not be included in the
 rule at all. Has anybody an idea to this? I haven’t found anything,
neither
 in the docs, nor in the testcases…



 Thanks a lot

 Bernd



 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users