capellambse.model package

Implements a high-level interface to Capella projects.

class capellambse.model.ElementList

Bases: MutableSequence, Generic[T]

Provides access to elements without affecting the underlying model.

__init__(model, elements, elemclass=None, *, mapkey=None, mapvalue=None)
Parameters:
Return type:

None

filter(predicate)

Filter this list with a custom predicate.

The predicate may be the name of an attribute or a callable, which will be called on each list item. If the attribute value or the callable’s return value is truthy, the item is included in the resulting list.

When specifying the name of an attribute, nested attributes can be chained using ., like "parent.name" (which would pick all elements whose parent has a non-empty name).

Parameters:

predicate (str | Callable[[T], bool])

Return type:

ElementList[T]

get(key: str) T | None
get(key: str, default: U) T | U
insert(index, value)

S.insert(index, value) – insert value before index

Parameters:
  • index (int)

  • value (T)

Return type:

None

items()
Return type:

ElementListMapItemsView[T]

keys()
Return type:

ElementListMapKeyView

map(attr)

Apply a function to each element in this list.

If the argument is a string, it is interpreted as an attribute name, and the value of that attribute is returned for each element. Nested attribute names can be chained with ..

If the argument is a callable, it is called for each element, and the return value is included in the result. If the callable returns a sequence, the sequence is flattened into the result.

Duplicate values and Nones are always filtered out.

It is an error if a callable returns something that is not a model element or a flat sequence of model elements.

Parameters:

attr (str | _MapFunction[T])

Return type:

ElementList[GenericElement]

values()
Return type:

ElementList[T]

class capellambse.model.GenericElement

Bases: object

Provides high-level access to a single model element.

__init__(model, parent, xmltag=None, /, **kw)
Parameters:
Return type:

None

applied_property_value_groups

The applied property value groups of this GenericElement.

applied_property_values

The applied property values of this GenericElement.

constraints: Accessor

The constraints of this GenericElement.

description
property diagrams
filtering_criteria

The filtering criteria of this GenericElement.

classmethod from_model(model, element)

Wrap an existing model object.

Parameters:
  • model (MelodyModel) – The MelodyModel instance

  • element (_Element) – The XML element to wrap

Returns:

An instance of GenericElement (or a more appropriate subclass, if any) that wraps the given XML element.

Return type:

GenericElement

name
parent: ParentAccessor

The parent of this GenericElement.

property progress_status: AttributeProperty | str
property_value_groups

The property value groups of this GenericElement.

property_values

The property values of this GenericElement.

pvmt

The pvmt of this GenericElement.

requirements

The requirements of this GenericElement.

summary
traces

The traces of this GenericElement.

uuid
property xtype
class capellambse.model.MelodyModel

Bases: object

Provides high-level access to a model.

This class builds upon the lower-level MelodyLoader to provide an abstract, high-level interface for easy access to various model aspects.

__init__(path, *, diagram_cache=None, jupyter_untrusted=None, fallback_render_aird=False, **kwargs)

Load a project.

For complete information on which exact kwargs are supported, consult the documentation of the used file handler. Refer to the “See Also” section for a collection of links.

Below are some common parameter names and their usual meanings. Not all file handlers support all parameters.

Note

Passing in arguments that are not accepted by the selected file handler will result in an exception being raised. Similarly, leaving out arguments that are required by the file handler will also result in an exception.

Parameters:
  • path (str | PathLike) –

    Path or URL to the project. The following formats are accepted:

    • A path to a local .aird file.

    • A path to a local directory (requires entrypoint).

    • An SCP-style short URL, which will be treated as referring to a Git repository.

      Example: git@github.com:DSD-DBS/py-capellambse.git

    • A remote URL, with a protocol or prefix that indicates which file handler to invoke (requires entrypoint).

      Some examples:

      • git://git.example.com/model/coffeemaker.git

      • git+https://git.example.com/model/coffeemaker.git

      • git+ssh://git@git.example.com/model/coffeemaker.git

      Note

      Depending on the exact file handler, saving back to a remote location might fail with update_cache set to False. See save() for more details.

  • entrypoint (str) – Entrypoint from path to the main .aird file.

  • revision (str) – The revision to use, if loading a model from a version control system like git. Defaults to the current HEAD. If the used VCS does not have a notion of “current HEAD”, this argument is mandatory.

  • disable_cache (bool) – Disable local caching of remote content.

  • update_cache (bool) – Update the local cache. Defaults to True, but can be disabled to reuse the last cached state.

  • identity_file (str | pathlib.Path) – The identity file (private key) to use when connecting via SSH.

  • known_hosts_file (str | pathlib.Path) – The known_hosts file to pass to SSH for verifying the server’s host key.

  • username (str) – The username to log in as remotely.

  • password (str) – The password to use for logging in. Will be ignored when identity_file is passed as well.

  • diagram_cache (str | PathLike | FileHandler | dict[str, Any] | None) –

    An optional place where to find pre-rendered, cached diagrams. When a diagram is found in this cache, it will be loaded from there instead of being rendered on access. Note that diagrams will only be loaded from there, but not be put back, i.e. to use it effectively, the cache has to be pre-populated.

    This argument accepts the following values:

    • None, in which case all diagrams will be rendered internally the first time they are used.

    • A path to a local directory.

    • A URL just like for the path argument.

    • A dictionary with the arguments to a FileHandler. The dict’s path key will be analyzed to determine the correct FileHandler class.

    • An instance of FileHandler, which will be used directly.

    Warning

    When using the diagram cache, always make sure that the cached diagrams actually match the model version that is being used. There is no way to check this automatically.

    The file names looked up in the cache built in the format uuid.ext, where uuid is the UUID of the diagram (as reported by diag_obj.uuid) and ext is the render format. Example:

    • Diagram ID: _7FWu4KrxEeqOgqWuHJrXFA

    • Render call: diag_obj.as_svg or diag_obj.render("svg")

    • Cache file name: _7FWu4KrxEeqOgqWuHJrXFA.svg

    This argument is **not* passed to the file handler.*

  • diagram_cache_subdir (str) –

    A sub-directory prefix to prepend to diagram UUIDs before looking them up in the diagram_cache.

    This argument is **not* passed to the file handler.*

  • jupyter_untrusted (bool) – If set to True, restricts or disables some features that are unavailable in an untrusted Jupyter environment. Currently this only disables the SVG format as rich display option for Ipython, which is needed to avoid rendering issues with Github’s Jupyter notebook viewer.

  • fallback_render_aird (bool) – If set to True, enable the internal engine to render diagrams that were not found in the pre-rendered cache. Defaults to False, which means an exception is raised instead. Ignored if no diagram_cache was specified.

  • kwargs (Any)

