[rules-users] SPREADSHEET DECISION TABLE: Can I use functions into CONDITIONS?

Travis_Smith at bnz.co.nz Travis_Smith at bnz.co.nz
Wed May 4 18:14:59 EDT 2011


Hi Zeta,

Just to confirm: You'll find that writing an Excel VBA macro will not 
work, as they are neither MVEL nor Java.

How I've handled it is created a Helper class with public static methods. 
Then in the Import section at the top of the file, I link to the functions 
I use, prefixed with the "function" keyword, eg:


RuleSet
myRuleSet
Import
nz.co.bnz.projectname.common.factmodel.*,
function nz.co.bnz.projectname.helpers.HelperClass.methodName
Functions
dialect "mvel"
...


Of course the main advantage of using helper classes like this is you can 
reuse them - no need to rewrite your methods everywhere you want to use 
them.

Of course this isn't particularly helpful if you're not coding in Java.

Note: Under mvel you seem to need to specify each function name 
separately, when using Java you can use HelperClass.*
 - This applies to any rules file-type (.drl / .dslr / .xls / .csv / etc)

Hope some of this helps,
-Trav

Travis Smith
Analyst Programmer
Development Centre
BNZ

DDI: +644 4746356 (Or Ext 76356)





zeta <zoraidahidalgo at gmail.com>
Sent by: rules-users-bounces at lists.jboss.org
05/05/2011 03:38 a.m.
Please respond to
Rules Users List <rules-users at lists.jboss.org>


To
rules-users at lists.jboss.org
cc

Subject
[rules-users] SPREADSHEET DECISION TABLE: Can I use functions into 
CONDITIONS?




HI!, I need to check if a given date is between two dates. So, I would 
like
to call a function that calculates if the given date is between other
two(specifically, between current date and current date plus some months,
and the variable "months" changes dynamically). I tried to write a
function(inside spreadsheet) that receives the date and the variable 
months
but does not compile. I have found not samples about functions used into
condition part so I am wondering if that is the problem. If it is the 
case,
what can i do?

Thanks.

--
View this message in context: 
http://drools.46999.n3.nabble.com/SPREADSHEET-DECISION-TABLE-Can-I-use-functions-into-CONDITIONS-tp2899330p2899330.html

Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


CAUTION - This message may contain privileged and confidential information 
intended only for the use of the addressee named above. If you are not the 
intended recipient of this message you are hereby notified that any use, 
dissemination, distribution or reproduction of this message is prohibited. 
This email was sent by the Bank of New Zealand. You can contact us on 
0800 ASK BNZ (0800 275 269). Any views expressed in this message are those 
of the individual sender and may not necessarily reflect the views of Bank 
of New Zealand.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110505/66d9fe1e/attachment.html 


More information about the rules-users mailing list