Member since
02-12-2017
1
Post
6
Kudos Received
0
Solutions
02-14-2017
09:52 AM
6 Kudos
I did it using a single processor using the penalize function: This is the executeScript code: #
# This processor will route the flow into the REL_FAILURE relationship penalizing if for 2h the 1st time
# after 2h the processor will route the flowfile into the success relationship.
#
flowfile = session.get()
if flowfile is not None:
waitState = flowfile.getAttribute( '_wait_state' )
# this process has no wait_state Set, so set it and penalize it
if waitState is None:
flowfile = session.putAttribute( flowfile, '_wait_state', '1' )
flowfile = session.penalize(flowfile)
session.transfer( flowfile, REL_FAILURE )
# this flowfile has already penalized
else:
flowfile = session.removeAttribute( flowfile, '_wait_state' )
session.transfer( flowfile, REL_SUCCESS )
This is the demo workflow. All I have to do is set the penalize value, this is how long the flowfile will stay parked into the failure queue. If this case 120 secs.
... View more