Hello.
I'm working on a project about a product catalog, which involves the use of
Drools for fetching from the database layer a set of products that support a
list of characteristics in a best-effort fashon
In detail the database is constructed with the use of dynamic characteristics,
i.e. all attributes, like dimensions or weight, are not included as fields in
the table cointaining the definition of the product but they are stored in a
different table; then the linkage product-characteristic is stored in a third
table cointaning the product id, the characteristic id and the value associated
and other necessary fields.
Now i would use drools for getting a limited number (let's say fixed - i.e.
everytime max 10) products which has a variable number of characteristic
(supplied by the user) in a best-effort style. For example if i search a router
with 5 ports i could retrieve also routers with 6 or 4 ports if no router with
10 ports are in the database or there are less then 10, and so on until i get
10 (or until there are no more routers - obviusly i cant get 10 if in the db
there are just 7). Now this is a really simple scenario, but you can imagine
one user specifing several desired characteristics.
I tought about recursive use of business rules, i mean i look first for routers
with X ports, then X+1 or X-1 ports, then X-2 or X+2 ports etc. but this would
lead to a monster number of business rules, since the characteristics are many.
Moreover, this works fine with characteristics that takes on numeric values,
but what about those which takes on Strings? I.E. encription support can be
AES, DES, 3DES etc. In this case I should specify one rule for each desired
request and for each step, i.e. if the user wants AES support then look for AES
first, then 3DES, then DES etc. OR if he wants 3DES then 3DES first, then AES
etc. (just a dumb example but i hope you get the point).
I see this is quite a lot of rules handling.. maybe someone has a suggestion
for another approach which would simplify the process? Or maybe someone had to
solve something similar and would share some knowledge with me?
Thanks for the attention :)
Cheers
Alessandro Terrinoni
_________________________________________________________________
Scopri le keyword più cercate della settimana!
http://clk.atdmt.com/GBL/go/136430524/direct/01/
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users