Return type:

None

See also

capellambse.filehandler.FileHandler

Abstract super class for file handlers. Contains information needed for implementing custom handlers.

capellambse.filehandler.local.LocalFileHandler

The file handler responsible for local files and directories.

capellambse.filehandler.git.GitFileHandler

The file handler implementing the git:// protocol.

capellambse.filehandler.http.HTTPFileHandler

A simple http(s):// file handler.

activate_viewpoint(name, version)
Parameters:
Return type:

None

by_uuid(uuid)

Search the entire model for an element with the given UUID.

Parameters:

uuid (str)

Return type:

GenericElement

property description_badge: str

Describe model contents distribution with an SVG badge.

diagram_cache: FileHandler | None
diagrams

The diagrams of this MelodyModel.

enumeration_property_types

The enumeration property types of this MelodyModel.

filtering_model

The filtering model of this MelodyModel.

find_references(target, /)

Search the model for references to the given object.

Parameters:

target (ModelObject | str) – The target object to search for.

Yields:

tuple[ModelObject, str, int | None] – A 3-tuple containing the referencing model object, the attribute on that object, and an optional index. If the attribute contains a list of objects, the index shows the index into the list that was found. Otherwise the index is None.

Return type:

Iterator[tuple[ModelObject, str, int | None]]

classmethod from_model(model, element)
Parameters:
Return type:

MelodyModel

property info: ModelInfo
la

The la of this MelodyModel.

name

The name of this model.

oa

The oa of this MelodyModel.

pa

The pa of this MelodyModel.

property parent: None
property_value_packages

The property value packages of this MelodyModel.

referenced_viewpoints()
Return type:

dict[str, str]

property resources: dict[str, FileHandler]
sa

The sa of this MelodyModel.

save(**kw)

Save the model back to where it was loaded from.

Parameters:

kw (Any) – Additional keyword arguments accepted by the file handler in use. Please see the respective documentation for more info.

Return type:

None

See also

capellambse.filehandler.localfilehandler.LocalFileHandler.write_transaction

Accepted **kw when using local directories

capellambse.filehandler.git.GitFileHandler.write_transaction

Accepted **kw when using git:// and similar URLs

Notes

With a file handler that contacts a remote location (such as the GitFileHandler with non-local repositories), saving might fail if the local state has gone out of sync with the remote state. To avoid this, always leave the update_cache parameter at its default value of True if you intend to save changes.

search(*xtypes, below=None)

Search for all elements with any of the given xsi:types.

If only one xtype is given, the return type will be ElementList, otherwise it will be MixedElementList.

If no xtypes are given at all, this method will return an exhaustive list of all (semantic) model objects that have an xsi:type set.

Parameters:
  • xtypes (str | type[GenericElement]) – The xsi:types to search for, or the classes corresponding to them (or a mix of both).

  • below (GenericElement | None) – A model element to constrain the search. If given, only those elements will be returned that are (immediate or nested) children of this element. This option takes into account model fragmentation, but it does not treat link elements specially.

Return type:

ElementList

update_diagram_cache(capella_cli, image_format='svg', *, create_index=False, force=None, background=True)

Update the diagram cache if one has been specified.

If a diagram_cache has been specified while loading a Capella model it will be updated when this function is called.

The diagram cache will be populated by executing the Capella function “Export representations as images” which is normally accessible via the context menu of an .aird node in Capella’s project explorer. The export of diagrams happens with the help of Capella’s command line interface (CLI).

The CLI of Capella must be specified by the caller. It is possible to work with a local installation or a Docker image of an individual Capella bundle.

