Jim,

You can use session.create() to create a new FlowFile from within your
script. You don't need a parent, or to transfer input->output, or even
write any content to the output FlowFile for your use case. After
flowFile = session.create(), you can do flowFile =
session.putAttribute(flowFile, "absolute.path", "/path/to/my/file")
and then transfer the flowFile(s) to success at the end.

Did I understand your use case correctly? If not please let me know
and I'll try again :)

Regards,
Matt


On Wed, Feb 7, 2018 at 2:51 PM, James McMahon <[email protected]> wrote:
> Good afternoon. I have a python script I will execute from an ExecuteScript
> processor. This script applies complex filtering logic to select certain
> files from a recursive directory structure. In my filtering loop, I will
> have the fully qualified path and the filename. The fq path I intend to use
> as absolute.path attribute in a flowFile, and the filename I intend to use
> as filename attribute. My flowFiles will be passed from ExecuteScript to a
> FetchFile processor.
>
> My question is this: how do I integrate the flowFile creation into my python
> script, creating an empty flowFile and setting the attributes at that point
> where I have the qualified file and metadata in my loop? I won't really have
> an input stream - I'll work through my loop until certain conditions trigger
> a break. As I find qualified files, I'll create a flowFile with no payload
> but with attributes that FetchFile requires to bring the file into my
> workflow.
>
> Thank you. -Jim

Reply via email to