<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"><<a href="mailto:tsarkar@professionalaccess.com">tsarkar@professionalaccess.com</a>></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<String> titles = new ArrayList<String>();<br>
public List<String> getTitles() {<br>
return titles;<br>
}<br>
public void setTitles(List<String> titles) {<br>
this.titles = titles;<br>
}<br>
}<br>
<br>
and<br>
<br>
public class AgeValues {<br>
public Map<String,List<String>> loadData() {<br>
Map<String,List<String>> data = new HashMap<String,List<String>>();<br>
<br>
List<String> titleValues = new ArrayList<String>();<br>
titleValues.add("title1");<br>
titleValues.add("title2");<br>
data.put("AgeTest.titles", titleValues);<br>
<br>
return data;<br>
}<br>
}<br>
<br>
I get the following error while validating the enumeration: "The expression<br>
is not a map, it is a java.util.ArrayList".<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>