forked from node-red/node-red
-
Notifications
You must be signed in to change notification settings - Fork 0
Design: subflows
knolleary edited this page Oct 28, 2014
·
8 revisions
A subflow is a set of connected nodes that can be easily reused within a larger flow.
A subflow is represented as a single node in the workspace which can be opened up in a tab to see the underlying flow.
- Selects 'Create subflow' option.
- Creates a new subflow with a default name, added to palette
- Opens the subflow tab
- User selects some existing nodes.
- Selects 'Convert to subflow' option.
- Nodes are removed from workspace and replaced by a subflow node.
- Subflow node given a default name and added to palette
Questions:
- how to automatically identify the input/output ports to map to
- what restrictions should be applied?
- a single, continuous flow of nodes - aside from comment nodes
- only one 'left most' node
- what about subflows with no left most node? Would there be any way to override properties of a contained node? For example, consider a subflow containing an mqtt sub and deserialiser pair where modifying the topic of the mqtt subscriber would be useful.
- Double click subflow node.
- Opens the edit-node dialog for the instance of the subflow
- Click the 'edit subflow' option in the dialog opens a closeable tab containing the flow.
- Tab toolbar includes but to open subflow edit dialog (also accessed by dblclicking on tab, or any input/output node in the flow)
- Open subflow edit dialog
- Click delete
A subflow node has the following properties:
-
type:subflow idname-
in- an array identifying the internal nodes that are mapped to the flow inputs. It will have zero or one elements. -
out- an array identifying the internal nodes and their output ports that are mapped to the flows outputs. Elements are objects of the form:{id:ID, port:PORT}.
A node that is part of a subflow has their z property set to the id of the subflow.
An instance of a subflow has the following properties:
-
type:subflow:ID idname