On 5 July 2011 11:09, lansyj <lansyjp@gmail.com> wrote:
Hi,

Sorry for the minimal information.

We have a B2C application which is basically into eCommerce. You can
consider it another amazon or ebay.

And one thing we do today in a very crude way is personalize the appearance
and content (ie., products, pricing of products, banner images, etc) based
on the user profile. For example, on Valentine's day if the user is a male,
he gets to see gifts for a female and vice versa.

Sounds as if my wife would like me to shop there  ;-)
 

So, as part of a Solution revamp, we have decided to use Drools to manage
product visibility by having a rule which says... if the user is male, dont
show this but show that as a basic example. Now, there are certain
functionalities we have as core in our Content Management System (like a
custom Joomla or Drupal) which we wouldnt want to migrate entirely to
Drools. So, we would define the segments in Drools and map such segments to
the existing entities.

eg: Segment can be Male vs Female with Segment Codes SEG_MALE and SEG_FEMALE
as an example where SEG_MALE and SEG_FEMALE are two possible values in an
enumerated list.

Could be Java enum values or just String values, I suppose. 
 
Now, this being the situation, we want to be able to
retrieve this list

Let's call it Collection
 
of enumerated values into our CMS so that we can map them
to existing entities like banner images.

There are several ways of extracting all values of a field of the full set of facts of a given type.

You can do it in a rule, creating a List or a Set. Or you can run a query.

There is nothing mysterious about the Working Memory of Drools. It's a bunch of objects and rules and queries operate on them according to your fancy programming.
 

Hope this helps.

And I hope to have allayed your fears ;-)

-W
 

Best Regards

-lj

--
View this message in context: http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140125.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users