[
http://jira.jboss.com/jira/browse/JBRULES-1171?page=all ]
Edson Tirelli resolved JBRULES-1171.
------------------------------------
Resolution: Cannot Reproduce Bug
I was not able to reproduce the problem in the trunk. Anyway, I added the following
integration test:
==============
package org.drools;
global java.util.List results;
rule "test from nested accessors"
when
$oi : OrderItem( seq == 1 )
$os : Order.OrderStatus() from $oi.order.status
then
results.add( $os );
end
==================
Code to run is:
==================
public void testFromNestedAccessors() throws Exception {
final PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream(
"test_FromNestedAccessors.drl" ) ) );
final RuleBase ruleBase = getRuleBase();
ruleBase.addPackage( builder.getPackage() );
final WorkingMemory workingMemory = ruleBase.newStatefulSession();
final List list = new ArrayList();
workingMemory.setGlobal( "results",
list );
final Order order1 = new Order( 11, "Bob" );
final OrderItem item11 = new OrderItem( order1, 1 );
final OrderItem item12 = new OrderItem( order1, 2 );
order1.addItem( item11 );
order1.addItem( item12 );
workingMemory.insert( order1 );
workingMemory.insert( item11 );
workingMemory.insert( item12 );
workingMemory.fireAllRules();
assertEquals( 1,
list.size() );
assertSame( order1.getStatus(),
list.get( 0 ) );
}
==================
I'm closing this ticket, but if it is still a problem for you, please reopen the
ticket and add a self contained test showing the problem.
Nested accessors in "from" clause are not supported in
depth more then 2
------------------------------------------------------------------------
Key: JBRULES-1171
URL:
http://jira.jboss.com/jira/browse/JBRULES-1171
Project: JBoss Rules
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 4.0.1
Environment: Wintel XP SP2
Reporter: Sergey Manukyan
Assigned To: Edson Tirelli
Fix For: 4.0.2
f.e. this rule FAILS during compilation (3 level nested accessors
"$event.after.businessStatus"):
when
$event : ChangedEvent()
BusinessStatus() from $event.after.businessStatus
this rule works OK:
when
$event : ChangedEvent($after_bs : after)
BusinessStatus() from $after_bs.businessStatus
--
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