Copy the File contents from one entity to another

1
We need to do some refactoring. Assume the following: We have an entity OrderDocument which is a generalization from System.File. This entity is already used in production. We want to replace the OrderDocument by another entity named CustomerDocument and migrate the data. I created a migration flow which retrieves all the OrderDocuments, iterate over them and creates a new CustomerDocument for each. I can easily copy the attributes to the new entity, but have problems copying the file contents. I found the DuplicateFileDocument java action from the Community commons, which seems to be suited for this. However it has the following pre condition --> "HasContents of the 'fileToClone' need to be set to true, otherwise the action will not copy anything.". I can not directly alter the HasContent attribute of the new CustomerDocument. How should I change this attribute or are the better ways to copy file contents from one entity to another?  
asked
1 answers
4

'fileToClone' is your SOURCE file. If it has no contents there is indeed nothing to clone.

(HasContents is set by the Mendix Runtime)

answered