<br><font size=2 face="sans-serif">Hi All,</font>
<br>
<br><font size=2 face="sans-serif">Could some one reply to the below mentioned
problem..</font>
<br><font size=2 face="sans-serif"><br>
Thanks,</font>
<br><font size=2 face="sans-serif">Nilima<br>
____________________________________________<br>
Experience certainty. IT Services<br>
Business Solutions<br>
Outsourcing<br>
____________________________________________</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Nilima R/PNE/TCS</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">rules-users@lists.jboss.org</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">03/31/2010 03:37 PM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Drools Guvnor: Loading enums programmatically</font></table>
<br>
<hr noshade>
<br>
<br><font size=2 face="sans-serif">Hi All,</font>
<br>
<br>
<br><font size=2 face="sans-serif">I'm trying to do a simple example of
loading enums programmatically following the Drools Guvnor Docuemntation.<br>
I'm on Drools Guvnor 5, Java 1.6 running under Jboss.<br>
<br>
I'm trying to define this 'data enumeration/drop down list'<br>
<br>
package opensource.test;</font>
<br>
<br><font size=2 face="sans-serif">import java.util.ArrayList;</font>
<br><font size=2 face="sans-serif">import java.util.HashMap;</font>
<br><font size=2 face="sans-serif">import java.util.List;</font>
<br><font size=2 face="sans-serif">import java.util.Map;</font>
<br>
<br><font size=2 face="sans-serif">public class SampleDataSource2 {</font>
<br><font size=2 face="sans-serif"> </font>
<br><font size=2 face="sans-serif">
public Map<String, List<String>>
loadData() {</font>
<br><font size=2 face="sans-serif">
</font>
<br><font size=2 face="sans-serif">
Map<String,
List<String>> data =</font>
<br><font size=2 face="sans-serif">
new HashMap<String,List<String>>();</font>
<br><font size=2 face="sans-serif">
</font>
<br><font size=2 face="sans-serif">
List<String>
d = new ArrayList<String>();</font>
<br><font size=2 face="sans-serif">
</font>
<br><font size=2 face="sans-serif">
d.add("A");</font>
<br><font size=2 face="sans-serif">
d.add("B");</font>
<br><font size=2 face="sans-serif">
d.add("C");</font>
<br><font size=2 face="sans-serif">
d.add("D");</font>
<br><font size=2 face="sans-serif">
d.add("E");</font>
<br><font size=2 face="sans-serif">
data.put("Employee.band",
d);</font>
<br><font size=2 face="sans-serif">
return data;</font>
<br><font size=2 face="sans-serif">
}</font>
<br><font size=2 face="sans-serif">}</font>
<br><font size=2 face="sans-serif"><br>
The jar containing the SampleDataSource2 has been defined as a model within
Guvnor and I defined another declarative model Employee with fields name,band,rating.<br>
<br>
Here's what I put in the 'Data enumeration' text window<br>
Employee.band =(new SampleDataSource2()).loadData()<br>
<br>
When validating the Data enumeration from Guvnor, I get the following error:<br>
Unable to load enumeration data.<br>
unable to resolve class: DataEnumSource<br>
Error type: org.mvel.CompileException</font><tt><font size=3><br>
</font></tt>
<br><font size=2 face="sans-serif">Any help will be highly appreciated
...</font>
<br>
<br><font size=2 face="sans-serif">Thanks,<br>
Nilima </font>
<br>
<br><pre>=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
</pre>