How to use FileDocumentFromFile java action call

1
I try to create a microflow to massive upload files to a System.FileDocument entity. I am thinking to use java action call FileDocumentFromFile .  Loop a list of file path with files saved locally in %ProjectDeploymentDirectory%/data/files (or %ProjectDeploymentDirectory%/data/tmp) directory. Use the file path for “File” input and the System.FileDocument entity  for “File document”. Note, the entity is generalized from System.FileDocument.  However, when run the miroflow, the java.lang.NullPointerException error is encountered. It seems it can not open the file. Anybody have experience to use FileDocumentFromFile java action call?   ==================================== com.mendix.modules.microflowengine.MicroflowException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.NullPointerException     at Q3Module.ACT_Copy_Files.nested.3dd8f4c1-7d97-4d53-be8e-81008b489740 [0 of 4] (JavaAction : 'File document from file')     at Q3Module.ACT_Copy_Files ( : '') Advanced stacktrace:     at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:83) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.NullPointerException     at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:84) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: java.lang.NullPointerException     at com.mendix.util.classloading.Runner.withContextClassLoader(Runner.java:23) Caused by: java.lang.NullPointerException: null     at communitycommons.actions.FileDocumentFromFile.executeAction(FileDocumentFromFile.java:44)     at communitycommons.actions.FileDocumentFromFile.executeAction(FileDocumentFromFile.java:22)     at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71)     at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48)     at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.scala:25)     at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeSync$2(ActionManager.scala:80)     at com.mendix.util.classloading.Runner.withContextClassLoader(Runner.java:19)     at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:79)     at com.mendix.basis.actionmanagement.UserActionCallBuilderImpl.execute(UserActionCallBuilderImpl.scala:34)     at com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute
asked
1 answers
4

Hi Hong ,

 

As I understand it, the problem is not that the file does not open.

There is a "null" in the files selected from the opened file. So if you're holding an attribute in the entity, it might be empty.

Or in one of the files in the folder you selected as directory, there is a value that the program sees as empty, it evaluates to "null". Unfortunately I am not experts on the subject. I hope it helps.

 

Regards 

Ridvan

answered