[rules-users] processing a database with many to many Relationships

Wolfgang Laun wolfgang.laun at gmail.com
Tue Apr 8 15:55:14 EDT 2014


It depends on the rules you're going to have.

Usually the relational (normalized) form lends itself well to writing
rules. OTOH, Drools provides "from" for unravelling List attributes,
and you can use "collect" to create a Collection from separate facts.
But, before refactoring the data you have, see how writing rules
against the "status quo" works out.

-W



On 8 April 2014 20:55, Dave Potts <dave.potts at pinan.co.uk> wrote:
>
> Most of the drools examples that I seen, will for have an example that
> process address, look for address with a given post/zip code etc on a data
> source that is already loaded in the knowledge session, but it include no
> description of how the data was loaded in the knowledge session.
>
> I have a reference database of trading containers , the database describes
> the source, destination, contents etc, relationships between for example a
> container may have have many sources and many destinations.  Destinations
> and sources may be shared between different containers.
>
> The database is normalised to keep source/destination information as a
> single place table, with link tables to define the relationship between the
> different containers and places
>
> Q. What is the best way of loading my information in to a knowledge session?
>
> Expand all the many to many relationship in to a  single pojo objects with
> multiple references to other pojos or is there a better way?
>
>                                                  source
> destination
> eg Container foo                      England,
> England
>                                                  England
> France
>                                                  England
> Scotland
>                                                  France
> England
>                       bar                      England
> Germany
>                                                  England
> France
>
> regards
>
>
> Dave.
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


More information about the rules-users mailing list