[rules-users] Accessing properties of an object within a Nested Collection of a Nested Collection
Michael Anstis
michael.anstis at gmail.com
Wed May 2 14:42:45 EDT 2012
You wouldn't be able to query just the AutoManufacturer record though.
You'd need to perform a join across tables, e.g.:-
when
$p: Part( partVendor == "PV999999" )
$m: Model( partsList contains $p )
$b: Brand( brandModels contains $m )
$a : AutoManufacturer( brandsCollection contains $b )
then
System.out.println( $p + ", " + $m + ", " + $b + ", " + $a );
end
On 2 May 2012 19:04, James K <james_kosa at verizon.net> wrote:
> Luane - Yes, it would be a normalized database, there would be only one
> entry
> for a manufacturer with all of the child records related by Foreign Keys or
> relational tables.
>
> Excuse my ignorance I am relatively new to Drools, can you please expand on
> the following:
>
> "...(...$p.getPartsName()...) "
>
> This is where I am having a hard time on how to navigate into the nested
> collections. Or are you saying to insert the PART, MODEL, BRAND, etc as
> individual facts? How would I relate it back Automanufacturer fact?
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Accessing-properties-of-an-object-within-a-Nested-Collection-of-a-Nested-Collection-tp3955591p3956880.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120502/9ef19ead/attachment.html
More information about the rules-users
mailing list