<font color="#000099"><font face="comic sans ms,sans-serif">Try to create a jar file out of your code and copy it to: guvnor/WEB-INF/lib/yourCode.jar<br></font></font><br><div class="gmail_quote">On Thu, Jan 27, 2011 at 10:31 PM, drools10 <span dir="ltr">&lt;<a href="mailto:tsarkar@professionalaccess.com">tsarkar@professionalaccess.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Hi,<br>
   I am a newbie to drools/guvnor. I am trying to populate a drop-down list<br>
in guvnor rule generation with preconfigured values(which would come from<br>
database).<br>
I tried to populate the titles property of AgeTest class with values from<br>
loadData() method of AgeValues class.<br>
In the new Enumeration I gave: titles=(new<br>
com.guvnor.AgeValues()).loadData();<br>
My classes are as below:<br>
public class AgeTest {<br>
            private List&lt;String&gt; titles = new ArrayList&lt;String&gt;();<br>
            public List&lt;String&gt; getTitles() {<br>
                return titles;<br>
            }<br>
            public void setTitles(List&lt;String&gt; titles) {<br>
                this.titles = titles;<br>
            }<br>
}<br>
<br>
and<br>
<br>
public class AgeValues {<br>
   public Map&lt;String,List&lt;String&gt;&gt; loadData() {<br>
            Map&lt;String,List&lt;String&gt;&gt; data = new HashMap&lt;String,List&lt;String&gt;&gt;();<br>
<br>
            List&lt;String&gt; titleValues = new ArrayList&lt;String&gt;();<br>
            titleValues.add(&quot;title1&quot;);<br>
            titleValues.add(&quot;title2&quot;);<br>
            data.put(&quot;AgeTest.titles&quot;, titleValues);<br>
<br>
            return data;<br>
         }<br>
}<br>
<br>
I get the following error while validating the enumeration: &quot;The expression<br>
is not a map, it is a java.util.ArrayList&quot;.<br>
<br>
Can anyone please guide me in this regard. I even tried to have titles field<br>
as a map, but same issue.<br>
I copied the 2 classes to my guvnor/web-inf folder.<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Loading-enums-programmatically-in-guvnor-tp2365812p2365812.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Loading-enums-programmatically-in-guvnor-tp2365812p2365812.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>