Since I\'m working with Scala immutable objects within Drools, in order to update a fact I would need to create a new object to replace it. I\'ve written a Scala method for the
Importing methods from Scala Object types can be problematic in Drools. The simple reason is that static
methods do not exist in Scala in contrast with Java. This is because Scala takes a more stricter interpretation of what it means to be a pure object orientated language.
What this means is that whenever you try to use the Drools import function
syntax, it cannot find any static methods to import. As a result, the Drools compiler complains about any references to methods contained in Scala singleton object types.
A work around for this is to write any classes which are going to be used in your DRLs in Java where you can explicitly define static methods. The Scala compiler will happily compile these along with your Scala classes.