[ 
https://issues.apache.org/jira/browse/NIFI-3218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16077046#comment-16077046
 ] 

ASF GitHub Bot commented on NIFI-3218:
--------------------------------------

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.


> MockProcessSession should prevent transferring new FlowFile to input queue
> --------------------------------------------------------------------------
>
>                 Key: NIFI-3218
>                 URL: https://issues.apache.org/jira/browse/NIFI-3218
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.1.0, 0.8.0
>            Reporter: Joe Skora
>            Assignee: Michael Hogue
>
> StandardProcessSession.transfer() throws an exception if called with a newly 
> created FlowFile and no relationship.  MockProcessionSession should behave 
> similarly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to