(Mandatory Newbie Disclaimer)
I'm trying to write a rule that fires whenever an object within a (scala) list matches a condition. The issue here is that the list is actually an Option(List[TypeA])... (Also, I realise it isn't best practice to store lists in working memory, but I can't do otherwise given the circumstances)
The case classes I'm using have the following sort of structure:
TypeA {
arg1 : Option[List[TypeB]]
}
with
TypeB {
value : String
}
I've written a rule similar to this:
when
$a : TypeA($l : arg1)
$b : TypeB() from $l.get()
then
System.out.println($b)
I've tried this out without the ".get()" only to get an object of type Some().
Using the ".get()", I have managed to return the contents of the Option but it doesn't seem to match the expected type (List[TypeB]). Instead the type of the value returned seems to be scala.collection.immutable.$colon$colon
Any ideas on what the problem is? And if there is any proper way to handle Options in Drools?