Reputation: 27492
Is there a way to add member functions to a Drools declared type? That is, I'd like to say something like:
declare Foo
bar : int
plugh : String
function String greeting()
{
return "Hello "+plugh+"!";
}
end
That doesn't work (or I wouldn't be writing this post), but do I just have the syntax wrong, or is there no way to do that in Drools?
Upvotes: 1
Views: 1326
Reputation: 80633
You cannot include functions in a Drools declared type (above and beyond what it generates in the class to support Bean property types). If you find you need functions in a declared type you should probably create them in your regular Java then import them into your rule file.
Upvotes: 2