Try to create a jar file out of your code and copy it to: guvnor/WEB-INF/lib/yourCode.jar

On Thu, Jan 27, 2011 at 10:31 PM, drools10 <tsarkar@professionalaccess.com> wrote:

Hi,
  I am a newbie to drools/guvnor. I am trying to populate a drop-down list
in guvnor rule generation with preconfigured values(which would come from
database).
I tried to populate the titles property of AgeTest class with values from
loadData() method of AgeValues class.
In the new Enumeration I gave: titles=(new
com.guvnor.AgeValues()).loadData();
My classes are as below:
public class AgeTest {
           private List<String> titles = new ArrayList<String>();
           public List<String> getTitles() {
               return titles;
           }
           public void setTitles(List<String> titles) {
               this.titles = titles;
           }
}

and

public class AgeValues {
  public Map<String,List<String>> loadData() {
           Map<String,List<String>> data = new HashMap<String,List<String>>();

           List<String> titleValues = new ArrayList<String>();
           titleValues.add("title1");
           titleValues.add("title2");
           data.put("AgeTest.titles", titleValues);

           return data;
        }
}

I get the following error while validating the enumeration: "The expression
is not a map, it is a java.util.ArrayList".

Can anyone please guide me in this regard. I even tried to have titles field
as a map, but same issue.
I copied the 2 classes to my guvnor/web-inf folder.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Loading-enums-programmatically-in-guvnor-tp2365812p2365812.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users