<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Hi,</div><div><br></div><font class="Apple-style-span" color="#000099">1) my facts are in fact java Maps, is there an easy way to deal with them in<br>

guvnor? it&#39;s not like in the example where facts are objects and we give<br>guvnor the Pojo model to know what we can do with it<br><br>for example i have :<br>$m  : Map((this[&quot;attribute1_of_the_map&quot;] == &quot;test1&quot;))<br>

<br>How to deal with the map and have a prepopulated list of properties of the<br>map? And to store it in the variable $m. Without using the &quot;free from drl&quot;<br>where we have to write it by hand.</font><br><br><div>

I think you could use DSL for achieve this. You could define your own DSL saying for example <b>There is a Test=Map((this[&quot;attribute1_of_the_map&quot;] == &quot;test1&quot; </b>I would leave the variable binding to the editor. So when you add this particular pattern to a rule, you can bind it it you want to. </div>

<div><br><font class="Apple-style-span" color="#000099">2) how to deal with global constant with guvnor?<br><br>i have something like :<br>WorkingMemory wm = drools.getWorkingMemory();<br>wm.setGlobal(&quot;resultValue&quot;, &quot;OK&quot;);<br>

<br>Is it a direct way to play with global constant in Guvnor? Without using the<br>&quot;free from drl&quot; where we have to write it by hand.</font><br><br></div><div>The values of the globals are set in runtime. Guvnor doesn&#39;t create any ksession (or working memory) for rules authoring. There is no need to do that. So, you can declare your globals in Guvnor&#39;s package area  and then use them in your rules. When an application uses these rules, and creates a ksession from them, it must provide the value for these globals.</div>

<div>By the way, which version of Drools are you using?   </div><div><br><font class="Apple-style-span" color="#000099">3) for stopping firing rules after one rule fire successfully, do you know<br>if there is an option to do that?<br>

For now i insert a boolean in the session and the first condition in all my<br>rules is that this boolean is there. When a rule fires successfully, i<br>retract it. I suppose there is a bettre way to do it?</font><br clear="all">

<br></div><div>I think the approach you have chosen is elegant enough. Of course that it will only prevents new activations to happen but it will not prevent current activations to be executed. For a cleaner implementation, you can make a super-rule with that condition and then make all your rules to inherit from it. </div>

<div>There is actually a way to force the engine to stop (I don&#39;t remember it, but I&#39;m pretty sure it is documented), but I don&#39;t know if that would be the best solution since I don&#39;t know if it has any collateral effect.</div>

<div><br></div><div>Best Regards,</div><div>  </div><div><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>

- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br><div class="gmail_quote">On Tue, Mar 1, 2011 at 9:27 AM, ioda100 <span dir="ltr">&lt;<a href="mailto:eddyhautot@gmail.com">eddyhautot@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hi,<br>
<br>
i have a few questions :<br>
<br>
1) my facts are in fact java Maps, is there an easy way to deal with them in<br>
guvnor? it&#39;s not like in the example where facts are objects and we give<br>
guvnor the Pojo model to know what we can do with it<br>
<br>
for example i have :<br>
$m  : Map((this[&quot;attribute1_of_the_map&quot;] == &quot;test1&quot;))<br>
<br>
How to deal with the map and have a prepopulated list of properties of the<br>
map? And to store it in the variable $m. Without using the &quot;free from drl&quot;<br>
where we have to write it by hand.<br>
<br>
2) how to deal with global constant with guvnor?<br>
<br>
i have something like :<br>
WorkingMemory wm = drools.getWorkingMemory();<br>
wm.setGlobal(&quot;resultValue&quot;, &quot;OK&quot;);<br>
<br>
Is it a direct way to play with global constant in Guvnor? Without using the<br>
&quot;free from drl&quot; where we have to write it by hand.<br>
<br>
3) for stopping firing rules after one rule fire successfully, do you know<br>
if there is an option to do that?<br>
For now i insert a boolean in the session and the first condition in all my<br>
rules is that this boolean is there. When a rule fires successfully, i<br>
retract it. I suppose there is a bettre way to do it?<br>
<br>
Thanks in advance for your help<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2602641.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2602641.html</a><br>


Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br></div>