[rules-users] Recommended way to register custom ResourceTypeBuilder?

helo henning.losert at gmail.com
Mon May 16 02:19:02 EDT 2011


Thanks for the reply. I was wondering already why I couldn't find any
information on this.

I stumbled upon this when I was trying to understand how resources are added
to the KnowledgeBase and it was easy enough to implement my own
ResourceTypeBuilder.

Since what I'm doing right now is highly experimental anyways I'm not too
concerned about using internal stuff. Since it works the way I intended it
to right now it's fine for now, maybe I'll think of something more elegant
later on.

Cheers
Henning




Mark Proctor wrote:
> 
> The ResourceTypeBuilder builder stuff is internal. So you are kind of on 
> your own for now. We may look at trying to clean this up and expose at a 
> later date. Tbh I'm not even sure when this class was added, I suspect 
> it's unfinished work on pluggable builders that someone will improve
> later.
> 
> 
> Mark
> 
> On 13/05/2011 15:55, helo wrote:
>> Hello there,
>>
>> in a project I've been working on lately I had to implement my own custom
>> ResourceTypeBuilder for a special file format I'm using. The import of
>> files
>> in my format works perfectly using my ResourceTypeBuilder, my only
>> concern
>> left is where to register my ResourceTypeBuilder.
>>
>> What I'm doing right now is something like this:
>>
>> ResourceTypeBuilderRegistry.getInstance().register(myResourceType, new
>> myResourceTypeBuilder());
>> KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder
>> ();
>> kbuilder.add (...);
>>
>>
>> The problem I see with this is that I will have to do this every time I
>> write an application using my file format. I would like to know if there
>> is
>> a nicer way to register my ResourceTypeBuilder, maybe via some
>> configuration
>> file like drools.rulebase.conf or drools.session.conf. I would greatly
>> prefer that over the solution I'm using now.
>>
>> Thanks in advance!
>>
>> Cheers
>> Henning Losert
> 


--
View this message in context: http://drools.46999.n3.nabble.com/Recommended-way-to-register-custom-ResourceTypeBuilder-tp2935358p2946641.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list