[rules-users] Guvnor guided rule and nested objects

Héron Nicolas nheron at sopragroup.com
Fri Mar 27 05:29:52 EDT 2009


Hello, 
for the first rule, the Jira is
https://jira.jboss.org/jira/browse/JBRULES-1929
and you have to wait that my patch is applied and you will be able to do
all you want
look at
https://jira.jboss.org/jira/secure/attachment/12325575/FinalModification.jpg

for the second part of you question, did you try with class Double
instead of standard type double.
For example, if a variable is boolean, than no listbox appears. 
But if you use Boolean, then it works, a listbox appears and you can
select everything
regards
Nicolas Heron

Le jeudi 26 mars 2009 à 12:53 -0700, hpost a écrit :

> Hi.   I am trying to implement the following rule using a guided rule in
> Guvnor.  It works successfully in the Eclipse environment.  
> 
> rule "SevereHypoglycemia"
> 	no-loop true
> 	when
> 		$event : GlucoseEvent(input.glucoseValue <=
> glucoseConst.severeHypoglycemiaThreshold);
> 	then
> 	 	GlucoseResult result = $event.getResult();
> 		result.setNewInsulin(0);
> 		double nextTime = glucoseCalc.calculateDuration(1.0,
> $event.getInput().getGlucoseValue(), $event.getInput().getGlucoseTime(),
> null, null);
> 		result.setHoursToNextMeasurement(nextTime);
> 		result.setDextroseGr(0.5);
> 		result.setNotifyPhysician(true);
> 		$event.setResult(result);
> 		update($event);
> 	 
> 		System.out.println("SevereHypoglycemia rule ran.");
> 		
> end
> 
> 
> I have imported the jar file and can see all of the objects.  The problem I
> am having is with the nested object model.  I can reference the
> GlucoseEvent.input.glucoseValue field successfully, but the only comparison
> operators I get are 'equals too' and 'not equals to'.   They type of
> glucoseValue is double and I need to do relational comparison as in the rule
> above.    If I do a 'View Source' on the rule in BRMS, this is what I see if
> I use the 'equals' operator:
> 
> 
> rule "Rule1"
> 	dialect "mvel"
> 	when
> 		GlucoseEvent( input.glucoseValue == "40" )
> 	then
> end
> 
> 
> Is this bug or does the guided rule editor only support flat object models?
> 
> Thanks,
> 
> Herman Post
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090327/db98cc0c/attachment.html 


More information about the rules-users mailing list