Andre,
The misunderstanding here is that the LHS, except for code blocks like
eval, return value expressions and accumulate code blocks, are all
Drools Language. When you use the dialect attribute in a rule or package
you are telling the compiler what dialect (MVEL or Java) you will use
2009/8/20 André Thieme address.good.until.2009.dec...@justmail.de
Would there not be an addition to the syntax needed, for the default
rule language? For mvel it would not require a change I guess.
No, as I mentioned to you, the idea is for the DRL to remain the same, so
that the rules author
Edson Tirelli schrieb:
Andre,
The misunderstanding here is that the LHS, except for code blocks
like eval, return value expressions and accumulate code blocks,
are all Drools Language. When you use the dialect attribute in a
rule or package you are telling the compiler what
Edson Tirelli schrieb:
2009/8/20 André Thieme address.good.until.2009.dec...@justmail.de
mailto:address.good.until.2009.dec...@justmail.de
Would there not be an addition to the syntax needed, for the default
rule language? For mvel it would not require a change I guess.
No,
Edson Tirelli schrieb:
ooops... correct version:
when
Map( this[type] == Point, $x : this[x] )
Map( this[type] == Circle, this[x] == $x )
then
end
Okay, so in the mvel syntax this is possible.
Can this also be achieved in the default rule syntax, without mvel?
The mvel syntax
Edson Tirelli schrieb:
So, in principle having Maps support in the LHS is not a big challenge?
No. Just requires developing a set of classes to work with maps. Being
brief:
* Implement: MapObjectType extends ObjectType
* Implement: MapReadAccessor and MapWriteAccessor
* Add support
André Thieme wrote:
Edson Tirelli schrieb:
ooops... correct version:
when
Map( this[type] == Point, $x : this[x] )
Map( this[type] == Circle, this[x] == $x )
then
end
We default to MVEL, because it's simple and already contains everything
we need for expression
Mark Proctor schrieb:
André Thieme wrote:
Edson Tirelli schrieb:
ooops... correct version:
when
Map( this[type] == Point, $x : this[x] )
Map( this[type] == Circle, this[x] == $x )
then
end
We default to MVEL, because it's simple and already contains everything
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
Edson Tirelli schrieb:
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.
When we speak about equivalence in
Edson Tirelli schrieb:
when
Customer( $custId : id )
DailyOrders( count[$custId] == 1 )
then
Btw, this brings me to a new syntax question for the default Drools rule
syntax. Is this possible:
when
m:Map()
eval( m.get(type) == Point, $x :
I will skip the first half of your e-mail as I am not sure what were the
reasons for your nit-picking. If my explanation was not helpful for the
public it was intended to, you are welcome to explain yourself.
Regarding the part that matters, i.e., adding the support to other fact
types,
Edson Tirelli schrieb:
I will skip the first half of your e-mail as I am not sure what were
the reasons for your nit-picking. If my explanation was not helpful for
the public it was intended to, you are welcome to explain yourself.
Oh, I did not intend it to sound like nit-picking. I
ooops... correct version:
when
Map( this[type] == Point, $x : this[x] )
Map( this[type] == Circle, this[x] == $x )
then
end
2009/8/19 Edson Tirelli tire...@post.com
when
Map( this[type] == Point, $x : this[x] )
Map( this[type] == Circle, x == $x )
then
end
2009/8/19
Yes, that was a bug that was fixed in newer versions of MVEL. Just update
your MVEL jar to 2.0.12.
[]s
Edson
2009/8/18 André Thieme address.good.until.2009.dec...@justmail.de
KDR schrieb:
Hi, I'm relatively new to both Java and Drools. I'm trying to figure out
how
to use maps in
Apologies, I should have given the error message I get with $m: Map(
this[$str] == 1 ) and also with $m: Map( this.$str == 1 ) -
org.drools.RuntimeDroolsException: Exception executing predicate this[$str]
== 1
and lots more lines followed by -
Caused by: [Error: unable to resolve method:
Many thanks for your replies André and Edson. For some reason they hadn't
shown up on my computer before I posted my follow up info.
I'll download the updated jar and cross my fingers!
On the general issue, is it received wisdom that it's better not to insert
map objects direct, at least for
17 matches
Mail list logo