[rules-users] "Discouraged access" warnings when using Drools Eclipse Workbench

Andre Santos andre.a.santos at jpmchase.com
Fri Jun 5 16:33:16 EDT 2009


Hello,

I have a little piece of code I wrote to evaluate a simple fact type. The
code is basically this:


RuleAgent agent = RuleAgent.newRuleAgent("/test-config.properties");
RuleBase rb = agent.getRuleBase();
		
FactType testFact = rb.getFactType("testPackage.testFact");
		
Object factObj = testFact.newInstance();
testFact.set(factObj, "property", "value");
StatelessSessionResult rs = rb.newStatelessSession().executeWithResults(new
Object[] {factObj});
			
for (Iterator i = rs.iterateObjects(); i.hasNext();) {   
     //... retrieve results
}


This code works fine, but Eclipse highlights almost all of it with the
following warning message:

"Discouraged access: The method newRuleAgent(String) from the type RuleAgent
is not accessible due to restriction on required library
drools-core-5.0.1.jar"

The same warning is issued for many objects/methods in this code.

This only happens when I right-click my project and "Convert to Drools
Project", and all Drools dependencies (almost 80!!) are added to the
project. If I manually add only drools-api-5.0.1.jar, drools-core-5.0.1 and
mvel2-2.0.10.jar, no warnings are displayed.

So the questions are: is there something wrong with this code? Am I using
some restricted part of the API? Is it a problem with "Convert to Drools
Project"?

Any comments will be most welcome.

Best regards,

Andre
-- 
View this message in context: http://www.nabble.com/%22Discouraged-access%22-warnings-when-using-Drools-Eclipse-Workbench-tp23895099p23895099.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list