TJ Tang
TJ Tang

Reputation: 931

Modify Export File Name in CORB

Is there a way to modify the export filename in CORB? I have the URIS module selecting a specific set of URIs, in the PROCESS module, I am doing some transformations and then returning what I want to write out. The incoming URI is an XML file, but the export out file is not, and I would like to change the output URI to something different, so that the extension makes sense. Right now everything is being exported using the selected URIs.

Upvotes: 1

Views: 174

Answers (1)

Mads Hansen
Mads Hansen

Reputation: 66781

If you are using the ExportToFileTask, the default behavior is to save the file using the value from the URI.

So, one easy way to change the output filenames would be to adjust the URIs returned in your URIs module to be what you want the output filename to be. You could modify the URI values to have the desired output filename, but would also need to be able to undo that change inside your process module in order to get the correct document URI to read the document. For instance, change URIs to have a ".txt" file extension in the URIs module output, and in the process module would need to replace ".txt" with ".xml".

If you are comfortable writing Java, you could create a custom task that extends the ExportToFileTask class and overrides the getFileName() method to do whatever you want.

A third option would be to apply some sort of post-batch processing to rename the output files.

Upvotes: 1

Related Questions