@ Override public FileModel resolvePayload ( GraphRewrite event , EvaluationContext context , WindupVertexFrame payload ) { checkVariableName ( event , context ) ; if ( payload instanceof FileReferenceModel ) { return ( ( FileReferenceModel ) payload ) . getFile ( ) ; } if ( payload instanceof FileModel ) { return ( FileModel ) payload ; } return null ; }
Set the payload to the fileModel of the given instance even though the variable is not directly referencing it . This is mainly to simplify the creation of the rule when the FileModel itself is not being iterated but just a model referencing it .