Forum Discussion

kokimura's avatar
kokimura
New Contributor
5 years ago
Solved

How to stop snap execution

I have a pipeline which along the way checks for a presence of a particular value. If there is no value it should exit without errors but not execute the the rest of the pipelines. How do I achive that?
For example:

  1. MySQL Snap reads a value from somewhere → 2. MySQL Snap uses the value and writes it to another table
    Imagine that the first snap’s read returns null i.e. there is not value. How can I check that and make the pipeline stop without an error and not execute the second snap?
    I tried with Filter and Router but that did not work.
    I tried with Router and Exit but the Exit throws an error and does not stop the second snap from executing either.
    Thanks!
  • Hi @kokimura,

    Perhaps you could use the object.hasPath(field) function to check for the existence of a field in a Filter Snap, in order to stop the invalid documents from propagating further down the pipeline and cause errors in the downstream snaps.

    BR,
    Dimitri

2 Replies

  • Hi @kokimura,

    Perhaps you could use the object.hasPath(field) function to check for the existence of a field in a Filter Snap, in order to stop the invalid documents from propagating further down the pipeline and cause errors in the downstream snaps.

    BR,
    Dimitri