[rules-users] Rule Templates and null values

Bernd Rücker bernd.ruecker at camunda.com
Fri Feb 26 08:55:43 EST 2010


It works out of the box. So in this example:

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

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



-----Ursprüngliche Nachricht-----
Von: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at 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.ruecker at 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-bounces at lists.jboss.org
> [mailto:rules-users-bounces at lists.jboss.org] Im Auftrag von Bernd Rücker
> Gesendet: Freitag, 26. Februar 2010 12:30
> An: rules-users at 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 at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



More information about the rules-users mailing list