WSO2 Filter Proxy Boolean Expression evaluator issue

1.6k views Asked by At

in my proxy i'm using a filter mediator. My target is to activate a sequence if some conditions on some properties are verified:

codice = 0 idElementoCross is different from null or empty string or if it exists tipoElementoCross is different from null or empty string or if it exists

i wrote this condition:

 <sequence>
     <property name="codice" expression="//codice"></property>
     <property name="idElementoCross" expression="//idElementoCross"></property>
     <property name="tipoElementoCross" expression="//tipoElementoCross"></property>
     <filter xpath="boolean(fn:get-property('codice')=0 and fn:get-property('tipoRisposta')='worker' and fn:get-property('tipoElementoCross')!='null' and fn:get-property('idElementoCross')!='null' and fn:get-property('tipoElementoCross')!='' and fn:get-property('idElementoCross')!='' and fn:get-property('tipoElementoCross') and fn:get-property('idElementoCross'))">
                 <then> ...

but in my log i see that esb enter the sequence even if idElementoCross and tipoElementoCross are empty. Im using WSO2 ESB 4.8.1.

What am i missing?

1

There are 1 answers

0
Jean-Michel On BEST ANSWER

This is because when there is no value, //tipoElementoCross return the node and not the text value :

send <tipoElementoCross></tipoElementoCross>

//tipoElementoCross = <tipoElementoCross></tipoElementoCross>

//tipoElementoCross/text() =