[rules-users] Upgrading to Drools 6.0 questions (General)

MaverickDrools aseem.belsare at gmail.com
Mon Jul 8 09:46:15 EDT 2013


Hi,

We are trying to evaluate what it takes to move from drools 5.4 to drools
6.0

There are some questions that I'd appreciate if someone clarifies after I've
updated the code to use KieContainer instead of KnowledgeBase and
successfully upgraded to drools 6.0.0-Beta3


1. Resolution of the imports:

In previous versions (5.3/5.4) we were able to give import abc.def.* which
would import all the model classes required by a .drl file, this doesn't
seem to be valid anymore. Now we have to give a specific class name in every
import statement so the 6.0 compiler is still able to use it. (eg) import
abc.def.SomeCalss.
Is that a change that was done to the compiler to resolve the imports, or is
it just me?

2. Setting null values:

Some rule in one of my drl files was of the form - 

delare SomeDate
	date : java.util.Date
end

rule "do something"
when
.
.
then
	insertLogical (new SomeDate(null));
end

I'm assuming the compiler is calling the java.util.Date constructor which
shouldn't allow you to create a date with null being passed to the
constructor. This was ok with the previous versions (upto 5.4) and now
throws a NPE in 5.5 and 6.0. I'd think this should actually be throwing an
IllegalArgumentException with Date but throws a NPE instead. Is that true?
Is the drools compiler now catching that llegalArgumentException and
throwing a org.kie.api.runtime.rule.ConsequenceException due to null Date?

3. KieContainerImpl not serialized:

>From KnowledgeBase javadoc - Creating the KnowledgeBase can be heavy, where
as session creation is very light, so it is recommended that KnowledgeBases
be cached where possible to allow for repeated session creation.
We could achieve this using the EhCache and caching Knowledgebase objects.
We cannot do the same with KieContainer since it throws a
SerializationException with KieContainerImpl is not Serializable. So seems
like we cannot cache these KieCaontainer objects? Or is there some other way
to do that?

4. Release date for 6.0-Final:

What does the roadmap look like for the 6.0-Final?

Thanks.



--
View this message in context: http://drools.46999.n3.nabble.com/Upgrading-to-Drools-6-0-questions-General-tp4024812.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list