How components work

Components are the "doing part" of workflows. They represent operations which are executed on the incoming data. For example, in the workflow diagram below, the main operation is carried out by the Python Expression component, which is executed on incoming data (Input_1) to create an output (Output_1).

There are some common configuration elements shared by all components. These include:

  1. A checkbox option labelledOutput data should include input data

  2. A checkbox option labelled Use top connector input for input connectors only

  3. A section named Add ATTRIBUTES and ITEMS as initial data which allows static data to be defined for the component. Attributes are single-valued named data items that can be any type. Lists are comma-separated strings. A preselected list of files or other items can also be set as part of the component’s input. Any number of files or attributes can be added and both become part of the input data for the component. This data is applied to the component before other inputs so that other inputs will override these values if the names match (type is ignored).

  4. An Add LOOP section (see Looping and Data below)

  5. A Write a LOG MESSAGE when this component runs section. The option will create a log entry of the selected level, which will appear in the Workbench Client Console and the Workbench Client log file. This field will expand and embed attributes using the $(attributeName) syntax.

Other configuration elements will depend on the type of component selected. For more information on how to configure a particular component, go to Workflow Component Types and navigate to the appropriate component.

Looping and data

The Add LOOP section is used when you want to execute an operation more than once. For example, looping can be used to offset each value in a list by 5.

 

There are five fields to configure when adding loops:

  • Loop type — How often do we want the operation to execute? In the example above, we only want the operation to execute once on each item in the list.

  • List — Does the list come from a named attribute or built-in list? In the example above, the list is provided via a named attribute called Input_1. If the Add ATTRIBUTES and ITEMS as initial data section is used to add a list, then select the built-in list option.

  • Attribute name — What is the name of the attribute? In the example above, the attribute name is Input_1.

  • Iterator name — What is the name of the iterator? The standard iterator name is iterator. The iterator name can be referenced in other components such as the Python Expression component.

  • Loop over — Do we want loop execution for only the current component or subsequent components? In the example above, the latter option is chosen as we want to use the timer for each list item.

Next topic: Getting Started - Building on Key Concepts - Writing a more complex workflow - component configuration