Forum Discussion

acesario's avatar
acesario
Contributor II
6 years ago
Solved

Why do some snaps execute, when they are not in the current path?

I have a pipleine which uses routers successfully, but notice that there are a few snaps which execute downstream from a router which does not run. Even if I disconnect the snaps, I see a GATE snap execute, and gives an error (unless I filter for !=[ ] after the gate snap). Atached is a picture of my snap: the green flow follows the routing, the blue line flow does not execute, but the highlighted Gate snap executes, with the following json, containing empty arrays for each of the gate inputs:
[

{
“Person”:[
]
“Section”:[
]}]

  • Hi @acesario

    Do you have the ‘Ignore empty stream’ property set in your Excel Formatter like this:

7 Replies

  • Hi @acesario,

    The Gate Snap is designed to always have a single output document produced regardless of the number of input documents received.

    • acesario's avatar
      acesario
      Contributor II

      Interesting. So you have to filter it to prevent an error? Works, just unexpected.
      THANKS for the quick answer!

      • cjhoward18's avatar
        cjhoward18
        Employee

        What is the error you are seeing?

        There are use cases in which the snap was designed for where some snaps may not produce an output document for certain cases. However, when the snap is complete the execution can continue to flow to the rest of the pipeline using the Gate snap directly after a snap that completed, but may produce no output document. This is to ensure an output document is produced to drive the rest of the pipeline execution no matter what once the upstream snaps have completed.

  • acesario's avatar
    acesario
    Contributor II

    @cjhoward18 I’m seeing this again where a pipeline executes a file writer step when a) It is not in the flow. and b) Write empty file is false.

    I feel like this should not be executing and writing an excel file after a router step, and where the file setting does not include ‘write empty file’.

    The behavior is contrary to the setting and we cannot have an empty excel file written in this case. Would Snaplogic support be willing to look at this as a bug?

    • cjhoward18's avatar
      cjhoward18
      Employee

      Hi @acesario

      Do you have the ‘Ignore empty stream’ property set in your Excel Formatter like this:

  • acesario's avatar
    acesario
    Contributor II

    I do now!

    Thanks for the solution @cjhoward18 , I didnt know those options existed, but they resolved this for me.