@ Override public void perform ( GraphRewrite event , EvaluationContext context ) { checkVariableName ( event , context ) ; WindupVertexFrame payload = resolveVariable ( event , getVariableName ( ) ) ; if ( payload instanceof FileReferenceModel ) { FileModel file = ( ( FileReferenceModel ) payload ) . getFile ( ) ; perform ( event , context , ( XmlFileModel ) file ) ; } else { super . perform ( event , context ) ; } }
Set the payload to the fileModel of the given instance even though the variable is not directly of it s type . This is mainly to simplify the creation of the rule when the FileModel itself is not being iterated but just a model referencing it .