[rules-users] Re: Constants on LHS?

J Michael Dean mdean77 at comcast.net
Mon Dec 10 20:33:18 EST 2007


Thanks.  My problem with this is that these constants would have to be  
defined in my Java application and then inserted into the session, I  
think.  What I would aim for is to have ALL the business logic in the  
DRL file, but setting constants such as lowTargetLimit = 80 in the  
application and then pushing that into the session object does not  
make sense to me.

As I write the DRL file with more confidence, I suppose I will end up  
creating a DSL.  I was just hoping there might be a simple way to  
establish constants.

Thanks again.

- Mike

>
> Date: Sun, 9 Dec 2007 15:18:22 -0500
> From: Andy Mei <andy.d.mei at gmail.com>
> Subject: Re: [rules-users] Constants on LHS?
> To: Rules Users List <rules-users at lists.jboss.org>
> Cc: "rules-users at lists.jboss.org" <rules-users at lists.jboss.org>
> Message-ID: <F8286E17-CE76-42D7-B49D-089901282452 at gmail.com>
> Content-Type: text/plain;	charset=US-ASCII;	format=flowed;	delsp=yes
>
> Try global VAR
>
> Sent from my iPhone.
> PLs excuse typing mistake.
>
> On Dec 9, 2007, at 12:48 PM, J Michael Dean <mdean77 at comcast.net>  
> wrote:
>
>> I have not been able to figure out how to define "constants" that
>> can be used replace numbers, etc. on the LHS of rules, and am not
>> quite at the stage where I can set up a DSL.  Is there a way to
>> accomplish this?
>>
>> For example, I have a simple rule to determine if glucose is below
>> the targeted range;  the lower limit of the target is 80.  Quickest
>> solution:
>>
>> when
>>   decision : GlucoseDecision(serumGlucoseConcentration < 80)
>> then
>>   DO something
>>
>> But I want to be able to write:
>>
>> when
>>   decision : GlucoseDecision(serumClucoseConcentration <
>> lowTargetLimit)
>> then
>>   Do something
>>
>> so that I can set all these constants in one place, etc.
>>
>> Is there a way to accomplish this inside the DRL?
>>
>> - Mike
>>



More information about the rules-users mailing list