Yes thanks it&#39;s working with enum like explained previously by Esteban. I won&#39;t do it dynamic for now i think.<br>
<br>
It&#39;s not always of the form &lt;string&gt;.&lt;string&gt;, i have some 
in &lt;string&gt;.&lt;int&gt; or &lt;string&gt;.&lt;long&gt; but for 
these i can make a separate DSL that will cast the string to int or 
long. Except if there is a better solution.<br>
<br>
Another thing is that i will have for this DSL :<br>
<b>[when]The property {key:ENUM:Map.properties} of the map
              is {value}=Map((this[&quot;{key}&quot;] == &quot;{value}&quot;))<br>
  <br>
The property &#39;prop1&#39; of the map is &#39;val1&#39;<br>
  <br>
But if i want to have a second rule : </b><b>&quot;The property &#39;prop1&#39; of 
the map is &#39;val1&#39;&quot; and the map is different of the first map found 
above. Let&#39;s say i have an attribute ID in the Maps, i could check that 
(ID1 != ID2)</b>. But with DSL i am a little lost of how to do that. With DRL i did like this :<br>
$m1 : Map(this[&quot;prop1&quot;] == &quot;val1&quot;)<br>
$m2 : Map((this[&quot;prop1&quot;] == &quot;val1&quot;) &amp;&amp; (this[&quot;id&quot;] != $m1[&quot;id&quot;]))<br>
<b><br>
i could do <br>
</b><b>[when]The property {key:ENUM:Map.properties} of the map
              is {value} = $m1 : Map((this[&quot;{key}&quot;] == &quot;{value}&quot;))<br>
but it will always be stored in $m1 so if i do : </b><b>&quot;The property &#39;prop1&#39; of the map is &#39;val1&#39;</b>&quot; twice, the second will override the value of $m1.<br>
<br>
<br>
I have to put my rules in 4 drl files separate (i know which rules go in
 which drl file), is the only way to create a different package for each
 drl file i want? And to put the Enum and DSL part in Global if i have 
