Create file in java action

0
Hi! I use a java action to query a remote endpoint. The response of the query should be downloaded as a file.  My current approach is to create an ouputFile entity (as System.FileDocument) and use this as an input parameter for the java action. The return type is set to Object with the outputFile entity.   My code snippet:   public IMendixObject executeAction() throws Exception { this.outputFile = this.__outputFile == null ? null : XX.proxies.OutputFile.initialize(getContext(), __outputFile); // BEGIN USER CODE ... my code to query and set the contents of the outputfile ... this.outputFile.setContents(getContext(), in, 0); return this.outputFile; //END USER CODE }   So, now the outputFile is not of type IMendixObject. How to return the outputFile?      
asked
2 answers
4

The outputFile is a Mendix object as a proxy.

Use the __outputFile as the IMendix object

answered
1

What Erwin says, or use return this.outputFile.getMendixObject();

answered