How to check whether a string is encoded or not in WSO2 ESB?

There might be a requirement to know whether a string is encoded or not in WSO2 ESB’s mediation flow. You can do it via a filter mediator as shown below.

<property name="string" value="abcd"/>
<property name="encodedString" expression="base64Encode('abcd')"/>
<log level="custom">
<property name="encodedString" expression="get-property('encodedString')"/>
<filter source="get-property('encodedString')"
<log level="custom">
<property name="encoded?" value="yes"/>
<log level="custom">
<property name="encoded?" value="no"/>
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.