I have an entity named MyFile with the generalization of file document.
You can pass the file document to any java action as shown below. Create a java action with the parameter of file entity
Deploy the code to eclipse.
In Eclipse, you can see your filedocument as a input
// This file was generated by Mendix Studio Pro.
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
// Special characters, e.g., Ã©, Ã¶, Ã , etc. are supported in comments.
public class ReadMyFile extends CustomJavaAction<java.lang.Void>
private IMendixObject __MyFile;
private voterregistration.proxies.MyFile MyFile;
public ReadMyFile(IContext context, IMendixObject MyFile)
this.__MyFile = MyFile;
public java.lang.Void executeAction() throws Exception
this.MyFile = __MyFile == null ? null : voterregistration.proxies.MyFile.initialize(getContext(), __MyFile);
// BEGIN USER CODE
throw new com.mendix.systemwideinterfaces.MendixRuntimeException("Java action was not implemented");
// END USER CODE
* Returns a string representation of this action
public java.lang.String toString()
// BEGIN EXTRA CODE
// END EXTRA CODE
I hope this helps you
Have a look at the Community Commons module in the Mendix App Store.
The source code to the Java Actions it uses are available in the Github repository. There are a number of actions that use FileDocuments there that would really help you.
Hope this helps.