Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2634#discussion_r181775911
--- Diff:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ConnectableTask.java
---
@@ -103,8 +104,24 @@ private boolean isYielded() {
return connectable.getYieldExpiration() >
System.currentTimeMillis();
}
+ /**
+ * Make sure processor has work to do. This means that it meets one of
these criteria:
+ * <ol>
+ * <li>It is annotated with @TriggerWhenEmpty</li>
+ * <li>It has no incoming connections</li>
+ * <li>All incoming connections are self-loops</li>
+ * <li>It has data in an incoming Connection
+ * AND It is not a Funnel without outgoing connections
+ * </li>
+ * </ol>
+ * @return true if there is work to do, otherwise false
+ */
private boolean isWorkToDo() {
- return connectable.isTriggerWhenEmpty() ||
!connectable.hasIncomingConnection() || !hasNonLoopConnection ||
Connectables.flowFilesQueued(connectable);
+ return connectable.isTriggerWhenEmpty()
+ || !connectable.hasIncomingConnection()
--- End diff --
If connectable.hasIncomingConnection() is false, then that indicates that
the component is a 'source' component, and doesn't depend on incoming data to
be triggered, so it is said to have work to do. Similarly, if all incoming
connections are self-looping connections, then it is a source component and is
said to have work to do.
---