Using a Subflow as a Sink - 23.1

Spectrum Dataflow Designer Guide

Version
23.1
Language
English
Product name
Spectrum Technology Platform
Title
Spectrum Dataflow Designer Guide
Copyright
2024
First publish date
2007
Last updated
2024-10-11
Published on
2024-10-11T22:55:47.128293

You can use a subflow as the last stage in a flow to write data to a file or database and even perform some processing on the data before writing the data to the output destination. You can create a subflow as simple as a single sink stage that is configured in a way that you want to reuse in multiple flows, or you could create a more complex subflow that processes data in some way before writing it to the output destination.

  1. In Spectrum Enterprise Designer, click File > New > Dataflow > Subflow.
  2. Drag an Input stage from the palette to the canvas.
  3. Double-click the Input stage and add the fields that the subflow will receive from the flow in which it is used.
  4. After configuring the Input stage, add additional stages as needed to perform the post-processing that you want.
  5. At the end of the subflow, add the appropriate sink.

    For example, if you created a subflow that uses a Transformer stage to trim white space and standardize the casing of a field then writes it to a database, you would have a subflow that looks like this:

  6. Select File > Save and save the subflow.
  7. Select File > Expose to make the subflow available to include in flows.
  8. In the flow where you want to include the subflow, drag the subflow from the palette to the canvas and connect it to the last stage in the flow.
    Note: Since the subflow contains a sink stage rather than an Output stage, the subflow icon only has an input port. It can only be used as a sink in the flow.

    The parent flow now uses the subflow you created as a sink. For example, if you created a subflow named "Transform and Write to DB" and you add the subflow and connect it to a Global Geocode stage, your flow would look like this: