[rules-users] mixing activation-group and ruleflow-group

raffi christian.koehler at s2008.tu-chemnitz.de
Thu Oct 4 04:51:16 EDT 2012


Hi.

As suspected the way of showing the output was not optimal. I now get the
objects with a query, as you said:
query "recomms"
   recomm    : Recommendation()
end

And it shows that my currently solution is working in the way it should. My
inserting rules now look like this:
rule "pets"
	salience 20
	activation-group "categories"
    when
        $tr 	: Translog($trpid : pid)
        $p		: Product(pid == $trpid, $pid : pid, $price : price, $brand :
brand)
        $pcat	: ProductCategory(pid == $pid, $cid : cid)
        $cat	: Category(cid == $cid, cname == "pets", $cname : cname)
    then
        insert(new Recommendation($pid, $price, $brand, $cname));
end

rule "food"
	salience 20
    activation-group "categories"
    when
        $tr 	: Translog($trpid : pid)
        $p		: Product(pid == $trpid, $pid : pid, $price : price, $brand :
brand)
        $pcat	: ProductCategory(pid == $pid, $cid : cid)
        $cat	: Category(cid == $cid, cname == "food", $cname : cname)
        not Recommendation(cname == "pets")
    then
       	insert(new Recommendation($pid, $price, $brand, $cname));
end
...

After all transaction data was read in I call the remove rules in a
descending order:
rule "remove everything except pets"
	salience 19
	when
		exists Recommendation(cname == "pets")
		$recomm	: Recommendation(cname == "food" || cname == "vegetable" || cname
== "drinks")
	then
		retract($recomm);
end

rule "remove everything except food"
	salience 18
	when
		exists Recommendation(cname == "food")
		$recomm	: Recommendation(cname == "vegetable" || cname == "drinks")
	then
		retract($recomm);
end
...

I think there is space for optimization. 
Is there a huge speed advantage in your solution laune in comparison to mine
(because I have far more rules) in case of lets say 10.000 master data facts
in working memory?

Thank you



--
View this message in context: http://drools.46999.n3.nabble.com/mixing-activation-group-and-ruleflow-group-tp4020058p4020128.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list