Hi,
I've just downloaded the latest nightly build of servicemix 3.2.2 and it
seems
problem in evaluating expression with namespace are reappred in this
version.
When i write in the drools rule a rule with namespace prefix, this will
cause
a runtime errors saying the namespace is not bound.
What i've found is that at deployment phase the namespace context is not
populated.
This seem strange because in the xbean of drools su i've declared
namespace context
as i'm usually able to declare.
Any idea??
Here my xbean:
<?xml version="1.0"?>
<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:drools="http://servicemix.apache.org/drools/1.0"
xmlns:Es2_v_0="urn:eng:spagic:processes:Es2:v0"
xmlns:util="http://www.springframework.org/schema/util">
<drools:endpoint
service="Es2_v_0:Es2.Val2Livello_v_0"
endpoint="Es2.Val2Livello_v_0"
ruleBaseResource="classpath:val2.drl"
namespaceContext="#nsContext"
assertedObjects="#assertedObjects"
defaultTargetService="Es2_v_0:Es2.Router1_v_0">
</drools:endpoint>
<util:list id="assertedObjects">
<ref bean="dbhelper"/>
</util:list>
<bean id="dbhelper" class="org.spagic.smx.helpers.DbHelper">
</bean>
<drools:endpoint
service="Es2_v_0:Es2.Router1_v_0"
endpoint="Es2.Router1_v_0"
ruleBaseResource="classpath:Es2.Router1_v_0.drl"
namespaceContext="#nsContext">
</drools:endpoint>
<drools:endpoint
service="Es2_v_0:Es2.Router2_v_0"
endpoint="Es2.Router2_v_0"
ruleBaseResource="classpath:Es2.Router2_v_0.drl"
namespaceContext="#nsContext">
</drools:endpoint>
<drools:namespace-context id="nsContext">
<drools:namespaces>
<drools:namespace
prefix="spgtypes">urn:spagic:crm:types</drools:namespace>
<drools:namespace
prefix="restart">urn:it:eng:spagic:restart</drools:namespace>
<drools:namespace
prefix="spagic">urn:it:eng:spagic</drools:namespace>
<drools:namespace
prefix="spgser">urn:spagic:crm:services</drools:namespace>
</drools:namespaces>
</drools:namespace-context>
</beans>
Here the drools file causing the problem is:
package org.apache.servicemix.drools
import org.apache.servicemix.drools.model.Exchange;
import org.spagic.smx.helpers.DbHelper;
global org.apache.servicemix.drools.model.JbiHelper jbi;
rule "Route FaultInFlow "
when
me : Exchange( status == Exchange.ACTIVE, in : in != null )
eval( in.xpath("/spgser:in/spgtypes:TIPO_SERVIZIO = '10'") )
then
jbi.routeToDefault("<Fault> Tipo Servizio 10 </Fault>");
end