I’m currently trying to import a data model, simple one made of Packages/Classes/Enumerations/Properties and Predefined Types. Properties are typed either with Predefined Types or imported Classes/Enumerations.
I have managed to import the Classes into imported Packages but I’m still struggling to import and allocate Properties
I dug into the helpers (org.polarsys.capella.core.data.helpers, org.polarsys.capella.core.model.helpers), without finding ones dedicated to properties creation/allocation
Could someone tell me how import Properties as attributes of Classes?
Which helpers, or whatever, to use?
You can try:
# set my_property feature
Thanks for the answer
I finally managed to import the class properties, through the getOwnedFeatures().add method as you mentionned
I did not use the creationService one (what does it do in this case?)
By the way, the Class’s primitive property getter/setter defined in the Capella.py wrapper are not correct
They are coded self.get_java_object().setPrimitive(value)/isPrimitive() whereas they should be coded self.get_java_object().setIsPrimitive(value)/isIsPrimitive()
I did not check the other class properties getters/setters (Final, Abstract)
In this specific case it probably does nothing. But I found that for other elements, like components, it’s mandatory to create corresponding parts.
I opened an issue for the Property API:
Thank you for your feedback.