At the moment it is supported to run a Docker image using the container system Docker and the docker executable must be in the PATH environment variable.

Parameters:
  • capella_cli (str) –

    The Capella CLI to use when exporting diagrams from the given Capella model. The provided string can come with a "{VERSION}" placeholder. If specified, this placeholder will be replaced by the x.y.z formatted version of Capella that has been used when the given Capella model was last saved. After consideration of the optional placeholder this function will first check if the value of capella_cli points to a local Capella executable (that can be an absolute path or an executable/ symbolic link that has been made available via the environment variable PATH). If no executable can be found it is expected that capella_cli represents a Docker image name for an image that behaves like the Capella CLI. For the case of passing a Docker image name through capella_cli this means it is assumed that something like the following

    docker run --rm -it <capella_cli> -nosplash \
        -consolelog -app APP -appid APPID
    

    will work. The parameter force can be set to change the described behaviour and force the function to treat the capella_cli as a local executable or a Docker image only.

  • image_format (Literal['bmp', 'gif', 'jpg', 'png', 'svg']) – Format of the image file(s) for the exported diagram(s). This can be set to any value out of "bmp", "gif", "jpg", "png", or "svg".

  • create_index (bool) –

    If True, two index files index.json and index.html will be created. The JSON file consists of a list of dictionaries, each representing a diagram in the model. The dictionaries come with the keys

    • uuid: The unique ID of the diagram

    • name: Name of the diagram as it has been set in Capella

    • type: The diagram type as it was created in Capella

    • viewpoint: The source layer from where the representation is loaded from. It is Common for layerless diagrams.

    • success: A boolean stating if a diagram has been exported from Capella

    The HTML file shows a numbered list of diagram names which are hyperlinked to the diagram image file. Right beside a diagram’s name one can also see the diagram’s UUID in a discreet light gray and tiny font size. The HTML index also provides some meta data like a timestamp for the update of diagrams.

  • force (Literal['docker', 'exe'] | None) – If the value of capella_cli is ambiguous and can match both a local executable and a Docker image, this parameter can be used to bypass the auto-detection and force the choice. A value of "exe" always interprets capella_cli as local executable, "docker" always interprets it as a docker image name. None (the default) enables automatic detection.

  • background (bool) –

    Add a white background to exported SVG images.

    Ignored if the image_format is not "svg".

Raises:
  • TypeError – If no diagram_cache was specified while loading the model.

  • RuntimeError – If an error occurs while diagrams are being exported from the Capella model.

Return type:

None

Examples

Running a local installation of Capella

All the following examples call the method update_diagram_cache() on a model for which a diagram cache has been specified, example:

>>> import capellambse
>>> model = capellambse.MelodyModel(
...    "/path/to/model.aird",
...    diagram_cache="/path/to/diagram_cache",
... )

Passing an executable/ symlink named capella that is in the PATH environment variable:

>>> model.update_diagram_cache(
...     "capella", "png", True
... )

Passing an absolute path to a local installation of Capella that contains the Capella version:

>>> model.update_diagram_cache(
...     "/Applications/Capella_{VERSION}.app/Contents/MacOS/capella"
... )

Running a Capella container

>>> model.update_diagram_cache(
...     "ghcr.io/dsd-dbs/capella-dockerimages/capella/base"
...     ":{VERSION}-selected-dropins-main"
... )
uuid

The unique ID of the model’s root element.

exception capellambse.model.NonUniqueMemberError

Bases: ValueError

Raised when a duplicate member is inserted into a list.

property attr
property parent
property target

Subpackages

Submodules

capellambse.model.diagram module

Classes that allow access to diagrams in the model.

class capellambse.model.diagram.AbstractDiagram

Bases: object

Abstract superclass of model diagrams.

__init__(model)
Parameters:

model (MelodyModel)

Return type:

None

_allow_render: bool = True

Allow this diagram to be rendered by the internal rendering engine.

If this property is set to False, and a diagram cache was specified for the model, this diagram can only be loaded from the cache, and will never be rendered. Has no effect if there was no diagram cache specified.

abstract _create_diagram(params)

Perform the actual rendering of the diagram.

This method is called by render() to perform the actual rendering of the diagram. It is passed the parameters that were passed to render() as a dictionary.

Subclasses override this method to implement their rendering logic. Do not call this method directly, use render() instead - it will take care of caching and properly converting the render output.

Parameters:

params (dict[str, Any])

Return type:

Diagram

filters: MutableSet[str]

The filters that are activated for this diagram.

invalidate_cache()

Reset internal diagram cache.

Return type:

None

name: str

Human-readable name for this diagram.

property nodes: MixedElementList

Return a list of all nodes visible in this diagram.

render(fmt: None, /, **params) Diagram
render(fmt: str, /, *, pretty_print: bool = False, **params) Any

Render the diagram in the given format.

Parameters:
  • fmt

    The output format to use.

    If None, the Diagram is returned without format conversion.

  • pretty_print – Whether to pretty-print the output. Only applies to text-based formats. Ignored if the output format converter does not support pretty-printing.

  • params – Additional render parameters. Which parameters are supported depends on the specific type of diagram.

