[rules-users] Newbie: Drools and this multi-user/domain scenenario realization

Peter Schmidt Peter.Schmidt.Lev at web.de
Mon Aug 29 07:34:37 EDT 2011


Hello all: 


Being new to Drools, I'm currently uncertain if it's "a good idea" to use
Drools for the following "multi-domain" scenario. 
-- I guess Drools is appropriate, but I currently can't imagine (a) which
Drools parts to configure after which strategies (static/cachable vs.
dynamic), and thus also (b) how to organize the rule structures and their
goals (what input/output, what is cachable).


The scenario is as follows:


A /Businesses Service/ *Java Web App* shall manage /N/ distinct shops for
/N/ distinct shop owners, thus having /N/ "domains" with their own fact
model (extended from basic model that is the same for all shops), their own
rules, etc.


The shared but extensible 'Product' model is for rather *static* product and
product set definitions, and it basically consists of:  

  (a) some basic attributes (product name, description, etc.) AND 

  (b) several custom (=dynamic) attributes, independly definable by each
shop owner (attrib name, type, value(s)).


Non-technical shop owners define their products, "product sets", customer
types, and last but not 
least use the "price model" to assign prices to products and product sets,
depending on some fixed 
(e.g. customer_type ::= {NEW_CUSTOMER, REGULAR_CUSTOMER, VIP,...}, taxes,
etc.) and probably some custom price aspects like: 

  - quantity ranges, 

  - charges for a specific dyn. product attribute (e.g. t-shirts of
'size==XXL' => +10% of basic price), 

  - additional promotional price discounts (or charges) for specific
products or sets.


Product defs and taxes are rather /static/ once created, whereas prices and
discounts are /highly dynamic/, i.e. should be externally changeable at need
by the non-technical shop owners (IMHO /decision tables/ are the most
appropriate way here). 


Customers are presented a shop's Online Catalog (or Ordering Form) showing
the prices intended for them, of course, but probably also the other
customer-type specific prices -- for them to see their current savings or
the possible savings after a customer-type "upgrade". 


Finally, customers place orders via the web interface and the system
processes these orders (via further rules).  ...




 
My unclarities are: 




For the rather static "product (set) definitions" (both type def & instance
data), 

   

     Should I better use a traditional way via *configuration files* OR
could I use Drools with 
     some kind of "product definition rules" (generated from /decision
tables/)???
   

     What is a good strategy for realizing the "product def rules" in
Drools? I.e.,

     What is static and what dynamic? What is generated once vs. in
real-time, and what is cached vs. physically stored in the database? 
   



For the highly dynamic "price assignments" (after some pre-defined as well
as custom pricing aspects):
  

    

     How could a pricing table with custom pricing parameters look like? OR
equivalently: 

     How to define a pricing rule that dependens on a custom product
attribute?
    

    The intention is similar to: 
      

        
WHEN ( aProduct.extendedAttributes.size == 'XXL' ) 
        
THEN ( aProduct.price = aProduct.standardPrice * 1.10 )   //+10% of std.
price  
      

     
   
   

   When would the defined pricing rules run and what would they generate? 

   -- I.e., will all rules re-run each time a rule file changes with the
goal of generating cacheable "price lists", or will they even run on any
catalog request (thus generating the price lists on-the-fly)??? 
   
  


In such a not so uncommon JavaEE Web App shopping scenario: 

Generally, which kind of rules are feasible besides the "product (set)
definition" and "price controling" rules?

I guess rules such as the following could be practicable: 

  

    
 fact model type definition rules (that construct and load new model types). 
    
 GUI generation rules for Swing/SWT and Web GUIs (after some
type-to-component mappings configured via rules or decision tables).  
    
 authentication & authorization rules.  
  



Knowing the required artefacts and their generation strategies (cached vs.
life) from the answers of the above questions: 

How do I have to configure Drools (& Guvnor) for *N parallel running* online
shops?  I.e., 

    
 Do I instantiate 1 rule engine per shop, or do I share 1 for all shops? 
    
 Do I load the generic fact model (that supports custom enhancements) once
per shop, or share it among them? 
    
 Which parts can be cached in "Application Scope"? (supposable N
KnowledgeBases with pre-generated stuff, 1 for each shop) 
    
 In which kind of JEE Session Beans do I have to integrate which kind of
Drools Knowlege Session beans? 





The clarification of these issues would currently help me a lot. 

Thank you very much for any help and development hints in advance. 


Best regards 

   Peter


--
View this message in context: http://drools.46999.n3.nabble.com/Newbie-Drools-and-this-multi-user-domain-scenenario-realization-tp3292454p3292454.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110829/88b7b5d4/attachment.html 


More information about the rules-users mailing list