Nav

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:


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