save(file, fmt, /, *, pretty_print=False, **params)

Render the diagram and write it to a file.

Parameters:
  • file (str | PathLike | IO[bytes] | None) –

    The file to write the diagram to. Can be a filename, or a file-like object in binary mode.

    Text-based formats that render to a str will always be encoded as UTF-8.

    If None is passed, and the selected format has a known filename extension, a filename will be generated from the diagram’s name and the extension.

  • fmt (str) – The output format to use.

  • pretty_print (bool) – Whether to pretty-print the output. Only applies to text-based formats. Ignored if the output format converter does not support pretty-printing.

  • params – Additional render parameters to pass to the render() call.

Return type:

None

target: GenericElement

This diagram’s “target”.

The target of a diagram is usually:

  • The model element which is the direct parent of all visible nodes OR

  • The only top-level element in the diagram OR

  • The element which is considered to be the “element of interest”.

uuid: str

Unique ID of this diagram.

class capellambse.model.diagram.ConfluenceSVGFormat

Bases: object

Convert the diagram to Confluence-style SVG.

classmethod convert(dg)
Parameters:

dg (str)

Return type:

str

classmethod convert_pretty(dg)
Parameters:

dg (str)

Return type:

str

depends

alias of SVGFormat

postfix = ']]></ac:plain-text-body></ac:structured-macro>'
prefix = '<ac:structured-macro ac:macro-id="71ac57dc-4e10-44cf-b5ee-d46186413184" ac:name="html" ac:schema-version="1"><ac:plain-text-body><![CDATA['
class capellambse.model.diagram.Diagram

Bases: AbstractDiagram

Provides access to a single diagram.

__init__(**kw)
Parameters:

kw (Any)

Return type:

None

property _allow_render: bool

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

_create_diagram(params)

Perform the actual rendering of the diagram.

This method is called by render() to perform the actual rendering of the diagram. It is passed the parameters that were passed to render() as a dictionary.

Subclasses override this method to implement their rendering logic. Do not call this method directly, use render() instead - it will take care of caching and properly converting the render output.

Parameters:

params (dict[str, Any])

Return type:

Diagram

description
property filters: MutableSet[str]

Return a set of currently activated filters on this diagram.

classmethod from_model(model, element)

Wrap a diagram already defined in the Capella AIRD.

Parameters:
Return type:

Diagram

invalidate_cache()

Reset internal diagram cache.

Return type:

None

name: str

Human-readable name for this diagram.

property nodes: MixedElementList

Return a list of all nodes visible in this diagram.

property representation_path: str

The ID of the representation, i.e. the actual diagram.

Capella distinguishes between the representation (which contains all visual data) and a representation descriptor, which only contains a handful of metadata like the diagram name and description. Both have their own IDs, and the descriptor contains a link to the representation.

property target: GenericElement
property type: DiagramType

Return the type of this diagram.

uuid: str

Unique ID of this diagram.

property viewpoint: str
property xtype
class capellambse.model.diagram.DiagramAccessor

Bases: Accessor

Provides access to a list of diagrams below the specified viewpoint.

__init__(viewpoint=None, *, cacheattr=None)
Parameters:
  • viewpoint (str | None)

  • cacheattr (str | None)

Return type:

None

class capellambse.model.diagram.DiagramFormat

Bases: Protocol

__init__(*args, **kwargs)
classmethod convert(dg)
Parameters:

dg (Any)

Return type:

Any

class capellambse.model.diagram.PNGFormat

Bases: object

Convert the diagram to PNG.

static convert(dg)
Parameters:

dg (str)

Return type:

bytes

depends

alias of SVGFormat

filename_extension = '.png'
static from_cache(cache)
Parameters:

cache (bytes)

Return type:

bytes

mimetype = 'image/png'
class capellambse.model.diagram.PrettyDiagramFormat

Bases: DiagramFormat, Protocol

classmethod convert_pretty(dg)
Parameters:

dg (Any)

Return type:

Any

class capellambse.model.diagram.SVGDataURIFormat

Bases: object

classmethod convert(dg)
Parameters:

dg (str)

Return type:

str

depends

alias of SVGFormat

preamble = 'data:image/svg+xml;base64,'
class capellambse.model.diagram.SVGFormat

Bases: object

Convert the diagram to SVG.

static convert(dg)
Parameters:

dg (SVGDiagram)

Return type:

str

static convert_pretty(dg)
Parameters:

dg (SVGDiagram)

Return type:

str

depends()

Convert the diagram to a SVGDiagram.

Parameters:

dg (Diagram)

Return type:

SVGDiagram

filename_extension = '.svg'
static from_cache(cache)
Parameters:

cache (bytes)

Return type:

str

mimetype = 'image/svg+xml'
class capellambse.model.diagram.SVGInHTMLIMGFormat

Bases: object

static convert(dg)
Parameters:

dg (str)

Return type:

Markup

depends

alias of SVGDataURIFormat

class capellambse.model.diagram.TerminalGraphicsFormat

Bases: object

The kitty terminal graphics protocol diagram format.

This graphics format generates terminal escape codes that transfer PNG data to a TTY using the kitty graphics protocol.

