[rules-users] Rule Templates - Conditionally Generate Rule based on Values in Data

2013-06-18 Thread Jason Allen
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

Re: [rules-users] Rule Templates - Conditionally Generate Rule based on Values in Data

2013-06-18 Thread Wolfgang Laun
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

[rules-users] Rule Templates and Array Handling

2013-06-14 Thread Jason Allen
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

Re: [rules-users] Rule Templates and Array Handling

2013-06-14 Thread Wolfgang Laun
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:

Re: [rules-users] Rule Templates and Array Handling

2013-06-14 Thread Jason Allen
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

Re: [rules-users] Rule Templates and Array Handling

2013-06-14 Thread Wolfgang Laun
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

Re: [rules-users] Rule Templates and Array Handling

2013-06-14 Thread Jason Allen
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

Re: [rules-users] Rule Templates

2012-07-27 Thread FrankVhh
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

Re: [rules-users] Rule Templates

2012-07-27 Thread FrankVhh
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

Re: [rules-users] Rule Templates - comma separated data

2011-06-22 Thread Witham, Darren
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

[rules-users] Rule Templates - comma separated data

2011-06-21 Thread Witham, Darren
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

Re: [rules-users] Rule Templates - comma separated data

2011-06-21 Thread Wolfgang Laun
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,

[rules-users] Rule Templates

2011-04-14 Thread FrankVhh
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.

Re: [rules-users] Rule Templates

2011-04-14 Thread Wolfgang Laun
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

Re: [rules-users] Rule Templates

2011-04-14 Thread FrankVhh
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

Re: [rules-users] Rule Templates

2011-04-14 Thread Wolfgang Laun
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

Re: [rules-users] Rule Templates

2011-04-14 Thread FrankVhh
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 ;-)

[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

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

2010-02-26 Thread Bernd Rücker
[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

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

2010-02-26 Thread Pavel Tavoda
: [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

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

2010-02-26 Thread Bernd Rücker
- 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

[rules-users] Rule Templates with empty cells

2010-01-25 Thread jschmied
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 :

Re: [rules-users] Rule Templates - Docs Examples?

2009-11-24 Thread Wolfgang Laun
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

Re: [rules-users] Rule Templates - Docs Examples?

2009-11-24 Thread Adam Rinehart
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.

[rules-users] Rule Templates - Docs Examples?

2009-11-23 Thread Adam Rinehart
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;

[rules-users] Rule Templates and Guvnor

2009-02-18 Thread Vikrant Yagnick
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

Re: [rules-users] Rule Templates and Guvnor

2009-02-18 Thread Toni Rikkola
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

RE: [rules-users] Rule Templates and Guvnor

2009-02-18 Thread Vikrant Yagnick
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

Re: [rules-users] Rule Templates and Guvnor

2009-02-18 Thread Mark Proctor
...@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