-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(capella2polarion): Add jinja descriptions for
LogicalComponent
…
… and `ComponentExchange`
- Loading branch information
Showing
3 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{# | ||
Copyright DB InfraGO AG and contributors | ||
SPDX-License-Identifier: Apache-2.0 | ||
#} | ||
|
||
{% from 'common_macros.html.j2' import linked_name, description %} | ||
{% from 'polarion_props.j2' import table_attributes, th_attributes, td_attributes %} | ||
|
||
{% macro describe_exchange(object) %} | ||
{%- set source_function = object.source.owner -%} | ||
{%- set target_function = object.target.owner -%} | ||
{%- set source = source_function.owner -%} | ||
{%- set target = target_function.owner -%} | ||
The {{ source | link_work_item }} shall provide {{ object | link_work_item }} to {{ target | link_work_item }} so that the {{ target | link_work_item }} could {{ target_function | link_work_item }}. | ||
{% endmacro %} | ||
|
||
<h1>Logical Interface {{ object.name }}</h1> | ||
<h2>Interface Partners</h2> | ||
<p>This logical interface connects between {{ object.source.owner | link_work_item}} and {{ object.target.owner | link_work_item}}.</p> | ||
<p>The need for the interface is explained and requirements are provided so that the interface partners could find an appropriate interface definition (solution).</p> | ||
<h2>Enabled interactions</h2> | ||
<p>The figure below provides an overview of the behaviors that depend on this interface:</p> | ||
{{ object.context_diagram.as_svg | safe }} | ||
<p>This interface enables the following interactions:</p> | ||
<table {{table_attributes}}> | ||
<thead> | ||
<tr> | ||
<th {{th_attributes}}>ID</th> | ||
<th {{th_attributes}}>Interaction description</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for exchange in object.allocated_functional_exchanges %} | ||
<tr> | ||
<td {{td_attributes}}>{{ exchange | link_work_item }}</td> | ||
<td {{td_attributes}}> | ||
{{ describe_exchange(exchange) | safe }} | ||
{% if exchange.exchange_items | length > 1 %} | ||
<p>{{ exchange.name }} is further specified via the following Exchange Items:</p> | ||
<ul> | ||
{% for item in exchange.exchange_items %} | ||
<li>{{ item | link_work_item }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% elif exchange.exchange_items %} | ||
<p>This interaction is further specified via {{ exchange.exchange_items[0] | link_work_item}}.</p> | ||
{% endif %} | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{# | ||
Copyright DB InfraGO AG and contributors | ||
SPDX-License-Identifier: Apache-2.0 | ||
#} | ||
|
||
{% from 'common_macros.html.j2' import show_other_attributes, description %} | ||
|
||
<h1>{{ object.name }}</h1> | ||
|
||
{{ description(object) | safe }} | ||
|
||
<p> | ||
The figure below provides an overview of the logical subsystem and external entities that either require the functionality of <b>{{ object.name }}</b> (expect outputs) or enable it (provide inputs). The figure also identifies the interfaces between the subsystem and its environment. | ||
</p> | ||
|
||
{{- object.context_diagram.as_svg | safe -}} | ||
|
||
|
||
{%- for fnc in object.allocated_functions -%} | ||
{%- if loop.first -%} | ||
<h1>Allocated functions</h1> | ||
{%- endif -%} | ||
|
||
<h2>{{ fnc.name }}</h2> | ||
{{ description(fnc) | safe }} | ||
{%- endfor -%} |