Updated Design: subflows (markdown)

knolleary 2014-09-26 11:13:44 -07:00
parent 4208e912a3
commit f5546e7ea8
1 changed files with 62 additions and 68 deletions

@ -1,68 +1,62 @@
A subflow is a set of connected nodes that can be easily referenced and 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.
A subflow can be used in one of two modes: (this is tbd. Might just stick with singleton for v1)
1. Singleton : only one copy of the flow exists.
2. Instance : each reference to the subflow is its own copy.
### Creating a subflow
1. User selects some existing nodes.
2. Selects 'convert to subflow' option.
4. Dialog opens to name the subflow.
3. Nodes are removed from workspace and replaced by a subflow node.
4. Subflow node 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
### Editing a subflow
1. Double click subflow node.
2. Opens in closeable tab containing the flow.
**Questions:**
* how to rename the flow? Via subflow sidebar tab?
* how to pick singleton/instance mode?
### Delete subflow
1. Open a subflow sidebar tab that lists all subflows with usage count (cf config node tab - perhaps combine them...?)
2. ...
## Definition
A subflow node has the following properties:
* `type` : `subflow`
* `id`
* `name`
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`
* something to identify mode... if we have modes.
It inherits the `name` of the parent subflow.
**Questions:**
* how does an instance node identify its parent?
* type=subflow:'parent-id'
* type=something other than subflow and parent=<parent-id>
A subflow is a set of connected nodes that can be easily referenced and 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.
A subflow can be used in one of two modes: (this is tbd. Might just stick with singleton for v1)
1. Singleton : only one copy of the flow exists.
2. Instance : each reference to the subflow is its own copy.
### Creating a subflow
1. User selects some existing nodes.
2. Selects 'convert to subflow' option.
3. Nodes are removed from workspace and replaced by a subflow node.
4. 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
### Editing a subflow
1. Double click subflow node.
2. Opens in closeable tab containing the flow.
3. Tab toolbar includes options to name.
**Questions:**
* how to rename the flow? Via subflow sidebar tab?
* how to pick singleton/instance mode?
### Delete subflow
1. Open a subflow sidebar tab that lists all subflows with usage count (cf config node tab - perhaps combine them...?)
2. ...
## Definition
A subflow node has the following properties:
* `type` : `subflow`
* `id`
* `name`
* `in` - the id of the internal node that provides the flow's input port.
* `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`
* `id`
* `singleton` : true/false
* `name` - if singleton, inherits from parent subflow