classmethod convert(dg)
Parameters:

dg (bytes)

Return type:

bytes

depends

alias of PNGFormat

static is_supported()

Return whether the used terminal supports graphics.

This implementation checks whether stdin, stdout and stderr are connected to a terminal, and whether the $TERM environment variable is set to a know-supportive value. Currently the only recognized value is xterm-kitty.

Return type:

bool

exception capellambse.model.diagram.UnknownOutputFormat

Bases: ValueError

An unknown output format was requested for the diagram.

capellambse.model.diagram.convert_svgdiagram(dg)

Convert the diagram to a SVGDiagram.

Parameters:

dg (Diagram)

Return type:

SVGDiagram

capellambse.model.modeltypes module

Enumeration types used by the MelodyModel.

class capellambse.model.modeltypes.AccessPolicy

Bases: _StringyEnumMixin, Enum

READ_AND_WRITE = 'readAndWrite'
READ_ONLY = 'readOnly'
class capellambse.model.modeltypes.AggregationKind

Bases: _StringyEnumMixin, Enum

Defines the specific kind of a relationship, as per UML definitions.

AGGREGATION = 'AGGREGATION'

A semantic relationship between a part and a whole.

The part has a lifecycle of its own, and is potentially shared among several aggregators.

ASSOCIATION = 'ASSOCIATION'

A semantic relationship between typed instances.

It has at least two ends represented by properties, each of which is connected to the type of the end. More than one end of the association may have the same type.

Indicates that the property has no aggregation.

COMPOSITION = 'COMPOSITION'

A semantic relationship between whole and its parts.

The parts lifecycles are tied to that of the whole, and they are not shared with any other aggregator.

UNSET = 'UNSET'

Used when value is not defined by the user.

class capellambse.model.modeltypes.BinaryOperator

Bases: _StringyEnumMixin, Enum

Specifies the kind of this binary operator.

ADD = 'ADD'

The binary operator refers to an addition.

AND = 'AND'

The binary operator refers to a logical AND operation.

DIV = 'DIV'

The binary operator refers to a division.

EQU = 'EQU'

The binary operator refers to an equal operation.

IOR = 'IOR'

The binary operator refers to a logical inclusive OR operation.

MAX = 'MAX'

The binary operator refers to a max operation.

MIN = 'MIN'

The binary operator refers to a min operation.

MUL = 'MUL'

The binary operator refers to a multiplication.

POW = 'POW'

The binary operator refers to a power operation.

SUB = 'SUB'

The binary operator refers to a substraction.

UNSET = 'UNSET'

The binary operator is not initialized.

XOR = 'XOR'

The binary operator refers to a logical exclusive OR operation.

class capellambse.model.modeltypes.CatalogElementKind

Bases: _StringyEnumMixin, Enum

GROUPING = 'GROUPING'
REC = 'REC'
REC_RPL = 'REC_RPL'
RPL = 'RPL'
class capellambse.model.modeltypes.ChangeEventKind

Bases: _StringyEnumMixin, Enum

WHEN = 'WHEN'
class capellambse.model.modeltypes.CollectionKind

Bases: _StringyEnumMixin, Enum

Defines the specific kind of a Collection structure.

ARRAY = 'ARRAY'

The collection is to be considered an array of elements.

SEQUENCE = 'SEQUENCE'

The collection is to be considered as a sequence (list) of elements.

class capellambse.model.modeltypes.CommunicationLinkKind

Bases: _StringyEnumMixin, Enum

Enumeration listing the various possibilities of communication links.

ACCESS = 'ACCESS'

The CommunicationLink describes an access to the ExchangeItem.

ACQUIRE = 'ACQUIRE'

The CommunicationLink describes an acquisition of ExchangeItem.

CALL = 'CALL'

The CommunicationLink describes a call of ExchangeItem.

CONSUME = 'CONSUME'

The CommunicationLink describes a comsumption of ExchangeItem.

EXECUTE = 'EXECUTE'

The CommunicationLink describes an execution of ExchangeItem.

PRODUCE = 'PRODUCE'

The CommunicationLink describes a production of ExchangeItem.

RECEIVE = 'RECEIVE'

The CommunicationLink describes a reception of ExchangeItem.

SEND = 'SEND'

The CommunicationLink describes a sending of ExchangeItem.

TRANSMIT = 'TRANSMIT'

The CommunicationLink describes a transmission of ExchangeItem.

UNSET = 'UNSET'

The CommunicationLink protocol is not yet set.

WRITE = 'WRITE'

The CommunicationLink describes a writing of ExchangeItem.

class capellambse.model.modeltypes.CommunicationLinkProtocol

Bases: _StringyEnumMixin, Enum

The various possibilities for the protocol of the communication link.

ACCEPT = 'ACCEPT'

Describes access to the ExchangeItem by accepting it.

ASYNCHRONOUS = 'ASYNCHRONOUS'

Describes a call of the ExchangeItem using the asynchronous protocol.

BROADCAST = 'BROADCAST'

Describes sending an ExchangeItem using the broadcast protocol.

MULTICAST = 'MULTICAST'

Describes sending an ExchangeItem using the multicast protocol.

READ = 'READ'

