diff --git a/capella2polarion_config.yaml b/capella2polarion_config.yaml index 6bbc020..97c98c5 100644 --- a/capella2polarion_config.yaml +++ b/capella2polarion_config.yaml @@ -80,7 +80,13 @@ la: LogicalComponent: - links: - allocated_functions - serializer: add_context_diagram + serializer: + jinja_as_description: + template_folder: jinja/element_templates + template_path: logical_component.html.j2 + add_context_diagram: + filters: + - SHOW_EX_ITEMS - is_actor: true polarion_type: logicalActor - is_actor: false @@ -106,7 +112,13 @@ la: Exchange Items: exchange_items - realized_functions ComponentExchange: - serializer: add_context_diagram + serializer: + jinja_as_description: + template_folder: jinja/element_templates + template_path: component_exchange.html.j2 + add_context_diagram: + filters: + - SHOW_EX_ITEMS links: - allocated_functional_exchanges FunctionalExchange: diff --git a/jinja/element_templates/component_exchange.html.j2 b/jinja/element_templates/component_exchange.html.j2 new file mode 100644 index 0000000..3018fc5 --- /dev/null +++ b/jinja/element_templates/component_exchange.html.j2 @@ -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 %} + +

Logical Interface {{ object.name }}

+

Interface Partners

+

This logical interface connects between {{ object.source.owner | link_work_item}} and {{ object.target.owner | link_work_item}}.

+

The need for the interface is explained and requirements are provided so that the interface partners could find an appropriate interface definition (solution).

+

Enabled interactions

+

The figure below provides an overview of the behaviors that depend on this interface:

+{{ object.context_diagram.as_svg | safe }} +

This interface enables the following interactions:

+ + + + + + + + + {% for exchange in object.allocated_functional_exchanges %} + + + + + {% endfor %} + +
IDInteraction description
{{ exchange | link_work_item }} + {{ describe_exchange(exchange) | safe }} + {% if exchange.exchange_items |Ā length > 1 %} +

{{ exchange.name }} is further specified via the following Exchange Items:

+
    + {% for item in exchange.exchange_items %} +
  • {{ item | link_work_item }}
  • + {% endfor %} +
+ {% elif exchange.exchange_items %} +

This interaction is further specified via {{ exchange.exchange_items[0] | link_work_item}}.

+ {% endif %} +
+ diff --git a/jinja/element_templates/logical_component.html.j2 b/jinja/element_templates/logical_component.html.j2 new file mode 100644 index 0000000..3c8fd12 --- /dev/null +++ b/jinja/element_templates/logical_component.html.j2 @@ -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 %} + +

{{ object.name }}

+ +{{ description(object) | safe }} + +

+The figure below provides an overview of the logical subsystem and external entities that either require the functionality of {{ object.name }} (expect outputs) or enable it (provide inputs). The figure also identifies the interfaces between the subsystem and its environment. +

+ +{{- object.context_diagram.as_svg | safe -}} + + +{%- for fnc in object.allocated_functions -%} + {%- if loop.first -%} +

Allocated functions

+ {%- endif -%} + +

{{ fnc.name }}

+ {{ description(fnc) | safe }} +{%- endfor -%}