[rules-users] Insert and Retract from drools server in one call?

dunnlow dunnlow at yahoo.com
Tue Jan 17 07:01:54 EST 2012


Sorry for my terminology; I'm a noob, but I think I understand your
suggestion.  By "initial" facts, I just mean the facts that I insert within
my batchexecution command.  In reality, I am adding a pojo to that
batchexecutioncommand and then my rules check the pojo's attributes.  I
don't want that pojo to remain in memory; however, there are new facts that
are created (RHS) by the rules that are fired and I want those to remain in
working memory.

If I understand your response, you are suggesting one approach is to add a
rule with a really low salience that will trigger whenever it sees the bean
and retract it after the other rules have fired.  Something like:

rule retractInitialFact
  salience -100
when
  $mp:MyPojoBean
then
  retract($mp)

Is that correct?  I have been trying to avoid using salience (I feel like I
read that somewhere).  However, is that the most common way to do what I am
trying to do?  There is no way in the batch execution command to add a
"retract" as the last command?

Thanks again.
-J


--
View this message in context: http://drools.46999.n3.nabble.com/Insert-and-Retract-from-drools-server-in-one-call-tp3657736p3665856.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list