final List list = new ArrayList();
ksession.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 );
ksession.insert( order1 );
ksession.insert( item11 );
ksession.insert( item12 );
ksession.fireAllRules();
assertEquals( 0,
list.size() );
final Order order2 = new Order( 12,
"Mark" );
Order.OrderStatus status = new Order.OrderStatus();
status.setActive( true );
order2.setStatus( status );
final OrderItem item21 = new OrderItem( order2,
1 );
final OrderItem item22 = new OrderItem( order2,
2 );
order1.addItem( item21 );