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:
- To check source (
Code FactsorDeclaration Facts) against the partition architecture:- base_view_name:
- either
Code FactsorDeclaration Factsas appropriate - hierarchy_view_name:
- source_architecture_check.hierarchy_view_name
- architecture_view_name:
- safety_concept.model_view_name
- mapping_view_name:
- safety_mapping_view_name
- To check the existing architecture model against the partition architecture:
Possible Messages
This rule has no predefined messages.
Options¶
This rule shares the following common options: exclude_messages_in_system_headers, excludes, includes, justification_checker, post_processing, provider, severity
The following places define options that affect this rule: Analysis-GlobalOptions
export_warnings¶
export_warnings : bool = True
loglevel¶
loglevel : LogLevel = 'WARNING'
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'
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 =
Partition name to use if the existing mapping resolves to an architecture node, which is not assigned into any partition.'QM'
safety_concept.map_complete_view : bool =
TrueComplete 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 =
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).'FfI_Architecture'
safety_concept.safety_architecture_partition_type_name : str =
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.'Cluster'
safety_mapping_view_name¶
safety_mapping_view_name : str | None = 'FfI_Mapping'
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 FactsorCode Factsgenerated 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 =
Existing architecture view for the default architecture check. Safety partitions will be extracted for every node in this view.'Architecture'
source_architecture_check.hierarchy_view_name : str | None =
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.'File'
source_architecture_check.mapping_view_name : str | None =
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.'Mapping'
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 theseparator 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 thesafety_annotations_in_architecture option.
attribute_kind
Kind of node attribute to consider for architecture nodes. The value of this option determines if and how theType: SafetyNameContainer
Default:
'string_attribute'
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.