I'm trying to generate multiple FlowFIles out of one input (using ExecuteScript with Jython), because I need to split a "Comment"-Entry into multiple information.
Currently I'm tryining to send out each flowfile in a for-loop with this Statement
for i in iterTyreFinder:
flowFile2 = session.write(flowFile, PyOutputStreamCallback())
Where the OutputStreamCallback only writes the text of an variable out
# Define a subclass of OutputStreamCallback for use in session.write()
def process(self, outputStream):
# end class
When I run this code, some Flowfiles success, and other fails, with this Exception.
"Failed to process session due to org.apache.nifi.processor.execption.ProcessException: javax.script.ScriptException: org.apache.nifi.process.execption.FlowFIleHandlingException:
is already marked for transfer in <script> at line number 196: javax-script.ScriptException:"
Seems that only one flowfile can be outputted for one input flowfile. Is there another way to solve this?
Splitting before ExecuteScript is not possible, because I do the Regex"Magic" inside the ExecuteScript with the Comment-Entry.