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

r.bach at gmx.at r.bach at gmx.at
Thu Sep 6 01:47:04 EDT 2007


Thank you very Much Jean-Pierre. You're hint was very helpful. I forgot 
the possibility of RCP to register some plugin as buddy of the drools 
plugin. When I register the plugin using the drools plugin as buddy 
everything works fine. Even without setting a classloader.

So once again, thank you :)

GRILLON, Jean Pierre schrieb:
> 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
>>>
>>
> 



More information about the rules-users mailing list