Contact Free trial Login

Example: To Test for an Instance of a Class

The Java module provides a DataWeave isInstanceOf() function that tests whether a given object is an instance of a given class, for example:

<choice>
    <when expression="#[Java::isInstanceOf(vars.person, com.foo.PrivilegedPerson)]">
        <flow-ref name="sendToVIP" />
    </when>
</choice>

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub