Hi Kashish,
I found your email reply but not in this google-group thread. Have you mistakenly deleted it?
~~~
We are using Excel spreadsheets.
Q. Drools requires fact objects as inputs. So am I right to assume that you have a fact class like this?
A. Yes, you can assume that.
Also, the expression can be a bit complex including braces, etc. e.g a && (b || c)
~~~
I wrote an example:
Sample1.xls demonstrates (a && b || c) case. Rule constraints are evaluated as boolean so you don't need to call MVEL.eval(). You just need to write
~~~
MyFact1(a && b || c)
~~~
In case of spreadsheet, as you see in Sample1.xls, simply put
~~~
a && b || c
~~~
in a cell to be replaced for "$param" placeholder. Btw, I think writing a DRL is simpler than a spreadsheet in this case.
Sample2.xls demonstrates (a==1 && b==3 || c == 'val') case. I assume that you will want to put values for 1, 3, val in spreadsheet cells. In this case, I use placeholders $1, $2, $3 so that they will be replaced with the cell values. You can add more rows as you like.
Also you will see SpreadsheetCompiler use in DecisionTableTest.java. It will help you to view the gererated DRLs from your spreadsheet.
Cheers,
Toshiya
2021年8月18日水曜日 11:07:49 UTC+9 Toshiya Kobayashi: