[rules-users] How to dynamically invoke a field or property into a fact and set rule on that field or property

Mauricio Salatino salaboy at gmail.com
Thu Nov 10 00:22:55 EST 2011


Hi there,
can you elaborate a little bit more on what are you trying to achieve.
It's almost impossible to help with that generic description.

You can write rules on your products that create and insert new facts
pretty easily

Rule "categorize product"
  no-loop
  when
     $p:Product(name == "Product1")
  then
     $p.setCategory("category1");
     update($p);
end

This rule will enrich your original product with a category depending on
the product name. Are you looking to something similar to this?

Cheers

On Thu, Nov 10, 2011 at 2:05 AM, srinivasasanda <srinivasasanda at gmail.com>wrote:

> Hello
>     I have a problem  please any one help me
>     i have a field product type depending on product type i want to create
> new field or property or fact, and on the new field i want to give rules...
>   please send me some example or link to lean and practice
>   if we dynamically invoke the fact or add a property will it shows a
> pattern which is declaring that the rule is   looking for a that fact .
>
> In advance thanks if any one help ... thanks a lot ..
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-dynamically-invoke-a-field-or-property-into-a-fact-and-set-rule-on-that-field-or-property-tp3495811p3495811.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111110/5d003845/attachment.html 


More information about the rules-users mailing list