<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

  
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  
  
    Really thank you for your help, i am new to Guvnor and the syntax is
    not so obvious when we do something less usual.<br>
    <br>
    I will try that tomorrow<br>
    <br>
    Le 1/03/2011 23:28, Esteban [via Drools - Java Rules Engine] a
    écrit :
    <blockquote
      cite="mid:AANLkTi=xh2Tp=UcZc1mU4J9yzVhfAoBmnOvA6QkjTk=z@mail.gmail.com"
      type="cite"> 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>'Map.properties': ['prop1', 'prop2', 'prop3']</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["{key}"] == "{value}"))</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'm not sure about it.
      Does anyone know about this?<br>
      <br>
      Best Regards,<br clear="all">
      <br>
      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
      <br>
      Esteban Aliverti<br>
      - Developer @ <a moz-do-not-send="true"
        href="http://www.plugtree.com" target="_blank" rel="nofollow" link="external">http://www.plugtree.com </a><br>
      - Blog @ <a moz-do-not-send="true"
        href="http://ilesteban.wordpress.com" target="_blank" rel="nofollow" link="external">http://ilesteban.wordpress.com</a><br>
      <br>
      <br>
      <div class="gmail_quote">2011/3/1 ioda100 <span dir="ltr">&lt;<a
            moz-do-not-send="true" href="/user/SendEmail.jtp?type=node&amp;node=2607065&amp;i=0&by-user=t"
            target="_top" rel="nofollow" link="external">[hidden email]</a>&gt;</span><br>
        <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?<br>
          Maybe i don't understand but i don'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 ("prop1", "prop2", "prop3", "prop4", "prop51") 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["prop1"] ==
            "test1"))</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
          "prop1" to "prop5" 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 class="h5"> 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's doc in these chapters<br>
                <h5><a moz-do-not-send="true" rel="nofollow" link="external" target="_top">1.4.2.4.8. Data
                    enumerations (drop down list configurations)</a></h5>
                <br>
                <br>
              </div>
            </div>
            <div class="im">
              _______________________________________________ <br>
              rules-users mailing list <br>
              <a moz-do-not-send="true"
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 moz-do-not-send="true"
                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="noshade" size="1"> </div>
            <div style="color: rgb(68, 68, 68); font: 12px
              tahoma,geneva,helvetica,arial,sans-serif;">
              <div class="im">
                <div style="font-weight: bold;">If you reply to this
                  email, your message will be added to the discussion
                  below:</div>
              </div>
              <a moz-do-not-send="true" href="http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2604255.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-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 moz-do-not-send="true" 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&by-user=t" rel="nofollow" link="external" target="_blank">click
                here</a>. </div>
          </blockquote>
          <div>
            <div class="h5"> <br>
              <hr width="300" align="left">
              View this message in context: <a moz-do-not-send="true" href="http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2606843.html?by-user=t&by-user=t"
                target="_blank" rel="nofollow" link="external">Re:
                Guvnor and drools implementation - questions</a><br>
              Sent from the <a moz-do-not-send="true" href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html?by-user=t&by-user=t"
                target="_blank" rel="nofollow" link="external">Drools -
                User mailing list archive</a> at Nabble.com.<br>
            </div>
          </div>
          <br>
          _______________________________________________<br>
          rules-users mailing list<br>
          <a moz-do-not-send="true" href="/user/SendEmail.jtp?type=node&amp;node=2607065&amp;i=1&by-user=t"
            target="_top" rel="nofollow" link="external">[hidden email]</a><br>
          <a moz-do-not-send="true"
            href="https://lists.jboss.org/mailman/listinfo/rules-users"
            target="_blank" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <br>
      _______________________________________________
      <br>
      rules-users mailing list
      <br>
      <a moz-do-not-send="true" href="/user/SendEmail.jtp?type=node&amp;node=2607065&amp;i=2&by-user=t"
        target="_top" rel="nofollow" link="external">[hidden email]</a>
      <br>
      <a moz-do-not-send="true"
        href="https://lists.jboss.org/mailman/listinfo/rules-users"
        target="_top" rel="nofollow" link="external">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
      <br>
      <br>
      <hr color="#cccccc" noshade="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 moz-do-not-send="true" href="http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2607065.html?by-user=t" target="_top" rel="nofollow" link="external">http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-and-drools-implementation-questions-tp2602641p2607065.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 moz-do-not-send="true" href="http://drools-java-rules-engine.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&amp;node=2602641&amp;code=ZWRkeWhhdXRvdEBnbWFpbC5jb218MjYwMjY0MXwtMTEzMzMwMzAxNA==&by-user=t" target="_top" rel="nofollow" link="external">click
          here</a>. </div>
    </blockquote>
  


        
<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-tp2602641p2607118.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/>