Skip to content

Commit

Permalink
feat(capella2polarion): Add LogicalComponent FA template
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger committed Sep 20, 2024
1 parent 0d34cf3 commit aeaffa1
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
31 changes: 31 additions & 0 deletions capella2polarion_document_config.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,37 @@ full_authority:
physical_link: {{ pl.uuid }}
{%- endif -%}
{% endfor %}
- template_directory: jinja/document_templates/logical-architecture
template: logical-component.html.j2
heading_numbering: True
work_item_layouts:
logicalComponent:
fields_at_start:
- id
fields_at_end:
- context_diagram
- allocated_functions
componentExchange:
fields_at_start:
- id
fields_at_end:
- context_diagram
- allocated_functional_exchanges
- exchange_items
class:
show_title: False
fields_at_end:
- tree_view
exchangeItem:
show_title: False
instances:
{%- for cmp in model.search("LogicalComponent") %}
- polarion_space: Logical Component Documents
polarion_name: {{ cmp.uuid }}
polarion_title: "{{ cmp.name | safe }}"
params:
uuid: {{ cmp.uuid }}
{% endfor %}
{# mixed_authority:
- template_directory: jinja/document_templates
heading_numbering: True
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{#
Copyright DB InfraGO AG and contributors
SPDX-License-Identifier: Apache-2.0
#}

{% set table_attributes='class="polarion-Document-table" style="margin: auto;margin-left: 0px;empty-cells: show;border-collapse: collapse;max-width: 1280px;border: 1px solid #CCCCCC;"' %}
{% set th_attributes='style="height: 12px;text-align: left;vertical-align: top;font-weight: bold;background-color: #F0F0F0;border: 1px solid #CCCCCC;padding: 5px;"' %}
{% set td_attributes='style="height: 12px;text-align: left;vertical-align: top;line-height: 18px;border: 1px solid #CCCCCC;padding: 5px;"' %}

{% macro render_content(component, model, session) %}
{{ heading(2, component.name, session)}}
{{ heading(3, "Logical Component Context", session)}}
<workitem id="interface_partners">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.</workitem>
{{ insert_work_item(component, session) }}
{{ heading(3, "Logical interface partners of " + component.name, session) }}

{%- set lexcs = [] -%}
{%- for port in component.ports -%}
{%- for lexc in port.exchanges -%}
{%- set _ = lexcs.append([lexc, lexc.source.owner if lexc.source.owner != component else lexc.target.owner]) -%}
{%- endfor -%}
{%- endfor -%}

{%- for partner_cmp_name in lexcs | map(attribute=1) | map(attribute="name") | unique -%}
{%- set partner = lexcs | map(attribute=1) | selectattr("name", "equalto", partner_cmp_name) | first -%}
{{- heading(4, partner.name, session) -}}
{{- insert_work_item(partner, session) -}}

{%- set spp = lexcs | map(attribute=0) | selectattr("source.owner", "equalto", partner) | list -%}
{%- set tpp = lexcs | map(attribute=0) | selectattr("target.owner", "equalto", partner) | list -%}
{%- for lexc in (spp + tpp) -%}
{{- heading(5, "Logical interface " + lexc.name, session) -}}
{{- insert_work_item(lexc, session) -}}
{%- endfor -%}
{%- endfor -%}
{% endmacro %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{#
Copyright DB InfraGO AG and contributors
SPDX-License-Identifier: Apache-2.0
#}
{% from 'logical-common.html.j2' import render_content %}

{% set component = model.by_uuid(uuid) %}
{{ heading(1, component.name, session) }}
{{ heading(2, "Table of Content", session) }}
<div id="polarion_wiki macro name=toc"></div>
<div id="polarion_wiki macro name=page_break" contentEditable="false" data-is-landscape="false"></div>
{{ heading(2, "Introduction", session)}}
<p>
This Document focuses on the interfaces connecting the logical
component and its allocated functions. It outlines how inputs and outputs
flow between these functions through functional exchanges, allocated
to their interface. Additionally, the document covers exchanged items that are
allocated to both the interfaces and the functional exchanges, describing the
data interactions within the system.
</p>
{{ render_content(component, model, session) }}

0 comments on commit aeaffa1

Please sign in to comment.