Describes access to the ExchangeItem by reading it.

SYNCHRONOUS = 'SYNCHRONOUS'

Describes a call of the ExchangeItem using the synchronous protocol.

UNICAST = 'UNICAST'

Describes sending an ExchangeItem using the unicast protocol.

UNSET = 'UNSET'

The CommunicationLink protocol is not yet set.

class capellambse.model.modeltypes.ComponentExchangeKind

Bases: _StringyEnumMixin, Enum

The kind of a ComponentExchange.

ASSEMBLY = 'ASSEMBLY'

Indicates that the connector is an assembly connector.

DELEGATION = 'DELEGATION'

Indicates that the connector is a delegation connector.

FLOW = 'FLOW'

Describes a flow communication.

UNSET = 'UNSET'

Communication kind is not set.

class capellambse.model.modeltypes.ComponentPortKind

Bases: _StringyEnumMixin, Enum

FLOW = 'FLOW'

Describes a flow port.

A flow port is an interaction point through which input and/or output of items such as data, material, or energy may flow.

STANDARD = 'STANDARD'

Describes a standard port.

A port is an interaction point between a Block or sub-Block and its environment that supports Exchanges with other ports.

class capellambse.model.modeltypes.ConfigurationItemKind

Bases: _StringyEnumMixin, Enum

COTSCI = 'COTSCI'

Commercial Off The Shelves Configuration Item.

CSCI = 'CSCI'

Computer Software Configuration Item.

HWCI = 'HWCI'

Hardware Configuration Item.

INTERFACE_CI = 'InterfaceCI'

Interface Configuration Item.

NDICI = 'NDICI'

Non Developmental Configuration Item.

PRIME_ITEM_CI = 'PrimeItemCI'

Prime Item Configuration Item.

SYSTEM_CI = 'SystemCI'

System Configuration Item.

UNSET = 'Unset'
class capellambse.model.modeltypes.ControlNodeKind

Bases: _StringyEnumMixin, Enum

AND = 'AND'
ITERATE = 'ITERATE'
OR = 'OR'
class capellambse.model.modeltypes.DiagramType

Bases: _StringyEnumMixin, Enum

The types of diagrams that Capella knows about.

Extracted from:

$CAPELLA/eclipse/configuration/org.eclipse.osgi/635/0/.cp/description

with:

grep '<ownedRepresentations' *(.)         | grep --color=always -P '(?<=name=").*?(?=")'
CC = 'Contextual Capability'
CDB = 'Class Diagram Blank'
CDI = 'Contextual Component Detailed Interfaces'
CEI = 'Contextual Component External Interfaces'
CIBD = 'Configuration Items Breakdown'
CII = 'Contextual Component Internal Interfaces'
CM = 'Contextual Mission'
COC = 'Contextual Operational Capability'
CRB = 'Capability Realization Blank'
CRI = 'Contextual Capability Realization Involvement'
CRR = 'Capability Realization Refinement'
CSA = 'Contextual System Actors'
EAB = 'EPBS Architecture Blank'
ES = 'Component Exchanges Scenario'
FS = 'Functional Scenario'
ID = 'Interface Delegations'
IDB = 'Interfaces Diagram Blank'
IS = 'Component Interfaces Scenario'
LAB = 'Logical Architecture Blank'
LCBD = 'Logical Component Breakdown'
LDFB = 'Logical Data Flow Blank'
LFBD = 'Logical Function Breakdown'
LFCD = 'Functional Chain Description'
MB = 'Missions Blank'
MCB = 'Missions Capabilities Blank'
MSM = 'Mode State Machine'
OAB = 'Operational Entity Blank'
OABD = 'Operational Activity Breakdown'
OAIB = 'Operational Activity Interaction Blank'
OAS = 'Activity Interaction Scenario'
OCB = 'Operational Capabilities Blank'
OEBD = 'Operational Entity Breakdown'
OES = 'Operational Interaction Scenario'
OPD = 'Operational Process Description'
ORB = 'Operational Role Blank'
PAB = 'Physical Architecture Blank'
PCBD = 'Physical Component Breakdown'
PD = 'Package Dependencies'
PDFB = 'Physical Data Flow Blank'
PFBD = 'Physical Function Breakdown'
PFCD = 'Functional Chain Description'
PPD = 'Physical Path Description'
SAB = 'System Architecture Blank'
SDFB = 'System Data Flow Blank'
SFBD = 'System Function Breakdown'
SFCD = 'Functional Chain Description'
UNKNOWN = '(Unknown Diagram Type)'
class capellambse.model.modeltypes.ElementKind

Bases: _StringyEnumMixin, Enum

The visibility options for features of a class.

MEMBER = 'MEMBER'

The ExchangeItemElement is a member for its ExchangeItem.

TYPE = 'TYPE'

The ExchangeItemElement is a type for its ExchangeItem.

class capellambse.model.modeltypes.ExchangeMechanism

Bases: _StringyEnumMixin, Enum

Enumeration of the different exchange mechanisms.

EVENT = 'EVENT'

Asynchronous information that is taken into account rapidly.

FLOW = 'FLOW'

Continuous supply of data.

OPERATION = 'OPERATION'

