[
http://jira.jboss.com/jira/browse/JBRULES-315?page=all ]
Edson Tirelli closed JBRULES-315.
---------------------------------
Resolution: Done
Support to expressions added. Example:
rule "eval rewrite"
when
$o : OrderItem( order.number == 10 )
then
results.add( $o );
end
rule "eval rewrite2"
when
$o1 : OrderItem( order.number == 11, $seq : seq == 1 )
$o2 : OrderItem( order.number == $o1.order.number, seq != $seq )
then
results.add( $o2 );
end
rule "eval rewrite3"
when
$o1 : OrderItem( order.number == 12, seq == 1 )
$o : Order( items[1] == $o1 )
then
results.add( $o );
end
rule "eval rewrite4"
when
OrderItem( $nbr : order.number == 13, seq == 1 )
$o : Order( number == $nbr )
then
results.add( $o );
end
rule "map access"
when
$m : Map( this['name'] == "Edson", this.surname ==
"Tirelli", this['age'] == 28 )
then
results.add( $m );
end
Support to Expression and Nested Accessors
------------------------------------------
Key: JBRULES-315
URL:
http://jira.jboss.com/jira/browse/JBRULES-315
Project: JBoss Rules
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Reporter: Michael Neale
Assigned To: Edson Tirelli
Priority: Minor
Fix For: 4.0.0.MR3
Would be nice to have a feature like:
Map(this.foo == bar) as being accessed as: map.get("foo")
This can work as in the ClassFieldInspector it can tell that there is no
"getFoo" method, but there is a get(xxx) method - hence it can pass in the key
as the field name (as a string).
A limitation may be that we want to use a prev bound variable as a key, but I can't
see how that will work short of adding new syntax (this currently stays within the current
grammar which is good - and looking up fields via a String key is more then useful !).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira