needarch

needarch behaves exactly like needuml, but only works inside a need. It provides also additional exclusive jinja functions need() and import(need_links_option_name).

Example 1

.. req:: Requirement arch
   :id: req_arch_001

   .. needarch::
      :scale: 50
      :align: center

      Alice -> Bob: Hi Bob
      Bob --> Alice: hi Alice
Requirement: Requirement arch req_arch_001
links incoming: req_arch_004
is blocked by: req_arch_004
is checked by: test_arch_001

@startuml

Alice -> Bob: Hi Bob
Bob --> Alice: hi Alice
@enduml

Jinja context

The following Jinja functions are only available for needarch.

need()

Added in version 1.0.3.

The need() function provides you the need information the needarch is embedded in.

Example 2

.. req:: Req Arch four
   :id: req_arch_004
   :status: draft
   :blocks: req_arch_001

   content.

   .. needarch::
      :scale: 50
      :align: center

      class "{{need().title}}" {
      {{need().status}}
      {% for e in need().blocks %}{{e}}
      {% endfor %}
      }
Requirement: Req Arch four req_arch_004
status: draft
links outgoing: req_arch_001
blocks: req_arch_001

content.

@startuml

class "Req Arch four" {
draft
req_arch_001

}
@enduml

NeedArch Loop Example

Added in version 1.0.3.

NeedArch can detect include loops (uml(‘1’) -> uml(‘2’) -> uml(‘3’) -> uml(‘1’) and can avoid to include an element twice. Maybe this is not always the use case you have, if so please create an issue and mention this chapter. The algorithm does detect different parameter sets and does import uml() calls with different parameter to the same need.

Example 4

.. comp:: COMP_T_001
   :id: COMP_T_001

   .. needarch::

      {{flow(need().id)}}
      {% if variant == "A" %}
      {{uml('COMP_T_003', variant="A")}}
      usecase {{need().id}}_usecase
      {% else %}
      {{uml('COMP_T_003')}}
      {{uml('COMP_T_003', variant="A")}}
      {% endif %}

.. comp:: COMP_T_002
   :id: COMP_T_002

   .. needarch::

      {{flow(need().id)}}
      {% if variant == "A" %}
      {{uml('COMP_T_001', variant="A")}}
      usecase {{need().id}}_usecase
      {% else %}
      {{uml('COMP_T_001')}}
      {% endif %}

.. comp:: COMP_T_003
   :id: COMP_T_003

   .. needarch::

      {{flow(need().id)}}
      {% if variant == "A" %}
      {{uml('COMP_T_002', variant="A")}}
      usecase {{need().id}}_usecase
      {% else %}
      {{uml('COMP_T_002')}}
      {% endif %}
Component: COMP_T_001 COMP_T_001

@startuml

card "<size:12>Component</size>\n**COMP_T_001**\n<size:10>COMP_T_001</size>" as COMP_T_001 [[../directives/needarch.html#COMP_T_001]] #BFD8D2

card "<size:12>Component</size>\n**COMP_T_003**\n<size:10>COMP_T_003</size>" as COMP_T_003 [[../directives/needarch.html#COMP_T_003]] #BFD8D2

card "<size:12>Component</size>\n**COMP_T_002**\n<size:10>COMP_T_002</size>" as COMP_T_002 [[../directives/needarch.html#COMP_T_002]] #BFD8D2











usecase COMP_T_001_usecase

usecase COMP_T_002_usecase

usecase COMP_T_003_usecase






@enduml

Component: COMP_T_002 COMP_T_002

@startuml

card "<size:12>Component</size>\n**COMP_T_002**\n<size:10>COMP_T_002</size>" as COMP_T_002 [[../directives/needarch.html#COMP_T_002]] #BFD8D2

card "<size:12>Component</size>\n**COMP_T_001**\n<size:10>COMP_T_001</size>" as COMP_T_001 [[../directives/needarch.html#COMP_T_001]] #BFD8D2

card "<size:12>Component</size>\n**COMP_T_003**\n<size:10>COMP_T_003</size>" as COMP_T_003 [[../directives/needarch.html#COMP_T_003]] #BFD8D2













usecase COMP_T_001_usecase

usecase COMP_T_002_usecase

usecase COMP_T_003_usecase



@enduml

Component: COMP_T_003 COMP_T_003

@startuml

card "<size:12>Component</size>\n**COMP_T_003**\n<size:10>COMP_T_003</size>" as COMP_T_003 [[../directives/needarch.html#COMP_T_003]] #BFD8D2

card "<size:12>Component</size>\n**COMP_T_002**\n<size:10>COMP_T_002</size>" as COMP_T_002 [[../directives/needarch.html#COMP_T_002]] #BFD8D2

card "<size:12>Component</size>\n**COMP_T_001**\n<size:10>COMP_T_001</size>" as COMP_T_001 [[../directives/needarch.html#COMP_T_001]] #BFD8D2












usecase COMP_T_001_usecase

usecase COMP_T_002_usecase

usecase COMP_T_003_usecase




@enduml