6.2.5.8. Architecture-PlantUMLC4Importer

Imports PlantUML C4 files into the RFG

Required inputs: RFG

This rule imports one or several PlantUML C4 files into an RFG view.

Possible Messages

This rule has no predefined messages.

Options

add_source_column_attribute

add_source_column_attribute : bool = False

If set to True, add Source.Column attribute to generated RFG nodes.
 

add_source_line_attribute

add_source_line_attribute : bool = False

If set to True, add Source.Line attribute to generated RFG nodes.
 

argument_separator

argument_separator : str = '|'

Argument separator for entity arguments. See the description for store_entity_arguments for details.
 

c4_file_paths

c4_file_paths : list[bauhaus.analysis.config.LayerRelativePath] = []

File paths to the PlantUML C4 files that shall be imported.
 

c4_type_to_rfg_type

c4_type_to_rfg_type

Type: dict[str, str]

Default:

{
   'Component': 'UML Component',
   'Component_Ext': 'UML Component'
}
Specifies to which RFG node type a C4 entity is mapped. The default RFG node type used is 'Cluster'. For example, if the mapping

Person -> UML Component
is configured, each C4 Person entity will be translated to a corresponding UML Component RFG node.

 

edge_definitions

edge_definitions

Type: dict[str, EdgeArgIndices]

Default:

{
   'Rel':    bauhaus.architecture.c4_import.c4_walker.EdgeArgIndices(
      dst=1,
      src=0
   ),
   'Rel_Down':    bauhaus.architecture.c4_import.c4_walker.EdgeArgIndices(
      dst=1,
      src=0
   ),
   'Rel_Right':    bauhaus.architecture.c4_import.c4_walker.EdgeArgIndices(
      dst=1,
      src=0
   )
}
Specifies which C4 entities shall be mapped to RFG source dependency edges. Each entry consists of a name name, a source index src, and a destination index dst.

For example, the entry Rel(src=0, dst=1) has the following meaning:

  • Rel is the name of the C4 entity.
  • src is the index of Rel parameter that is used as the source ID for the edge.
  • dst is the index of Rel parameter that is used as the target ID for the edge.
The following C4 snippet

...
Person(src_id, "Source")
Rel(src_id, dst_id, ...)
Person(dst_id, "Target")
...
matches on the above entry.
Because src_id is at index 0, is it taken as the source ID.
Likewise, dst_id is at index 1, hence it is taken as the target ID.
Thus, in the generated view, there will be an edge from the "Source" node to the "Target" node.

 

export_warnings

export_warnings : bool = True

Export output messages to the analysis database.
 

ignored_entities

ignored_entities : set[str] = {'SHOW_LEGEND'}

C4 entities in this list will not be added to the generated view.
 

loglevel

loglevel : LogLevel = 'WARNING'

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

store_entity_arguments

store_entity_arguments : bool = False

If set to True, store entity arguments as RFG node/edge string attribute C4.Arguments. The arguments are separated by the string specified in the option argument_separator.
 

view_name

view_name : str = 'None (value must be set)'

The name of the generated view.
 

Option Types

These types are used by options listed above:

EdgeArgIndices

EdgeArgIndices(src: int = 0, dst: int = 0)
 

dst : int = 0

src : int = 0

LogLevel

An enumeration.
 
  • WARNING

  • INFO

  • DEBUG