Github user jskora commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1988#discussion_r125982805
  
    --- Diff: 
nifi-mock/src/main/java/org/apache/nifi/util/MockProcessSession.java ---
    @@ -756,6 +756,13 @@ public void transfer(FlowFile flowFile) {
                 throw new IllegalArgumentException("I only accept 
MockFlowFile");
             }
     
    +        // if the flowfile provided was created in this session (i.e. it's 
in currentVersions),
    +        // then throw an exception indicating that you can't transfer 
flowfiles back to self.
    +        // this mimics the behavior of StandardProcessSession
    +        if(currentVersions.get(flowFile.getId()) != null) {
    --- End diff --
    
    This should only fire the exception if the `flowFile.getId()` is in 
`currentVersions` but not in `originalVersions` since those are the newly 
created FlowFiles.  If it's in both it's a queued file being transferred back 
to the queue.  You can see the problem if you run the `TestUpdateAttribute` 
tests.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to