Subassemblies
A subassembly is a re-usable assembly diagram that has defined input and output.
Subassemblies can be dragged from the catalog as nestable blocks and placed within other assembly diagrams.
Subassemblies promote the re-use of functionality and reduce the complexity of wiring diagrams:
Subassemblies appear with a blue window in the editor, to help them stand out from individual modules.
Subassemblies can also contain other nested subassemblies.
All subassemblies must contain a Subassembly Input module and a Subassembly Output module, which define the entry point and input data into the subassembly, and the output data from the subassembly:
When an outer assembly invokes the subassembly, any data streams wired into the subassembly are emitted from the Subassembly Input module.
The Subassembly Input module can be configured with test data in the form of one or more XML Data Streams, or a text or number value.
The test data is only emitted when the subassembly is executed within the editor.
The Subassembly Output module emits whatever is wired into it, which can be one or more data streams, or a text or number value.
Subassemblies are created when an assembly having both a Subassembly Input module and a Subassembly Output module is saved into the Subassemblies category:
The Dropdown Parameter (Populated) module is used when configuring triggers or actions. A dropdown list is populated with the contents emitted by a nested subassembly:
The nested subassembly can perform any needed logic, such as fetching data from an API.
The subassembly must use a specialized version of the Subassembly Output module, called Subassembly Output (Dropdown Parameter):
This specialized module allows the labels that appear within the dropdown to be specified, along with values for each label item.
Subassemblies can be parameterized. Subassembly parameters make it possible to customize your subassembly's behavior based on configured values.
The Parameter modules contained in the module catalog under the Input – Parameters category are used to define subassembly parameters:
In the example below, the Flickr URL subassembly has a parameter "tags" defined:
The "tags" parameter is wired to the Flickr URL such that Flickr will return photos matching the search criteria contained within the "tags" parameter value.
When the Flickr URL subassembly is used, the "tags" parameter becomes exposed in the subassembly window as a configurable field value:
Now, the "tags" parameter can be configured without having to edit the Flickr URL subassembly.
Various types of Parameter modules are available, including checkboxes, sliders, and more. Each parameter value will appear using the UI control specified by the type of Parameter module used.
If one or more parameters are defined and the subassembly is referenced by another assembly, then those existing parameters cannot be removed or altered in order to preserve referential integrity.