[rules-dev] Why are fundamental API functions not part of "stable"?

Mark Proctor mproctor at codehaus.org
Fri Aug 20 11:46:41 EDT 2010


  On 20/08/2010 11:13, Wolfgang Laun wrote:
> On 9 August 2010 17:31, Mark Proctor<mproctor at codehaus.org>  wrote:
>> For now you can cast and unwrap any drools-api interface and get the
>> legacy concrete implementation that you need. We are aiming for 5.2 for
>> october, so we can look into exposing some more things then.
>>
> In the case of Rule, your proposal doesn't work. To show the set of rules
> bundled in an agenda group, I tried to
>
> StatefulKnowledgeSession session = ...;
> for( KnowledgePackage knowledgePackage:
> session.getKnowledgeBase().getKnowledgePackages() ){
>       for( Rule rule: knowledgePackage.getRules() ){
>            ???
>
> but it turns out that this "rule" object is of the interface type
>     org.drools.definition.rule.Rule
> implemented by
>     org.drools.definitions.rule.impl.Rule
> which is just as meagre as the interface. Dead end, apparently.
You looked at the wrong implementation. Notice that Rule is also 
implemented by org.drools.rule.Rule. That one has the meat you need.
> Using other classes like Package or RuleBase from the "unstable" part
> of the API to get at
> the "real meat" in org.drools.rule.Rule isn't really a way I want to go.
>
> Being able to "reverse engineer" one's rules for documentation or
> filters or similar is an asset which
> improves Drools usability. Please make do in 5.2.
> Thanks
> -W
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>




More information about the rules-dev mailing list