Hello, my name is PaulM.

I am very new at both NiFi and relatively new at Python.


I have successfully cobbled together a NiFi ExecuteScript processor
(complete with embeded Python Code).
That python code CAN/DOES read the original Flow-File content, sets/updates
a NiFi attribute of my choosing,
repopulates the Flow-File content with some junk (io.environ) data (and some
other Hello-World lines..).
Then successfully, returns (from the Python execution), the new attribute
and new Flow-File content to 
the NiFi ExecuteScript.


I had this success by reading a PART-1/PART-2 example (of Python) found
within a cloudera link..
(((
https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-
part-1/ta-p/248922 ))).


What I am hoping to get from this developer mailing list eMail request (((
dev@nifi.apache.org )))
is where/how to locate DOCUMENTATION for what is available within the
**PYTHON SIDE** of these library calls.


For example, my Python uses these IMPORT STATEMENTS:


import os
import datetime

from org.python.core.util.FileUtil import wrap
from org.apache.nifi.processors.script import ExecuteScript
from org.apache.commons.io import IOUtils
from java.nio.charset import StandardCharsets
from org.apache.nifi.processor.io import StreamCallback


...and from the example code (which does work...)  I am especially
interested in 
the PYTHON documentation for "ExecuteScript" so that I can also know things
like the complement 
FAILURE variable name, to this SUCCESS:

                session.transfer(flow_file, ExecuteScript.REL_SUCCESS)


... and learn all the other Python functions available for the ExecuteScript
API.


Hopefully that documentation would ALSO point out important concepts like 
inside my "class PyStreamCallback(StreamCallback):" the execution flow will
automagically call "process"
within that class... and all the various (correct) data types that are
expected within the Python execution.

... and that the
"outputStream.write(bytearray(newFlowContentStr.encode('utf-8')))"
expects a parameter of type bytearray, to the write() function.



I thank you in advance.

Sincerely,
PaulM


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to