- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Removing flowfile from queue in ExecuteScript Processor
- Labels:
-
Apache NiFi
Created ‎09-29-2016 01:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Created ‎09-29-2016 01:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
Created ‎09-29-2016 01:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).
