Drools has functionality for declaring new data types in the rule file itself, instead of doing it in the java file.
But how can we define methods for that data type?
For example, if I declare the following type in the rule file:
declare Address
number : int
streetName : String
city : String
end
How can I add a method to it:
public int doubleNumber()
{
number = number * 2;
}