sorting rows/ules fired in a decision table
by puja nandamuri
Hi,
I have a question to ask about sorting rules(rows) fired in a decision table
I have a decision table that has a action column which is kind of a ranking order.
based on some conditions, corresponding rows get fired and as a result, we end up with rows being selected not necessarily in any order,but based on the ranking order column of the fired rules, the rows need to be sorted in a subsequent rule .
so, lets say, we end up with rows/rules that get fired as follows:
row7 - ranking order- 3
row 5- ranking order - 6
row 3- ranking order - 4
I would like to sort the rows subsequently as row7,row3, row5
Please note that it is the ranking order that is criteria for sorting, not the row Number .
How do I accomplish this ? Please pardon if the question is not clear or confusing.
I will try to present it better .
Thanks,
Ram
13 years, 3 months
using a fact from within a List<FactType> in a Guided Decision Table in Guvnor
by puja nandamuri
Hi ,
Can I use a field from a fact from within a List<FactType>
in a Guided decision Table as a
condition column ?
We have a List<Asset> being inserted into rulesession.
We would like to use a field from within a Asset in the List<Asset> as a condition column
in a guided decision table in Guvnor.
Can we do that? Or do we need to insert each of the Asset
into rulesession ?
One reason we would like to insert List<Asset> is to be able to do some
calculations such as counting number of assets in memory.
perhaps , this can be done even at an Asset level, but I have not tried the count rule
Thanks,
Ram
13 years, 3 months
Newbie: Drools and this multi-user/domain scenenario realization
by Peter Schmidt
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-domai...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 3 months