On 5 July 2011 11:09, lansyj <span dir="ltr">&lt;<a href="mailto:lansyjp@gmail.com">lansyjp@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
Sorry for the minimal information.<br>
<br>
We have a B2C application which is basically into eCommerce. You can<br>
consider it another amazon or ebay.<br>
<br>
And one thing we do today in a very crude way is personalize the appearance<br>
and content (ie., products, pricing of products, banner images, etc) based<br>
on the user profile. For example, on Valentine&#39;s day if the user is a male,<br>
he gets to see gifts for a female and vice versa.<br></blockquote><div><br>Sounds as if my wife would like me to shop there  ;-)<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
So, as part of a Solution revamp, we have decided to use Drools to manage<br>
product visibility by having a rule which says... if the user is male, dont<br>
show this but show that as a basic example. Now, there are certain<br>
functionalities we have as core in our Content Management System (like a<br>
custom Joomla or Drupal) which we wouldnt want to migrate entirely to<br>
Drools. So, we would define the segments in Drools and map such segments to<br>
the existing entities.<br>
<br>
eg: Segment can be Male vs Female with Segment Codes SEG_MALE and SEG_FEMALE<br>
as an example where SEG_MALE and SEG_FEMALE are two possible values in an<br>
enumerated list.</blockquote><div><br>Could be Java enum values or just String values, I suppose.  <br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 Now, this being the situation, we want to be able to<br>
retrieve this list</blockquote><div><br>Let&#39;s call it Collection<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> of enumerated values into our CMS so that we can map them<br>

to existing entities like banner images.<br></blockquote><div><br>There are several ways of extracting all values of a field of the full set of facts of a given type.<br><br>You can do it in a rule, creating a List or a Set. Or you can run a query.<br>
<br>There is nothing mysterious about the Working Memory of Drools. It&#39;s a bunch of objects and rules and queries operate on them according to your fancy programming.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
Hope this helps.<br></blockquote><div><br>And I hope to have allayed your fears ;-)<br><br>-W<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
Best Regards<br>
<br>
-lj<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140125.html" target="_blank">http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140125.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>
</font></blockquote></div><br>