<p dir="ltr">All data access has to be &quot;black boxed&quot; inside your helper class. The example simply sets up some static data but could equally read the data from a database. The implementation would be entirely up to your own imvention.</p>

<p dir="ltr">Sent on the move</p>
<div class="gmail_quote">On 7 Jan 2014 13:31, &quot;abhinay_agarwal&quot; &lt;<a href="mailto:abhinay_agarwal@infosys.com">abhinay_agarwal@infosys.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The following sentences are taking directly from the user guide:<br>
<br>
/ &#39;Person.age&#39; : (new com.yourco.DataHelper()).getListOfAges()<br>
<br>
This assumes you have a class called &quot;DataHelper&quot; which has a method<br>
&quot;getListOfAges()&quot; which returns a List of strings (and is on the classpath).<br>
You can of course mix these &quot;dynamic&quot; enumerations with fixed lists. You<br>
could for example load from a database using JDBC. The data enumerations are<br>
loaded the first time you use the guided editor in a session./<br>
<br>
Now, I would like to know how guvnor would connect to the database ?<br>
<br>
Inside the getListOfAges(), I want to hit the database and get the list of<br>
ages, put it inside a Map&lt;String, List&amp;lt;String&gt;&gt;.<br>
<br>
The example that is shown in the user guide is again hard coding the values.<br>
<br>
&gt;From the user guide :<br>
<br>
/public class SampleDataSource2 {<br>
    public Map&lt;String&gt;, List&lt;String&gt; loadData() {<br>
       Map data = new HashMap();<br>
       List d = new ArrayList();<br>
       d.add(&quot;value1&quot;);<br>
      d.add(&quot;value2&quot;);<br>
      data.put(&quot;Fact.field&quot;, d);<br>
      return data;<br>
  }<br>
}/<br>
<br>
<br>
AFAIK, the jar of this class SampleDataSource2 will be uploaded to guvnor,<br>
so should I keep the connection details to database inside the same class ?<br>
If yes,<br>
<br>
1. How will guvnor be able to directly connect to the database ?<br>
2. Should I add the jars for database connectivity as well ?<br>
3. Is keeping the connection details inside the jar, not a security threat ?<br>
<br>
I am not sure if I understand completely how this enumeration works, please<br>
feel free to guide me, if I am wrong somewhere.<br>
<br>
Regards,<br>
Abhinay<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Using-Advanced-Enumeration-Concepts-in-guvnor-tp4027563.html" target="_blank">http://drools.46999.n3.nabble.com/Using-Advanced-Enumeration-Concepts-in-guvnor-tp4027563.html</a><br>

Sent from the Drools: User forum 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>
</blockquote></div>