DSD-DBS / py-capellambse

A Python 3 headless implementation of the Capella modeling tool.

Home Page:https://dsd-dbs.github.io/py-capellambse/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Declarative modelling : Problems when declaring new functions / components

olive2205 opened this issue · comments

Hi,
I 'm using Capella 5.2 and i noticed a few problems in the .capella file when declaring new functions and components with Declarative Modelling and YAML file. The elements declared with py-capellambse are not the same than the ones declared directly in Capella and do not have all the informations displayed ine the Semantic Browser. These problems can, sometimes, corrupt the Capella Project so it can't be opened in Capella anymore.

For logical and physical functions, the xml tag is ownedFunctions and not ownedLogicalFunctions, so the function is not recognized in Capella.

For components :

  • sourceElement attribute is missing in the <ownedFunctionalAllocation/> tag
  • a tag <ownedFeatures/> should be added when declaring new components
  • in pa, when adding a deployment link between Behavior and Node component with deployed_parts, the following line should be added at the top of the .capella file :
    xmlns:org.polarsys.capella.core.data.pa.deployment="http://www.polarsys.org/capella/core/pa/deployment/5.0.0"

I hope this will help you,

Thanks

@olive2205, any chance you could share some YAML example of what you are trying to do? (obfuscated will be fine too) - it will help us to reproduce your scenario a bit faster

I'm just trying to use the example of the documentation https://dsd-dbs.github.io/py-capellambse/start/declarative.html.

and for the last point, here is my YAML code (PCNode1 was declared directly in Capella):

- parent: !find
    _type: PhysicalComponent
    name: PCNode1
  extend: 
    owned_components:
      - name: PCB2
        nature: BEHAVIOR
        promise_id: prom_PCB2
- parent: !find
    _type: Part
    name: PCNode1
  extend:
    deployed_parts: 
      - !promise prom_PCB2

@Wuestengecko , where are we on this issue? its been open for a while ;-)

For the last part of this (creating a matching Part when creating a Component, which currently has to be done explicitly), I was going to revive the now linked PR. But that has grown a bit beyond its original scope, so I first have to clean it up a little. But the good news is that I'm now actually working on it :)