All,
I saw this question was asked a couple of months ago with no reply, but thought
I would try again.
In using a Rule Template, I'm trying to determine a way to dynamically generate
rules based on a value in the data.
There is a data set, that has various pieces data, depending on a column
A *rule template *is a text (file) intended to be expanded repeatedly using
different sets of template parameters, similar to a macro processor. Each
expansion will generate - more or less - the same rule, unless you put the
flexibility into the parameter, which just passes the buck to the code
Hi All,
I'm trying to determine if it's possible to process arrays of data using Rule
Templates. An example of what I'm trying to accomplish.
Spreadsheet of rules, with one of the columns being valid colors. Valid colors
contains comma separated data and is variable length.
For example
It
In the spreadsheet (with class Country) you would have a column such as:
CONDITION
Country
name in ( $param )
Test whether name is one from a given set
Austria, Germany, Switzerland
France, Canada, Belgium
This is the generated rule:
rule InTest_18
when
$country:
Thanks for the reply Wolfgang.
I chose to use the template because I liked the idea of separating the rule
definition from the rule data. Just seemed intuitive to me. Overall, I'm new
to Drools, so not sure if that is the best choice or not.
I think your approach works if my spreadsheet has
If you are expanding the template with data taken from anywhere
you have the option of processing that data before you pass it
to the expander. Section 2.5.2., Expanding a Template, explains
how to do this. This is the option you have for implementing
specific processing.
The problem with data in
Thanks Wolfgang.
I think I see what you're saying. If I need to do any complex prep, simply
process it first, then build a collection of POJO objects for expansion by the
drools template.
I also understand what you're saying about spreadsheets. Most of this is just
proof of concept I'm
Hi,
It is not quite clear to me what you are actually having problems with. I
think the documentation explains it quite nicely.
See section 6.2 Templates
http://docs.jboss.org/drools/release/5.4.0.CR1/drools-expert-docs/html_single/index.html#d0e7468
If you have a more specific question. Feel
The information that would help me is (using Eclipse or JBDS) can one edit,
It depends if you mean edit the templates or edit the data that you use to
populate it.
You can create a rule template in any text editor you like and, AFAIK, it
can have any extension you prefer. Convert it to an
Thanks W - I can work with this
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: 21 June 2011 18:40
To: Rules Users List
Subject: Re: [rules-users] Rule Templates - comma separated data
The operators in and not in operate
I have successfully generated a .drl file from a decision table. The column
headers in this table made use of the forall(||) construct which happily parsed
the corresponding comma separated data in the relevant spreadsheet cell to nice
|| separated conditions.
We have since decided to use the
The operators in and not in operate on parenthesized lists of operands.
They can be used with a single template parameter expanding as a list.
Person( likes in ( apple, banana, chili ) )
is the same as
Person( likes == apple || == banana || == chili )
-W
On 21 June 2011 18:34, Witham,
Hi all,
In the Expert Guide and on some places on the internet, I read about Rule
Templates.
I think this is a very interesting feature. However, the expert manual
states to use it with caution as it is still an experimental feature.
Also, there isn't that much information on the web either.
This feature is used internally (spreadsheet), and therefore one has to
assume that it's here to stay. The warning is mainly there because the API
is in the unstable part.
-W
On 14 April 2011 14:48, FrankVhh frank.vanhoensho...@agserv.eu wrote:
Hi all,
In the Expert Guide and on some places
Hi W.,
Thanks for the fast reply.
Meanwhile, I have been trying to play with the templates. Unfortunately, I
run into a nullpointerexception in the problems view of Eclipse. At first, I
hoped it was the same error as in
http://lists.jboss.org/pipermail/rules-users/2010-November/017229.html but
Not that I can see any problem. Disregard the Eclipse error, expand the
template as documented, and then we'll see what we'll see...
-W
On 14 April 2011 15:36, FrankVhh frank.vanhoensho...@agserv.eu wrote:
Hi W.,
Thanks for the fast reply.
Meanwhile, I have been trying to play with the
Hi,
After trying the example from the documentation, eclipse returned the same
error. So, I got the same idea and just worked further ignoring eclipse.
I saw what I saw and that was that it works fine now, even with the error
still displayed in the problems view.
Thanks for the help ;-)
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
[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
: [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
-
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
Hi!
If I write rules in a decision table I can leave cells empty if I don't need
to use all of the conditions in a row.
How can I do this with the ExternalSpreadsheetCompiler?
I would need something like:
rule ru...@{row.rownumber}
when
$s : MyType1()
@ifDefined{field1} $e :
An extensive rewrite of the section dealing with Templates was done in
the early stages of 5.0, and it ought to be available with current
snapshot releases. The relevant section is 5.2, Templates.
-W
On 11/24/09, Adam Rinehart adam.rineh...@gmail.com wrote:
I am trying to research using a
Looking at the 5.1 snapshots, these sections have not been updated since the
5.0 release. I'm looking at a 5.1 snapshot I downloaded on 11/2/09.
The relevent sections, specifically 5.1.7 and 5.2, seem to have errors
and/or omissions and those sections should have the information I'm looking
for.
I am trying to research using a rule template driven by data from a
spreadsheet, rather than using a straight decision table.
I understand I need to use the ExternalSpreadsheetCompiler but am finding a
distressing lack of information about the template format.
The 5.0 docs seem to have mistakes;
Hi All,
I was wondering if there is any support for Rule Templates directly in Guvnor.
I haven't been able to find anything in the official documentation or by
playing around Guvnor.
Does someone have any ideas as to how one would store templates in Guvnor?
Cheers,
Vikrant Yagnick
Software
Hi,
You can't use templates at the moment.
But you can use the copy function in the rule editor. Create a rule that
is used as a base, disable it and copy this rule when creating new ones.
Toni Rikkola
Vikrant Yagnick wrote:
Hi All,
I was wondering if there is any support for Rule
in a future release?
Cheers,
Vikrant
-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Toni Rikkola
Sent: Wednesday, February 18, 2009 5:02 PM
To: Rules Users List
Subject: Re: [rules-users] Rule Templates and Guvnor
Hi,
You
...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Toni Rikkola
Sent: Wednesday, February 18, 2009 5:02 PM
To: Rules Users List
Subject: Re: [rules-users] Rule Templates and Guvnor
Hi,
You can't use templates at the moment.
But you can use the copy function in the rule
29 matches
Mail list logo