[rules-users] Drools ruturn multiple results based on child objects data length
Mohamed Riyaz
riyazenayath at gmail.com
Mon Sep 8 02:35:09 EDT 2008
Hi,
In one-to-many relationship object type, Drools generate multiple results
based on child objects data length. ie. No of child records
belongs to parent object. I wanted the RHS part should be executed only if
conditions imposed
on child object satisfies.
I have two facts with 1-* relationship defined in object mapping.
class Invoice{}
class Order{
private Set<Invoice> invoices;
}
*I wanted RHS should be executed with only one result irrespective of child
records length.*
rule "Multiple results set"
when
order: Order()
invoice : Invoice() from order.invoices
then
System.out.println("Rule Example (Multiple results set)"+order.getId());
end;
Result:
Rule Example (Multiple results set)1000
Rule Example (Multiple results set)1000
Please help me in resolving this issue.
Regards,
Riyaz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080908/05a8ee11/attachment.html
More information about the rules-users
mailing list