to use it for the 4 files? If i want a precise name for my drl file, i 
have to give this exact name to the package?<br>
<br>
<br>
I tried to use the test scenario to test all that so i have created a simple Test Scenario.<br>
In the Given part, i have selected Map. Then keySet, i put prop1, 
prop2... and for entrySet, i put test1, test2... and i have made a 
simple rules that check that prop1 is equal to &quot;test1&quot; but when i run 
the scenario, i got :<br>
[Error: unable to find constructor for: java.util.Map]
[Near : {... new java.util.Map( ....}]
                               ^
[Line: 1, Column: 0] . Is there something special to do to test with Map?<br>
<br>
<br>
I tried to put some drools code in a function but it seems to not work. For example : <br>
WorkingMemory wm = drools.getWorkingMemory();<br>
wm.setGlobal(&quot;resultValue&quot;, &quot;OK&quot;); <br>
It&#39;s not a problem since i use DSL for this but i suppose it&#39;s normal.<br>
<br>
<br>
Sorry for all these problems, a little lost with all functionnality of this tool and manual doesn&#39;t talk a lot about this.<br>
<br>
thanks<br><br><div class="gmail_quote">On Thu, Mar 3, 2011 at 2:22 PM, Esteban [via Drools - Java Rules Engine] <span dir="ltr">&lt;<a href="/user/SendEmail.jtp?type=node&node=2626460&i=0&by-user=t" target="_top" rel="nofollow" link="external">[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>

        &quot;Maps.properties&quot; is just a name I choose for the enumeration. You can use whatever identifier you want, but..... The identifier has to be of the form &lt;string&gt;.&lt;string&gt;. It has to have a dot (.). I think this is because enumeration were created for bind a fact type attribute to a list of values.<div>




<br></div></div><div><div>Best Regards,<br clear="all"><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">2011/3/3 Vincent Legendre <span dir="ltr">&lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=2625046&amp;i=0&amp;by-user=t" rel="nofollow" link="external" target="_blank">[hidden email]</a>&gt;</span><br>


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



  
    
  
  <div bgcolor="#ffffff" text="#000000"><div><div></div><div>
    I don&#39;t think that enums needs to be linked to a Pojo attribute. To
    me it is just an identifier used in ENUM DSL constraints. The
    &#39;properties&#39; is not an attribute of a Map. I think you could set it
    to whatever you like (something more linked to your problem).<br>
    <br>
    For making that dynamic, it is explained in the <a href="http://drools.herod.net/drools-guvnor/html_single/index.html" rel="nofollow" link="external" target="_blank">guvnor
      doc</a> (<a rel="nofollow" link="external" target="_top">
      chapter &quot;1.4.2.4.8. Data enumerations (drop down list
      configurations)&quot; )</a><br>
    <pre><a rel="nofollow" link="external" target="_top">&#39;Person.age&#39; : (new com.yourco.DataHelper()).getListOfAges()</a></pre>
    <br>
    But I never tried that.<br>
    <br>
    <br>
    Le 02/03/2011 14:06, ioda100 a écrit :
    <blockquote style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;" type="cite"><div><div></div><div>Really thank you, it&#39;s working fine. I will see if
      it&#39;s working for my more difficult case.<br>
      <br>
      <br>
      <div class="gmail_quote">On Tue, Mar 1, 2011 at 11:28 PM, Esteban
        [via Drools - Java Rules Engine] <span dir="ltr">&lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=2613230&amp;i=0&amp;by-user=t" rel="nofollow" link="external" target="_blank">[hidden email]</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;">
          <div> You need to create the DSL first.<br>
            Follow these steps:<br>
            1.- Add java.util.Map to package imports (I think you
            already did this)<br>
            2.- Create a new Enumeration with the following content:<br>
            <b>&#39;Map.properties&#39;: [&#39;prop1&#39;, &#39;prop2&#39;, &#39;prop3&#39;]</b><br>
            3.- Create a new DSL with this content:<br>
            <b>[when]The property {key:ENUM:Map.properties} of the map
              is {value}=Map((this[&quot;{key}&quot;] == &quot;{value}&quot;))</b><br>
            4.- Create a new Rule and add the DSL sentence to the WHEN
            part. You should see the drop down.<br>
            <br>
            Note the name of the enumeration and how the variable {key}
            is defined in the DSL. I think you can also read the
            enumerations from a Java Enum present on your model, but I&#39;m
            not sure about it. Does anyone know about this?<br>
            <br>
          </div>
          <div>Best Regards,<br clear="all">
            <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>2011/3/1 ioda100 <span dir="ltr">&lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=2607065&amp;i=0" rel="nofollow" link="external" target="_blank">[hidden
                  email]</a>&gt;</span><br>
            </div>
            <blockquote class="gmail_quote" style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;"> Yes but for
              this i will be obliged to create a POJO of an object. And
              for attributes of that object in DSL i can define values
              that can take this attribute?
              <div>
                <div><br>
                  Maybe i don&#39;t understand but i don&#39;t see how to do
                  with this.<br>
                  <br>
                  My case :<br>
                  I have Maps in the session. Each Map has for example 5
                  properties (&quot;prop1&quot;, &quot;prop2&quot;, &quot;prop3&quot;, &quot;prop4&quot;,
                  &quot;prop51&quot;) and the value is a string. The Map is
                  Map&lt;String, Object&gt; but generally Object is a
                  String.<br>
                  So in the When clause i have something like that :<br>
                      <font color="#000099">$m  : Map((this[&quot;prop1&quot;] ==
                    &quot;test1&quot;))</font><br>
                  I have included java.utils.Map in Guvnor. So when i
                  add a when clause i can choose Map in the list but
                  impossible to have &quot;prop1&quot; to &quot;prop5&quot; in a drop down
                  list for attributes of the Map.<br>
                  Would it be possible to create a Pojo for Map or would
                  it be in conflict with the Map of Java?<br>
                  <br>
                  Thank you for your time<br>
                  <br>
                  <br>
                  Le 1/03/2011 17:55, Vincent Legendre [via Drools -
                  Java Rules Engine] a écrit :
                  <blockquote style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;" type="cite">
                    <div>
                      <div> Le 01/03/2011 15:39, ioda100 a écrit :
                        <blockquote style="border-left: 2px solid rgb(204, 204, 204); padding: 0pt 1em;" type="cite"> 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>
                        </blockquote>
                        You can define enumerations for a particular
                        attribute. <br>
                        Inside a DSL you can constrain a placeholder
                        with that enumeration. <br>
                        And finally, enums can be static, or dynamic (a
                        interface to implement that returns a list of
                        values).<br>
                        <br>
                        search the Guvnor&#39;s doc in these chapters<br>
                        <h5><a rel="nofollow" link="external" target="_top">1.4.2.4.8. Data

                            enumerations (drop down list configurations)</a></h5>
                        <br>
                        <br>
                      </div>
                    </div>
                    <div>
                      _______________________________________________ <br>
                      rules-users mailing list <br>
                      <a href="http://user/SendEmail.jtp?type=node&amp;node=2604255&amp;i=0&amp;by-user=t" rel="nofollow" link="external" target="_blank">[hidden
                        email]</a> <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>
                      <br>
                      <br>
                      <hr color="#cccccc" noshade size="1"> </div>
                    <div style="color: rgb(68, 68, 68); font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                      <div>
                        <div style="font-weight: bold;">If you reply to
                          this email, your message will be added to the
                          discussion below:</div>
                      </div>
                      <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2604255.html?by-user=t&amp;by-user=t&amp;by-user=t&amp;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-tp2602641p2604255.html</a>
                    </div>
                    <div style="color: rgb(102, 102, 102); font: 11px tahoma,geneva,helvetica,arial,sans-serif; margin-top: 0.4em;"> To unsubscribe from Guvnor
                      and drools implementation - questions, <a href="http://drools-java-rules-engine.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&amp;node=2602641&amp;code=ZWRkeWhhdXRvdEBnbWFpbC5jb218MjYwMjY0MXwtMTEzMzMwMzAxNA==&amp;by-user=t&amp;by-user=t&amp;by-user=t&amp;by-user=t&by-user=t" rel="nofollow" link="external" target="_blank">click

                        here</a>. </div>
                  </blockquote>
                </div>
              </div>
              <div>
                <div> <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-tp2602641p2606843.html?by-user=t&amp;by-user=t&amp;by-user=t&by-user=t" rel="nofollow" link="external" target="_blank">Re:
                    Guvnor and drools implementation - questions</a>
                  <div>
                    <br>
                    Sent from the <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html?by-user=t&amp;by-user=t&amp;by-user=t&by-user=t" rel="nofollow" link="external" target="_blank">Drools
                      - User mailing list archive</a> at Nabble.com.<br>
                  </div>
                </div>
              </div>
              <br>
              _______________________________________________
              <div><br>
                rules-users mailing list<br>
                <a href="http://user/SendEmail.jtp?type=node&amp;node=2607065&amp;i=1" rel="nofollow" link="external" target="_blank">[hidden
                  email]</a><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>
                <br>
              </div>
            </blockquote>
          </div>
          <div><br>
            <br>
            _______________________________________________
            <br>
            rules-users mailing list
            <br>
            <a href="http://user/SendEmail.jtp?type=node&amp;node=2607065&amp;i=2" rel="nofollow" link="external" target="_blank">[hidden
              email]</a>
            <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>
            <br>
            <br>
            <hr color="#cccccc" noshade size="1"> </div>
          <div style="color: rgb(68, 68, 68); font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
            <div>
              <div style="font-weight: bold;">If you reply to this
                email, your message will be added to the discussion
                below:</div>
            </div>
            <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2607065.html?by-user=t&amp;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-tp2602641p2607065.html</a>
          </div>
          <div>
            <div>
              <div style="color: rgb(102, 102, 102); font: 11px tahoma,geneva,helvetica,arial,sans-serif; margin-top: 0.4em;"> </div>
            </div>
          </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-tp2602641p2613230.html?by-user=t&by-user=t" rel="nofollow" link="external" target="_blank">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?by-user=t&by-user=t" rel="nofollow" link="external" target="_blank">Drools
        - User mailing list archive</a> at Nabble.com.<br>
      </div></div><pre><fieldset></fieldset>
_______________________________________________
rules-users mailing list
<div><a href="http://user/SendEmail.jtp?type=node&amp;node=2625046&amp;i=1&amp;by-user=t" rel="nofollow" link="external" target="_blank">[hidden email]</a>
</div><div><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>
</div></pre>
    </blockquote>
    <br>
    <br>
    </div></div><div><div>-- <br>
      
      
      
      
      <span style="font-size: 13.5pt; color: rgb(21, 24, 90);">Vincent LEGENDRE</span><br>
      <i><span style="font-size: 8.5pt; color: rgb(21, 24, 90);">Consultant Sénior</span></i><br>
      <span style="font-size: 4.5pt;"> <br>
      </span>
      <span style="font-size: 9pt; color: rgb(21, 24, 90);">EURODECISION</span><br>
      <span style="font-size: 9pt; color: rgb(21, 24, 90);">9A rue de la Porte de Buc 78000 VERSAILLES<br>
        Tél. : +33 (0)1 39 07 12 40<br>
        Direct : +33 (0)1 39 07 26 16<br>
        <a href="http://www.eurodecision.com" rel="nofollow" link="external" target="_blank">www.eurodecision.com</a></span><br>
      <a href="http://www.eurodecision.com/" rel="nofollow" link="external" target="_blank"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; color: windowtext; text-decoration: none;"> <img alt="EURODECISION" border="no"></span></a><a href="http://www.eurodecision.com/" rel="nofollow" link="external" target="_blank"><span style="font-size: 12pt; font-family: &quot;Times New Roman&quot;,&quot;serif&quot;; color: windowtext; text-decoration: none;"> </span></a>
    </div>
  </div></div>

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