Support Questions

Find answers, ask questions, and share your expertise

Removing flowfile from queue in ExecuteScript Processor

avatar
Contributor

Hi,

I have a simple workflow whereby a flowfile is passed into an ExecuteScript processor. This runs the following python in the Script Body:

ff = session.create()

session.transfer(ff, REL_SUCCESS)

This transfers the flowfile to the success path, however, the flowfile is never removed from the input queue and thus continues to execute again and again. How do I remove it from the input queue once the script has run?

p.s. Is there any documentation for this? Best I have found is the (unofficial?) http://funnifi.blogspot.co.uk/2016/02/executescript-processor-hello-world.html

Cheers,

Breandán

1 ACCEPTED SOLUTION

avatar
Master Guru

session.create() will create a new flow file, it won't use an incoming one. For that you will want session.get(), which returns a flow file (or None). If you require an input flow file, be sure to check for None and only continue processing if the flow file != None. There is an example of this on my blog (same site as above but different post).

View solution in original post

1 REPLY 1

avatar
Master Guru

session.create() will create a new flow file, it won't use an incoming one. For that you will want session.get(), which returns a flow file (or None). If you require an input flow file, be sure to check for None and only continue processing if the flow file != None. There is an example of this on my blog (same site as above but different post).