{% for package in context.packages %} {% assign package_name = package.name | downcase | replace: “:”, “” | replace: “ ”, “_” %} {% if additional_context.before and additional_context.before.size > 0 %} {% for before in additional_context.before %} {{ before.text }} {% endfor %} {% endif %} {% capture equalsigns %}{% for count in (1..depth) %}={% endfor %}{% endcapture %}{{equalsigns}} {{ package.name }}

{% assign before_package_key = 'before;' | append: package.name %} {% if additional_context and additional_context.size > 0 %} {% for before in additional_context %} {{ before.text }} {% endfor %} {% endif %}

cols=“1a,4a”

|===

h|Description: | {{ package.definition }} h|Parent package: | {{ context.name }} h|Stereotype: | «{{ package.stereotype }}»

|===

{% assign basic_types = package.classes | where: “stereotype”, “BasicType” %} {% assign unions = package.data_types | where: “stereotype”, “Union” %} {% assign code_lists = package.classes | where: “stereotype”, “CodeList” %} {% assign not_classes_length = basic_types.size | plus: code_lists.size %} {% assign not_classes_stereoptypes = 'DataType,BasicType,Enumeration,CodeList' | split: ','%} {{equalsigns}}= Classes

{% unless not_classes_length == package.classes.size %}

{% for klass in package.classes %} {% unless not_classes_stereoptypes contains klass.stereotype %} {% include “packages_data_dictionary_class” %} {% endunless %} {% endfor %} {% else %} None {% endunless %}

{{equalsigns}}= Basic types

{% if basic_types.size > 0 %}

{% include “packages_data_dictionary_classes”, classes: basic_types %} {% else %} None {% endif %}

{{equalsigns}}= Unions

{% if unions.size > 0 %}

{% include “packages_data_dictionary_classes”, classes: unions %} {% else %} None {% endif %}

{{equalsigns}}= Code lists

{% if code_lists.size > 0 %}

{% include “packages_data_dictionary_classes”, classes: code_lists %} {% else %} None {% endif %}

{{equalsigns}}= Data types

{% assign non_unions = package.data_types | where: “stereotype”, “DataType” %} {% if non_unions.size > 0 %}

{% for data_type in non_unions %} {% capture generalizations %}{% assign inheritance = data_type.associations | where: “member_end_type”, “inheritance” %}{% for assoc in inheritance %}{{ assoc.member_end }} {% endfor %}{% endcapture %}

[{{ data_type.name }}-section]
cols=“1a”

|=== |*{ data_type.name }}* |[cols=“1,4”] !=== !Definition: ! {{ data_type.definition }} !Subclass of: ! {% if generalizations.size > 4 %}{{ generalizations }}{% else %}None{% endif %} !Stereotype: ! «{{ data_type.stereotype }}» !=== {% if data_type.associations.size > 0 %} {% capture rendered_associations %} {% for assoc in data_type.associations %} {% if assoc.member_end_attribute_name.size > 0 %} {% capture cardinality %}{% if assoc.member_end_cardinality.min == ‘C’ %}[0..{{ assoc.member_end_cardinality.max }}]{% elsif assoc.member_end_cardinality.min == ‘M’ and assoc.member_end_cardinality.max == ‘1’ %{% else %}[{{ assoc.member_end_cardinality.max }}]{% endif %}{% endcapture %} ! {{ assoc.member_end_attribute_name }} !<<{{assoc.member_end}}-section,{{assoc.member_end}}>> {{ cardinality }} ! {{ assoc.definition }} {% endif %} {% endfor %} {% endcapture %} {% if rendered_associations.size > 100 %} |

cols=“15,20,60”,options=“header”

!=== ! Role name !Target class and multiplicity !Definition {{ rendered_associations }} !=== {% endif %} {% endif %} {% if data_type.attributes.size > 0 %} |

cols=“15,20,60”,options=“header”

!=== ! Attribute ! Value type and multiplicity ! Definition % for attr in data_type.attributes %} {% capture cardinality %}{% if attr.cardinality.min == ‘C’ %}[0..{{ attr.cardinality.max }}]{% elsif assoc.member_end_cardinality.min == ‘M’ and assoc.member_end_cardinality.max == ‘1’ %{% else %}[{{ attr.cardinality.max }}]{% endif %}{% endcapture %} ! {{ attr.name }} !<<{{ attr.type }}-section,{{ attr.type }}>> {{ cardinality }} !{{ attr.definition }} {% endfor %} !=== | NOTE: Unless otherwise specified, all attributes and role names have the stereotype «Property». {% endif %} |===

{% endfor %} {% else %} None {% endif %}

{{equalsigns}}= Enumerations

{% if package.enums.size > 0 %}

{% for enum in package.enums %}

[{{ enum.name }}-section]
cols=“1a”

|=== |*{{ enum.name }}* |

cols=“1,4”

!=== !Definition: ! {{ enum.definition }} !Stereotype: ! «Enumeration» !=== {% if enum.values.size > 0 %} |

cols=“1,4”,options=“header”

!=== ! Literal value !Definition

{% for val in enum.values %} ! {{ val.name }} !{{ val.definition }} {% endfor %} !=== {% endif %} |===

{% endfor %} {% else %} None {% endif %}

{% if additional_context.include_block and additional_context.include_block.size > 0 %} {% for block in additional_context.include_block %} {% capture block_filename %}{{ block.base_path }}{{ package_name }}{% endcapture %} {% capture block_content %}{% include block_filename %}{% endcapture %} {% unless block_content contains “Liquid error” %} {% if block.text %} {{ block.text }} {% endif %} {{ block_content }} {% endunless %} {% endfor %} {% endif %}

{% assign include_block_package_key = 'include_block;' | append: package.name %} {% if additional_context and additional_context.size > 0 %} {% for block in additional_context %} {% capture block_filename %}{{ block.base_path }}{{ package_name }}{% endcapture %} {% capture block_content %}{% include block_filename %}{% endcapture %} {% unless block_content contains “Liquid error” %} {% if block.text %} {{ block.text }} {% endif %} {{ block_content }} {% endunless %} {% endfor %} {% endif %}

{% assign after_package_key = 'after;' | append: package.name %} {% if additional_context %} {{equalsigns}}= Additional information {% for after in additional_context %} {{ after.text }} {% endfor %} {% endif %} {% if package.packages.size > 0 and render_nested_packages %} {% assign nested_depth = depth | plus: 1 %}{% include “packages_data_dictionary”, depth: nested_depth, context: package %} {% endif %} {% endfor %}

{% if additional_context.after and additional_context.after.size > 0 %} {% for after in additional_context.after %} {{ after.text }} {% endfor %} {% endif %}