[rules-users] Solution for reasoning over XML?

craigparra craigparra at gmail.com
Sun Jan 13 22:09:44 EST 2013


I did initially consider just inserting the DOM objects, but the java DOM api
is quite obstruse, and difficult to navigate with MVEL expressions.  What I
have done is wrap the DOM api with some syntax sugar, that makes asserting
conditionals a lot neater.

My worry was that this would come at a performance cost; I expect that
marking the XmlElement as readonly, and then caching the derived fields like
the element path, its index, and even is value and so on, might improve
performance when the working memory is modified many times.  In my
implementation now, the derived values would be recalculated every time,
which of course you would want if modifying the DOM.

Interestingly, once pre-compiled I have found Drools is actually faster than
pre-compiled Groovy in the few examples I have tested.  This kind of
suprised me - a lot actually.   The pre-compilation of Drools is much more
expensive than Groovy, but the execution is quicker.

BTW, the extends keyword is very handy; I didn't realise drools could do
that :-)

 



--
View this message in context: http://drools.46999.n3.nabble.com/Solution-for-reasoning-over-XML-tp4021454p4021491.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list