[rules-users] Integrating rules with your applications +Changeset.xml

Nilima R nilima.r at tcs.com
Wed Jan 20 08:14:23 EST 2010


Can anyone explain/example how to use changeset.xls to integrate with the 
rules I have written in Guvnor.Need to use Drools API for Integrating 
rules with java application


At present am using the below code

Properties properties = new Properties();
                        InputStream stream = rulesServlet.class
.getResourceAsStream ("/com/opensource/rules.properties");
                        properties.load(stream);
                        RuleAgent agent = RuleAgent.newRuleAgent
(properties);
                        RuleBase base = agent.getRuleBase();
                        FactType customer = base.getFactType(
"myPackage.Customer");
                        Object cust1 = customer.newInstance();
                        customer.set(cust1, "totalIntemsPrice", price);
                        base.newStatelessSession().execute(cust1);
                        System.out.println("Discount is a "+ 
customer.get(cust1, "discount"));

The documentation is not pretty clear.



Nilima
____________________________________________
Experience certainty.   IT Services
                        Business Solutions
                        Outsourcing
____________________________________________
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100120/0b8e89e4/attachment.html 


More information about the rules-users mailing list