[rules-users] Decision table accessing my own methods

djb dbrownell83 at hotmail.com
Mon Jan 11 04:26:23 EST 2010


Thanks,

Neither suggestion worked, unfortunately.

I have imported the object model. (eg. com.schoolstuff.*)

Excuse the syntax I used, but my method is not static, and it wouldn't make
sense to make it so.  (Or, I'd have to pass in ClassRoom and Student).

I tried with this.hasStudent("$param") and hasStudent("$param") with no
luck.  Since my method returns a boolean, will it know to evaluate the
column as a true or false condition?

Any other ideas?

-Daniel

PS (I'm not sure if my first reply was successfully posted, sorry if this is
a repeat.)



Jane James wrote:
> 
> You need to import the function. 
> 
> for example,
> import YourOtherClass
> import function Classroom.hasStudent
> 
> 
> 
> 
> ----- Original Message ----
> From: djb <dbrownell83 at hotmail.com>
> To: rules-users at lists.jboss.org
> Sent: Fri, January 8, 2010 8:30:20 AM
> Subject: [rules-users]  Decision table accessing my own methods
> 
> 
> Hi there,
> 
> I have been trying for hours now to get a decision table that can call my
> own methods.
> 
> Lets say I've got a Classroom, and a list of 4 students.
> And my rule is to not have Bill and Bob in the same classroom.
> 
> I have a method Classroom.hasStudent(String name), which will say whether
> the room has Bill or Bob.
> 
> But how do I call it???
> 
> Imagine this is my decision table:
> 
> classroom: Classroom
> classroom.hasStudent("$param")
> Bob
> Bill
> 
> How in the world do I get it to not say "no viable alternative at input
> "bob" for blah blah blah"?
> I've also tried classroom.hasStudent("$param") == true with no success.
> 
> 
> Please help,
> Thank you...
> Daniel
> 
> 
> -- 
> View this message in context:
> http://n3.nabble.com/Decision-table-accessing-my-own-methods-tp114250p114250.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 
> 
>       
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 
> 

-- 
View this message in context: http://n3.nabble.com/Decision-table-accessing-my-own-methods-tp114250p116596.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list