Thanks again Edson. I'd just used a String object to try a simple test but of
course your example makes a lot more sense. And thanks also for clarifying
that there's full syntax support in the latest mvel jar version.
I know this is a Drools rather Java list but as I'm new to both, may I ask
further how to install that new jar version you mentioned into my current
Eclipse Drools project, or indeed how to get new Drools projects in Eclipse
to use it please, instead of the old version? I've tried copying the jar
into the Drools runtime folder but it doesn't work?
Cheers
Edson Tirelli-3 wrote:
"On the general issue, is it received wisdom that it's better not to
insert
map objects direct, at least for now until map support is fully there - or
is it 6 of one / half a dozen?"
Maps are data structures, not Domain entities. Using maps as domain
entities is possible, but usually makes your rules unreadable. That is why
it is bad to use any data structures or simple numbers, strings, dates as
isolated facts... they don't have a well known business semantic in a
given
business model (not to mention how they get mixed with each other and
cause
cross products, etc). A rule like the following has no explicit meaning:
when
$str: String()
$m: Map( this[$str] == 1 )
then
But when you write something like:
when
Customer( $custId : id )
DailyOrders( count[$custId] == 1 )
then
Things are clear just by looking at them, even if $custId is a String
and count is a Map as in the original example.
Regarding the bug, it was a regression that was fixed. All the syntax
support we intended to have for them is in Drools. Not sure what you mean
by
"support is fully there".
Hope it helps.
[]s
Edson
--
View this message in context:
http://www.nabble.com/Maps-in-Drools-tp25031348p25045607.html
Sent from the drools - user mailing list archive at
Nabble.com.