Sporadic supply of data with returned data.

SHARED_DATA = 'SHARED_DATA'
UNSET = 'UNSET'

The exchange mechanism is not defined.

class capellambse.model.modeltypes.FunctionKind

Bases: _StringyEnumMixin, Enum

The kind of a Function.

DUPLICATE = 'DUPLICATE'
FUNCTION = 'FUNCTION'
GATHER = 'GATHER'
ROUTE = 'ROUTE'
SELECT = 'SELECT'
SPLIT = 'SPLIT'
class capellambse.model.modeltypes.FunctionalChainKind

Bases: _StringyEnumMixin, Enum

The kind of a Functional Chain.

COMPOSITE = 'COMPOSITE'
FRAGMENT = 'FRAGMENT'
SIMPLE = 'SIMPLE'
class capellambse.model.modeltypes.InteractionOperatorKind

Bases: _StringyEnumMixin, Enum

ALT = 'ALT'
ASSERT = 'ASSERT'
CONSIDER = 'CONSIDER'
CRITICAL = 'CRITICAL'
IGNORE = 'IGNORE'
LOOP = 'LOOP'
NEG = 'NEG'
OPT = 'OPT'
PAR = 'PAR'
SEQ = 'SEQ'
STRICT = 'STRICT'
UNSET = 'UNSET'
class capellambse.model.modeltypes.MessageKind

Bases: _StringyEnumMixin, Enum

Identifies the type of message.

This concept is similar to UML MessageSort.

ASYNCHRONOUS_CALL = 'ASYNCHRONOUS_CALL'

The message was generated by an asynchronous call to an operation.

Equivalent to UML MessageSort::asynchCall.

CREATE = 'CREATE'

The message designates the creation of an instance role.

DELETE = 'DELETE'

The message designates the termination of another lifeline.

Equivalent to UML MessageSort::deleteMessage.

REPLY = 'REPLY'

The message is a reply message to an operation call.

Equivalent to UML MessageSort::reply.

SYNCHRONOUS_CALL = 'SYNCHRONOUS_CALL'

The message was generated by a synchronous call to an operation.

Equivalent to UML MessageSort::synchCall.

TIMER = 'TIMER'
UNSET = 'UNSET'

The message kind is not specified.

class capellambse.model.modeltypes.NumericTypeKind

Bases: _StringyEnumMixin, Enum

The kind of this numeric data type.

FLOAT = 'FLOAT'
INTEGER = 'INTEGER'
class capellambse.model.modeltypes.ObjectNodeKind

Bases: _StringyEnumMixin, Enum

The behavior type of the object node with respect to incoming data.

NO_BUFFER = 'NoBuffer'

Discard incoming tokens if they are refused.

When the “nobuffer” stereotype is applied to object nodes, tokens arriving at the node are discarded if they are refused by outgoing edges, or refused by actions for object nodes that are input pins.

OVERWRITE = 'Overwrite'

Incoming tokens may overwrite existing ones.

When the “overwrite” stereotype is applied to object nodes, a token arriving at a full object node replaces the ones already there. A full object node has as many tokens as allowed by its upper bound.

UNSPECIFIED = 'Unspecified'

Used when incoming object node management policy is not specified.

class capellambse.model.modeltypes.ObjectNodeOrderingKind

Bases: _StringyEnumMixin, Enum

Indicates queuing order within a node.

FIFO = 'FIFO'

First In First Out ordering.

LIFO = 'LIFO'

Last In First Out ordering.

ORDERED = 'ordered'

Indicates that object node tokens are ordered.

UNORDERED = 'unordered'

Indicates that object node tokens are unordered.

class capellambse.model.modeltypes.OrientationPortKind

Bases: _StringyEnumMixin, Enum

Direction of component ports.

IN = 'IN'

The port represents an input of the component it is used in.

INOUT = 'INOUT'

The port represents both an input and on output of the component.

OUT = 'OUT'

The port represents an output of the component it is used in.

UNSET = 'UNSET'

The port orientation is undefined.

class capellambse.model.modeltypes.ParameterDirection

Bases: _StringyEnumMixin, Enum

The direction in which data is passed along through a parameter.

EXCEPTION = 'EXCEPTION'

The parameter is like an exception.

IN = 'IN'

The parameter represents an input of the operation it is used in.

INOUT = 'INOUT'

The parameter represents both an input and output of the operation.

OUT = 'OUT'

The parameter represents an output of the operation it is used in.

RETURN = 'RETURN'

The parameter represents the return value of the operation.

UNSET = 'UNSET'

The CommunicationLink protocol is not yet set.

class capellambse.model.modeltypes.ParameterEffectKind

Bases: _StringyEnumMixin, Enum

A behavior’s effect on values passed in or out of its parameters.

CREATE = 'create'

The parameter value is being created upon behavior execution.

DELETE = 'delete'

The parameter value is being deleted upon behavior execution.

READ = 'read'

The parameter value is only being read upon behavior execution.

UPDATE = 'update'

The parameter value is being updated upon behavior execution.

class capellambse.model.modeltypes.PassingMode

Bases: _StringyEnumMixin, Enum

