Josh McCullough created NIFI-11121:
--------------------------------------

             Summary: If/Else/Switch processor
                 Key: NIFI-11121
                 URL: https://issues.apache.org/jira/browse/NIFI-11121
             Project: Apache NiFi
          Issue Type: Improvement
            Reporter: Josh McCullough


I'm a new user but I've already found it difficult to perform some logical 
operations e.g. "if X then Y else Z" or a switch option. I'm not sure if it's 
easy or hard to implement but let's consider a "switch" processor, here's how I 
think it would work...

{code}
... -- <some relationship> --> [Switch] -- <relationship1> --> [next processor]
                                 | | \---- <relationship2> --> [next processor]
                                 | \------ ...
                                 \-------- <relationshipN> --> [next processor]
{code}

In the properties for this process you could add parameters for each "case":

* Param Name: {{color is red}}
* Param Value:  {{${colorAttr.equals('red')}}

And additional cases for green/blue/etc. Which ever case results in `true` is 
the one that's chosen to follow. So the outgoing relationships would be: `color 
red`, `color green`, `color blue`.

Each case, when followed, would pass the incoming FlowFile along to the related 
relationship.

I realize this would require the ability to have dynamic / non-static 
relationships defined for a processor -- not sure if this functionality already 
exists?




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to