DSD-DBS / py-capellambse

A Python 3 headless implementation of the Capella modeling tool.
https://dsd-dbs.github.io/py-capellambse/
Apache License 2.0
52 stars 10 forks source link

Declarative modelling : Problems when declaring new functions / components #400

Open olive2205 opened 5 months ago

olive2205 commented 5 months ago

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 :

I hope this will help you,

Thanks

vik378 commented 5 months ago

@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

olive2205 commented 5 months ago

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
vik378 commented 4 months ago

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

Wuestengecko commented 4 months ago

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 :)