The data passing mechanism for parameters of an operation.

BY_REF = 'BY_REF'

The data is being passed by reference to the operation.

BY_VALUE = 'BY_VALUE'

The data is being passed by value to the operation.

UNSET = 'UNSET'

The data passing mechanism is not precised.

class capellambse.model.modeltypes.PhysicalComponentKind

Bases: _StringyEnumMixin, Enum

Categories of physical components.

Allows to categorize a physical component, with respect to real life physical entities.

DATA = 'DATA'

The physical component represents a set of data.

FACILITIES = 'FACILITIES'

The physical component refers to Facilities.

FIRMWARE = 'FIRMWARE'

The physical component is a firmware part.

HARDWARE = 'HARDWARE'

The physical component is a hardware resource.

HARDWARE_COMPUTER = 'HARDWARE_COMPUTER'

The physical component is a computing resource.

MATERIALS = 'MATERIALS'

The physical component represents a bunch of materials.

PERSON = 'PERSON'

The physical component is a person.

PROCESSES = 'PROCESSES'

The physical component represents a set of processes.

SERVICES = 'SERVICES'

The physical component represents a set of services.

SOFTWARE = 'SOFTWARE'

The physical component is a software entity.

SOFTWARE_APPLICATION = 'SOFTWARE_APPLICATION'

The physical component is a software application.

SOFTWARE_DEPLOYMENT_UNIT = 'SOFTWARE_DEPLOYMENT_UNIT'

The physical component is a software deployment unit.

SOFTWARE_EXECUTION_UNIT = 'SOFTWARE_EXECUTION_UNIT'

The physical component is a software execution unit.

UNSET = 'UNSET'

The physical component kind is not specified.

class capellambse.model.modeltypes.PhysicalComponentNature

Bases: _StringyEnumMixin, Enum

The nature of a physical component.

BEHAVIOR = 'BEHAVIOR'

The physical component nature is behavioral.

This typically means a piece of software.

NODE = 'NODE'

The physical component is a host for behavioral components.

This typically means a computing resource.

UNSET = 'UNSET'

The physical component nature is not specified.

class capellambse.model.modeltypes.RateKind

Bases: _StringyEnumMixin, Enum

The possible caracterizations for the rate of a streaming parameter.

CONTINUOUS = 'Continuous'

The rate characterizes a continuous flow.

DISCRETE = 'Discrete'

The rate characterizes a discrete flow.

UNSPECIFIED = 'Unspecified'

The rate kind is not specified.

class capellambse.model.modeltypes.ScenarioKind

Bases: _StringyEnumMixin, Enum

DATA_FLOW = 'DATA_FLOW'
FUNCTIONAL = 'FUNCTIONAL'
INTERACTION = 'INTERACTION'
INTERFACE = 'INTERFACE'
UNSET = 'UNSET'
class capellambse.model.modeltypes.SynchronismKind

Bases: _StringyEnumMixin, Enum

The synchronicity of an operation invocation.

ASYNCHRONOUS = 'ASYNCHRONOUS'
SYNCHRONOUS = 'SYNCHRONOUS'
UNSET = 'UNSET'
class capellambse.model.modeltypes.TimeEventKind

Bases: _StringyEnumMixin, Enum

AFTER = 'AFTER'

Trigger after a relative time duration has passed.

A relative time trigger is specified with the keyword ‘after’ followed by an expression that evaluates to a time value, such as ‘after (5 seconds)’.

AT = 'AT'

Trigger at a specific time.

An absolute time trigger is specified with the keyword ‘at’ followed by an expression that evaluates to a time value, such as ‘Jan. 1, 2000, Noon’.

class capellambse.model.modeltypes.TransitionKind

Bases: _StringyEnumMixin, Enum

EXTERNAL = 'external'
INTERNAL = 'internal'
LOCAL = 'local'
class capellambse.model.modeltypes.UnaryOperator

Bases: _StringyEnumMixin, Enum

The operator of a unary expression.

NOT = 'NOT'

The unary operator refers to a NOT operation.

POS = 'POS'

The unary operator refers to a position operation.

PRE = 'PRE'

The unary operator refers to a predecessor operation.

SUC = 'SUC'

The unary operator refers to a successor operation.

UNSET = 'UNSET'

The unary operator is not initialized.

VAL = 'VAL'

The unary operator refers to a value operation.

class capellambse.model.modeltypes.UnionKind

Bases: _StringyEnumMixin, Enum

UNION = 'UNION'
VARIANT = 'VARIANT'
class capellambse.model.modeltypes.VisibilityKind

Bases: _StringyEnumMixin, Enum

The possibilities regarding the visibility of a feature of a class.

PACKAGE = 'PACKAGE'

The feature is accessible from any element within the same package.

PRIVATE = 'PRIVATE'

The feature is only visible/accessible from the class itself.

PROTECTED = 'PROTECTED'

The feature offers visibility only to children of the class.

PUBLIC = 'PUBLIC'

The feature offers public access.

UNSET = 'UNSET'

Visibility is not specified.

class capellambse.model.modeltypes._StringyEnumMixin

Bases: object

Mixin for enums that makes members compare equal to their key name.

name: Any