Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-11121

If/Else/Switch processor

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      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...

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

      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?

      Attachments

        Activity

          People

            Unassigned Unassigned
            joshm Josh McCullough
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: