sphinx-needs
sphinx-needs copied to clipboard
Chaining of needflow
Use case: Possibility to chain different type of diagrams that will create a model like view to the user using need flow.
Ex:
- There is a component with 2 external interfaces and 1 internal interface – component and interfaces are realized using needuml, each has its own need object.
- generate an interface diagram using needflow– This shows relationship between the comp and the external interface
- When we click on an element component in the need flow diagram, it should end up on another flow diagram – which now shows only the internal interfaces and the component.
- When we click on any individual interfaces, It will end up in the actual element (Component or interface)
Step 1, 2 and 4 are working right of the box, what does not work is Step 3.
For Step 3, this issue is created to check if we can reference a needflow in another needfow.
Thanks for the feature request.
I like the idea, but maybe have found 1-2 problems when working like this.
In my understanding, clicking on a component shall open a component view including internal interfaces. When clicking on an interface, the interface need shall be opened.
How many need objects do you have, 4? 1 component, 1 internal interface, 2 external interfaces? And needflow is used to bring these need objects together in a single picture.
idea
I see two main challenges:
- Having a specific picture of component + internal_interface (maybe a needflow)
- Being able to reference this specific picture instead of the default view.
Would it be okay to include directly the internal interface in the graphical representation of the component? Something like:
.. interface:: Internal interface
:id: int_1
.. ^same code for external interface ext_! and ext_2
.. component:: My component
:id: comp_1
.. needuml::
:key: interface_view
{{flow('int_1')}}
{{flow('comp_1')}}
comp_1 --> int_1
And then use needuml
for the big picture:
.. needuml::
{% for need in filter("my_arch" in tags) %} # Pseudo filter
{% if need.type == "component %}
{{uml(need.id, 'interface_view')}}
{% else %}
{{uml(need.id)}} # standard view
{% endif %}
{% endfor %}
The above needuml
-jinja code can maybe get simplified by providing a ready-to-use jinja-function or some other parameters.
However, we first need to figure out what the perfect rst-code should look like, to get your use case done :)