Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Bruno Freudensprung
Hi Wolfgang, Thank you for your advice! Indeed, this logic is part of my application domain. Best regards, Bruno. Wolfgang Laun a écrit : > The initially posted rules "1" and "2" are best practice. You are using a > Production Rule Engine, and these rules are what they are made for. > > Doing

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Wolfgang Laun
The initially posted rules "1" and "2" are best practice. You are using a Production Rule Engine, and these rules are what they are made for. Doing it in an event handler is not impossible, but it requires you to implement logic which is (apparently) part of the application domain ("There must not

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Gabor Szokoli
I think I've got your use case: you are making XSLT on steroi^W some kind of cheese that tastes stimulating and is dense in nutrients but is in no way controversial. It would allow user rules for removing stuff, and have built-in rules for transitively removing unreferenced stuff, right? On Mon, D

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Bruno Freudensprung
Hi, Yes, I see what you mean! That's why, before starting, I wanted to make sure that I was not completly mistaken ;-). Please find my answers below. Bruno. Gabor Szokoli a écrit : > That looks like a drools retelling of the chicken and egg problem to > me: how do you intend to insert new Inst

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Gabor Szokoli
Hi, I'm new too, so please mind the cracks on the road inexpertly paved with good intentions: 2010/12/6 Bruno Freudensprung : > The first "solution" I imagined was to have high-salience rules: > > rule "1" > when >    t : T >    not I(type == t) > then >    retract t > > rule "2" > w

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Bruno Freudensprung
Hi Michael, Thanks for you answer! Following you suggestion I've taken a look at at "logical insertions" and on one hand I have to say that it looks like what I need, but on the other hand it is not clear to me how to "implement it". If you have some time to take a look, here are the object

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Michael Anstis
Would the other retractions be automatically provided for by Drools' Truth Maintenance? Otherwise, passing a StatefulKnowledgeSession to a WorkingMemoryEventHandler subclass and invoking it's methods should, IMO, not be an issue. Have you tried it and experienced issues? On 6 December 2010 09:32

[rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Bruno Freudensprung
Hi everyone, Do you know if it is possible to insert/modify/retract facts in a working memory event handler? Here is my use case actually: I want my users to be able to write rules like "When ... Then retract X" without having to bother with the consequences of retracting X on the other objec