Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this article

Table of Contents
maxLevel2
absoluteUrltrue

Overview

You can use this Snap to consolidate all documents from upstream Snaps into a single output document. Based on the Snap's configuration, each input stream displays the count of documents, all records, first record or the final record.

Note

This Snap does not complete executing until the execution of all upstream Snaps is done.

Image Modified


Note

Unless the Ignore empty stream checkbox is selected, the Gate Snap always produces an output document, regardless of how many or if no input documents are received. In some Pipeline designs, this functionality can trigger an error message stating, mapped variables are missing, during validation. This error typically occurs when a downstream Snap expects a field based off an output document from the Gate Snap that is empty.

To prevent the error from occurring, you can limit empty documents produced by the Gate Snap by inserting a Filter Snap after it with the following expression in the Filter Expression
required
field:

!$.isEmpty()

When you run the Pipeline after adding the Filter Snap with this expression, the Pipeline validates and executes successfully, and the error no longer occurs.

...

Field NameField TypeDescription
LabelString

Specify a name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your Pipeline.

Default Value: Gate
Example: Ensure Complete Execution

Ignore empty streamCheckbox

Select this checkbox to enable the Snap to ignore empty streams received at the input view during Pipeline execution. In such a case, the Snap does not produce any output document; else, the Snap writes an empty array to the output document.

Default Value: Deselected
Example: N/A

Output Document Content

Dropdown list

Choose an option to indicate the document count and the specific document to include in the output. This option helps avoid excessive memory consumption. The available options are:

  • All input documents: Waits for all the input documents to include in the output.
  • Document count and first document for each inputIncludes document count and the first document from each input in the output. If an input has no documents, the output is displayed as null for the first document from that input.

  • Document count and final document for each inputIncludes document count and the final document from each input in the output. If an input has no documents, the output is displayed as null for the final document from that input.

Info

Using All input documents option can consume a lot of memory. If your use case does not require all of this data, consider using other options for Output Document Content, which are less memory intensive.

For more information, see this example.

Default ValueAll input documents
ExampleDocument count and first document for each input

Snap ExecutionN/A

Select one of the three modes in which the Snap executes. Available options are:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default Value: Validate & Execute
Example: Execute only

...

  • All input documents
  • Document count and first document for each input

  • Document count and final document for each input

We build three Pipelines to pass data using two Mapper Snaps and empty data from the JSON Generator Snap.

Image Modified


Image Modified

We connect the Gate Snap to the upstream Snaps. We configure the Gate Snap in each Pipeline with each of the options under Output Document Content field as highlighted in the screenshots below. Upon validation, the Snaps yield the respective outputs based on the configuration.



Image Modified

Image Modified

Image Modified

Image Modified

Image Modified

Image Modified

Download this Pipeline.

Downloads

Multiexcerpt include macro
namedownload_instructions
pageOpenAPI

Attachments
patterns*.slp, *.zip

...