regex - WSO2 ESB 4.8.1 Switch Mediator Case matching not working -


i using wso2 esb 4.8.1. need check if particular field exists in incoming payload xml. if iit does, switch case should run, otherwise should run default scenario. field on checking have dynamic value , following:

20000569899 

i wrote following logic in esb:

 <property name="checkidexist" expression="//*[local-name()='id']" scope="default" type="string" description="checkidexist"/>     <switch source="get-property('checkidexist')">         <case regex="[a-za-z0-9]">             <sequence key="sequencea"/>             <sequence key="sequenceb"/>             <sequence key="sequencec"/>         </case>         <default>            <log></log>         </default>     </switch> 

problem:

the problem switch able pick value property not match case regular expression. following esb logs entries:

logs entries:

xpath : get-property('checkidexist') evaluates : 20001089900  none of switch cases matched - executing default 

i checked online, regular expression works. unable understand why wso2 esb not recognizing valid expression. or there other way check if field exists in input request particular switch case should work, otherwise not.

your regular expression lacks quantifier + meaning 1 or more occurrences:

<case regex="[a-za-z0-9]+"> 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -