Actually, the ksession.insert and setGlobal need to be reversed in the example I provided, but my questions remain the same - why reinsert the object and are you inserting elsewhere it to begin with?


On Thu, Jan 24, 2013 at 12:22 PM, Jeremy Ary <jeremy.ary@gmail.com> wrote:
rule "actes par competence"
no-loop
	when
		$a : Acte();
		eval($a.getCompetence().equals("MEDECIN"))
		
	then
		insert($a);
end

This rule seems incorrect to me. In readable form, this rule says "When there exists some Acte whose competennce equals "MEDECIN", then insert that Acte". If an Acte has already been inserted for this rule to find, why would you want to re-insert the same Acte? I think you might misunderstand the basics of setting up a rules session. Somewhere close to where you are using setGlobal(), are you using a "ksession.insert(new Acte())" or something similar?

If you were to do this instead, then your rule would fire...although again, I'm not sure why you want to reinsert something that's already been inserted:

Acte acte = new Acte();
acte.setCompetence("MEDICIN");
FactHandle acteHandle = ksession.insert(acte);
ksession.setGlobal("test", "my string test");
ksession.fireAllRules();


On Thu, Jan 24, 2013 at 12:03 PM, Mister Nono <noel.maurice@univ-jfc.fr> wrote:
See the solution at this post :
http://drools.46999.n3.nabble.com/Compare-two-String-objects-tp4021730p4021791.html
<http://drools.46999.n3.nabble.com/Compare-two-String-objects-tp4021730p4021791.html>



--
View this message in context: http://drools.46999.n3.nabble.com/Convert-Integer-to-int-in-rule-file-tp4021739p4021795.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users