6.2.5.6. Architecture-ExtractFfIArchitecture

Extract Freedom from Interference Architecture Mapping from Annotations in existing Architecture and Mapping views

Required inputs: RFG

Uses an existing view model_view_name consisting of safety-related partitions (e.g. ASIL_A, QM, ...) and dependencies among them to check compliance with the dependencies. This rule derives mapping views for that partition architecture. The check for compliance needs to be manually configured by an instance of the rule Architecture-ArchitectureCheck to be executed after this rule. The following configurations are possible:

  • verify compliance of the source code
  • verify compliance of existing architecture view

To determine the correct partition for source code or architecture model nodes, an existing architecture view architecture_view_name shall be annotated with attributes (stereotypes, toggles, or string-attributes) that identify the partition to which an architecture node belongs to. Based on a pre-existing mapping view, the partition of the source code can be derived from the architecture model.

Based on the original architecture and original mapping, a new mapping is derived into view safety_mapping_view_name. Given the new safety architecture, safety mapping and the original base and hierarchy views, a new architecture check can be executed to check compliance with the required FfI-properties.

Please schedule an instance of the rule Architecture-ArchitectureCheck after this rule to perform the actual check. This should be configured using the following equalities to this rule's options:

Possible Messages

This rule has no predefined messages.

Options

export_warnings

export_warnings : bool = True

Export output messages to the analysis database.
 

loglevel

loglevel : LogLevel = 'WARNING'

Logging mode. WARNING only outputs errors and warnings, INFO additionally prints info messages, DEBUG additionally outputs info and debug messages.
 

safety_annotations_in_architecture

safety_annotations_in_architecture

Type: dict[str, SafetyNameMappingConfig]

Default:

{
   'ASIL_':    bauhaus.rules.axivion.architecture.ffi_architecture.SafetyNameMappingConfig(
      attribute_kind='stereotype',
      separator=None,
      terminator=None
   ),
   'QM':    bauhaus.rules.axivion.architecture.ffi_architecture.SafetyNameMappingConfig(
      attribute_kind='stereotype',
      separator=None,
      terminator=None
   ),
   'UML:taggedValue:ASIL':    bauhaus.rules.axivion.architecture.ffi_architecture.SafetyNameMappingConfig(
      attribute_kind='string_attribute',
      separator=None,
      terminator='#'
   )
}

Mapping of text keys to description how to derive a safety partition name from existing annotations in the nodes in the view source_architecture_check.architecture_view_name.

The nodes in that view are searched and every node's matching annotation (stereotype or simple node attribute) is translated into a partition name. That partition name should already exist in the view safety_concept.model_view_name. If it does not, it is newly inserted into the view and a warning is printed to the analysis log file.

Use the dictionary's key to define a text string that serves as prefix or as full name of the partition name. Depending on the dictionary value's description The description's search_kinds defines how to search for the key in a node. For the option stereotype and toggle_attribute this key is interpreted as a prefix, if additionally a separator is configured. Otherwise the key is the name of a node attribute.

 

safety_architecture_mapping_view_name

safety_architecture_mapping_view_name : str | None = 'Architecture_to_FfI_Architecture'

Optionally, the name of a new view to create a mapping from existing architecture view to the FfI architecture view. If None, no such view will be created (e.g. if only source code shall be checked).
 

safety_concept

Specification of the pre-existing safety view, and potentially how to add partitions to it.
 

safety_concept.default_partition_name : str = 'QM'

Partition name to use if the existing mapping resolves to an architecture node, which is not assigned into any partition.
 

safety_concept.map_complete_view : bool = True

Complete the mapping even with parts of the hierarchy view that are not mapped to any element in the partition architecture (model_view_name). This option should be switched to true to ensure no parts of the project are omitted from the check. It should be set to false if only a subproject is to be checked.

If safety_mapping_view_name is provided then this option refers to source_architecture_check.hierarchy_view_name as hierarchy view.

If safety_architecture_mapping_view_name is provided then this option refers to source_architecture_check.architecture_view_name as hierarchy view.

 

safety_concept.model_view_name : str = 'FfI_Architecture'

Name of an existing view containing the FfI architecture. Please configure to the name of a view into which your safety concept is already imported. To configure this import, please use an appropriate rule before this one, e.g. using Architecture-GXLImport).
 

safety_concept.safety_architecture_partition_type_name : str = 'Cluster'

Existing RFG node type for any partition, discovered in the base view, but not contained in the model_view_name. In this case, a new node of this type is created.
 

safety_mapping_view_name

safety_mapping_view_name : str | None = 'FfI_Mapping'

Optionally, the name of a new view to create the FfI mapping (hierarchy_view_name to model_view_name). If None, no such view will be created (e.g. only architecture view shall be checked).
 

source_architecture_check

Configuration for an existing Architecture Check for verification of compliance of a base view with an architecture view. The base view represents the project's source code (e.g. Declaration Facts or Code Facts generated by the rule Architecture-Dependencies). The architecture view represents an architecture model that may have been imported from a case tool and further processed.
 

source_architecture_check.architecture_view_name : str = 'Architecture'

Existing architecture view for the default architecture check. Safety partitions will be extracted for every node in this view.
 

source_architecture_check.hierarchy_view_name : str | None = 'File'

Hierarchy view of the default architecture check. The same view must be used for the FfI architecture check. This can be set to None, if only a check of the architecture model should be performed.
 

source_architecture_check.mapping_view_name : str | None = 'Mapping'

Existing mapping view of the default architecture check (maps hierarchy_view_name to architecture_view_name). This can be set to None, if no mapping from source code (hierarchy_view_name to the partition architecture is required. This is the case, if only a check of the architecture model should be performed.
 

Option Types

These types are used by options listed above:

LogLevel

An enumeration.
 
  • WARNING

  • INFO

  • DEBUG

SafetyNameContainer

An enumeration.
 

stereotype

A stereotype (value of RFG-Attribute UML.Stereotypes).

toggle_attribute

RFG node has a node attribute of type toggle (may be combined with the separator option).

string_attribute

RFG node is a string attribute. The value of the attribute will be used as the name of the partition.

SafetyNameMappingConfig

Data class used for the safety_annotations_in_architecture option.
 

attribute_kind

Type: SafetyNameContainer

Default: 'string_attribute'

Kind of node attribute to consider for architecture nodes. The value of this option determines if and how the separator is interpreted.
 

separator : str | None = None

Optional separator. Only the part after the separator is considered as the name of a partition.

Example 1: use attribute_kind = toggle_attribute, and use separator = '_' to transform toggle attribute 'ASIL_D' to partition name 'D'.

Example 2: use attribute_kind = string_attribute and separator = None, will turn the value "ASIL_D" of a string attribute into partition name 'ASIL_D'.

Example 3: use attribute_kind = string_attribute and separator = '_', will turn the value "ASIL_D" of a string attribute into partition name 'D'.

 

terminator : str | None = None

Optional terminator character. Only the part before the first terminator occurrence is considered as the name of a partition. This can be used to cut away trailing comments.