Forum Discussion

wpenfold's avatar
wpenfold
Contributor
5 years ago

Router not routing?

I have a simple pipeline where I’m using Router to decide if an oracle procedure should be called. Even if I just set the router expression to false for the output0 view, the output0 snap (the oracle procedure), is still being executed. I’ve tried resetting my workspace. Is this a bug?

10 Replies

  • skatpally's avatar
    skatpally
    Former Employee

    I can’t replicate it. Can you please add more details on your router expression. Thanks.

    • wpenfold's avatar
      wpenfold
      Contributor

      I’m using false for output0 and true for output1

  • It appears to be the combination of the router and a gate snap. The gate snap, and the snaps after it, are being executed even if the router condition is not met.

    • del's avatar
      del
      Contributor III

      @wpenfold, Per the gate snap documentation the gate snap will always produce an output document, even if input is empty. For these types of situations, it suggests following it with a filter snap with the expression !$.isEmpty().

      • wpenfold's avatar
        wpenfold
        Contributor

        Thanks, I’ll do that…any insight into why the gate snap is being executed if the router condition is not met?

  • It would help to see more details about your pipeline. Does your Oracle snap actually need input? If not, the fact that no data will be routed to it won’t prevent it from executing.