<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. &nbsp; &nbsp; &nbsp; &nbsp;IT Services<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;Business Solutions<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;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">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; public Map&lt;String, List&lt;String&gt;&gt;
loadData() {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Map&lt;String,
List&lt;String&gt;&gt; data =</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; new HashMap&lt;String,List&lt;String&gt;&gt;();</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List&lt;String&gt;
d = new ArrayList&lt;String&gt;();</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d.add(&quot;A&quot;);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d.add(&quot;B&quot;);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d.add(&quot;C&quot;);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d.add(&quot;D&quot;);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d.add(&quot;E&quot;);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data.put(&quot;Employee.band&quot;,
d);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return data;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;}</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>
 &nbsp; &nbsp; &nbsp; &nbsp;Unable to load enumeration data.<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
unable to resolve class: DataEnumSource<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
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>