[rules-users] Usage of Drools in a RCP project

GRILLON, Jean Pierre jean-pierre.grillon at capgemini.com
Wed Sep 5 10:48:43 EDT 2007


Hi,

You might be interested by "DynamicImport-Package" (MANIFEST.MF) in your drools plugin, to allow it to dynamically access your classes that are located in another plugin.
These configurations depend a lot on your plugins architecture/dependencies.

Regards,
Jean-Pierre Grillon

-----Message d'origine-----
De : rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] De la part de gurks
Envoyé : mercredi 5 septembre 2007 15:11
À : rules-users at lists.jboss.org
Objet : Re: [rules-users] Usage of Drools in a RCP project


Thanx for your hints but you might have missunderstood something.

All the classes needed from Drools plugin are found and I can initialize the
ruleBase unless I try to add
an import statement for a java class into the DRL file. When the DRL file
gets parsed by Drools I
get this strange exception. Don't know why the class cannot be found. I
assume the class is
loaded by means of reflections in Drools. This means when the class is on
class path it should
also be found or do I forget something important???



Gaurav2007 wrote:
> 
> i am also working in same technology i am not able to use service of one
> plug-in from another in following cases :
> 1) export the required package of dependent plug-in,
> 2) add all the required jars in classpath from runtime tab of mainfest.mf
> file of your plugin.
> 3) in run time configuration of application required plug-in is not
> selected.
> 
> 
> 
> gurks wrote:
>> 
>> I'm working on a RCP project and now want to integrate Drools. There are
>> two plugins: CORE and UI.
>> The initialization of Drools is done in a Manager class in the core
>> plugin. The same plugin also has a class named Service. This class should
>> be imported in a DRL-file. The Manager is first called in the UI plugin
>> but don't think that's the problem. The Drools jars are placed in its own
>> plugin and the other two plugins are augemnted with the dependency
>> needed.
>> 
>> When I try to initialize the ruleBase I get the following exception:
>> 
>> org.drools.rule.InvalidRulePackage: Unable to resolve ObjectType
>> 'Service' : [Rule name=Your First Rule, agendaGroup=MAIN, salience=0,
>> no-loop=false]
>> Rule Compilation error : [Rule name=Your First Rule, agendaGroup=MAIN,
>> salience=0, no-loop=false]
>> 	at/mcw/jdent/services/core/persistent/Rule_Your_First_Rule_0.java (2:55)
>> : Only a type can be imported. test.core.persistent.Service resolves to a
>> package
>> 	at/mcw/jdent/services/core/persistent/Rule_Your_First_Rule_0.java
>> (7:342) : $serviceName cannot be resolved
>> org.drools.compiler.ImportError at 17a99
>> 	at org.drools.rule.Package.checkValidity(Package.java:408)
>> 	at
>> org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)
>> ...
>> 
>> I don't know why Drools does not find my Service class. It's in the same
>> plugin as the manager and should be visible to it.
>> 
>> Could anybody give me an advice how I can integrate Drools into my RCP
>> project correctly.
>> 
>> Thanx, gurks
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Usage-of-Drools-in-a-RCP-project-tf4383352.html#a12497183
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.





More information about the rules-users mailing list