Thanks for your quick answer Esteban.<br><br>1) Ok i will have a look at DSL. In fact in my map i know all the properties (about 200). It would be cool to be able to have a drop down list with all these attributes as when we do it with objects for which we gave Pojo to Guvnor. <br>

<br><br>2) Yes i set the global constant i my application and put it in the session. But when a rule fire, it has to send back a value &quot;OK&quot; for example to the application. So i use the global consatnt to do that. As you say guvnor don&#39;t create a working memory (needed to change the global constant), i have to write by hand the lines : <font style="color: rgb(0, 0, 0);" color="#000099">WorkingMemory wm = drools.getWorkingMemory();<br>

wm.setGlobal(&quot;resultValue&quot;, &quot;OK&quot;); ?</font><br><br>i use version 5.1 of drools and guvnor.<br><br>3) ok i will stay with this solution. yes i only need to stop after the end of the rule that has successfully fired. I have tried other things like workingMemory.stop() or something like this but it was not working.<br>

<br>Thank you again<br style="color: rgb(0, 0, 0);"><br><br><br><div class="gmail_quote">On Tue, Mar 1, 2011 at 1:55 PM, Esteban [via Drools - Java Rules Engine] <span dir="ltr">&lt;<a href="/user/SendEmail.jtp?type=node&node=2603551&i=0" target="_top" rel="nofollow">[hidden email]</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

        
                
                <div>Hi,</div><div class="im"><div><br></div><font 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>

<div class="im"><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><div><br><div class="im"><font 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><div class="im"><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><div><br><div class="im"><font 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><div class="im"><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><div><div class="im"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" rel="nofollow" link="external" target="_blank">http://www.plugtree.com </a><br>



- Blog @ <a href="http://ilesteban.wordpress.com" rel="nofollow" link="external" target="_blank">http://ilesteban.wordpress.com</a><br>
<br><br></div><div class="gmail_quote"><div><div></div><div class="h5">On Tue, Mar 1, 2011 at 9:27 AM, ioda100 <span dir="ltr">&lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=2602877&amp;i=0" rel="nofollow" target="_blank" link="external">[hidden email]</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;"><div><div></div><div class="h5">

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>
</div></div><font color="#888888"><div><div></div><div class="h5"><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?by-user=t&by-user=t" rel="nofollow" link="external" 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>
</div></div><a href="http://user/SendEmail.jtp?type=node&amp;node=2602877&amp;i=1" rel="nofollow" target="_blank" link="external">[hidden email]</a><div class="im"><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></font></blockquote></div><br></div>
<br>_______________________________________________
<br>rules-users mailing list
<br><a href="http://user/SendEmail.jtp?type=node&amp;node=2602877&amp;i=2" rel="nofollow" target="_blank" link="external">[hidden email]</a>
<br><div class="im"><a href="https://lists.jboss.org/mailman/listinfo/rules-users" rel="nofollow" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
        
        <br>
        <br>
        </div><hr color="#cccccc" noshade size="1">
        <div style="color: rgb(68, 68, 68); font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight: bold;">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2602877.html?by-user=t" target="_blank" rel="nofollow" link="external">http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2602877.html</a>
        </div>
        <div style="color: rgb(102, 102, 102); font: 11px tahoma,geneva,helvetica,arial,sans-serif; margin-top: 0.4em;">
                
                
        </div></blockquote></div><br>

        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2603551.html">Re: Guvnor and drools implementation - questions</a><br/>
Sent from the <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html">Drools - User mailing list archive</a> at Nabble.com.<br/>