[rules-users] Retrieving Enumerated List from Drools

2011-07-05 Thread lansyj
Hi, 

We have a custom CMS which we use to manage content like banner images, and
other personalization content. 

We would be using Drools to define user segments and would be associating a
unique code and short name to it - code for the system and short name for
the business users.

Now, is there a way for our custom CMS to be able to retrieve the enumerated
list (basically all possible values of that data element) such that it can
be used for mapping content in the CMS?

Any tip would be helpful.

Best Regards

-lj

--
View this message in context: 
http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140076.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


Re: [rules-users] Retrieving Enumerated List from Drools

2011-07-05 Thread Wolfgang Laun
Please understand that you are reporting from a domain that *you* know well
using terms that are familiar to *you*.

It's not clear to me what sort of objects you would insert; which values
participate in what operation; and why you need rules in the first place.

-W


On 5 July 2011 10:46, lansyj lans...@gmail.com wrote:

 Hi,

 We have a custom CMS which we use to manage content like banner images, and
 other personalization content.

 We would be using Drools to define user segments and would be associating a
 unique code and short name to it - code for the system and short name for
 the business users.

 Now, is there a way for our custom CMS to be able to retrieve the
 enumerated
 list (basically all possible values of that data element) such that it can
 be used for mapping content in the CMS?

 Any tip would be helpful.

 Best Regards

 -lj

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140076.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

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Retrieving Enumerated List from Drools

2011-07-05 Thread Michael Anstis
Hi,

Can you explain how you'd use ...Drools to define user segments and would
be associating a unique code and short name to it... so we can understand
how you expect to be ...able to retrieve the enumerated list?

Thanks,

Mike

On 5 July 2011 09:46, lansyj lans...@gmail.com wrote:

 Hi,

 We have a custom CMS which we use to manage content like banner images, and
 other personalization content.

 We would be using Drools to define user segments and would be associating a
 unique code and short name to it - code for the system and short name for
 the business users.

 Now, is there a way for our custom CMS to be able to retrieve the
 enumerated
 list (basically all possible values of that data element) such that it can
 be used for mapping content in the CMS?

 Any tip would be helpful.

 Best Regards

 -lj

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140076.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

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Retrieving Enumerated List from Drools

2011-07-05 Thread lansyj
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.

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. Now, this being the situation, we want to be able to
retrieve this list of enumerated values into our CMS so that we can map them
to existing entities like banner images.

Hope this helps.

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


Re: [rules-users] Retrieving Enumerated List from Drools

2011-07-05 Thread Michael Anstis
OK, I'd see your use as something like this:-

1. Define the rules (you give an example of)
2. At runtime insert appropriate facts into a KnowledgeSession
3. The rules return some indicator of the appropriate customisation
required

If this makes sense, you should probably read about using Globals (to return
a list of customisations out of WM) or StatelessSessions (which sounds
more appropriate, for scalability).

On 5 July 2011 10:09, lansyj lans...@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.

 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. Now, this being the situation, we want to be able to
 retrieve this list of enumerated values into our CMS so that we can map
 them
 to existing entities like banner images.

 Hope this helps.

 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

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Retrieving Enumerated List from Drools

2011-07-05 Thread Wolfgang Laun
On 5 July 2011 11:09, lansyj lans...@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

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users