Applying a PropertyValue that is defined in PVMT Add-on to a new Component

Hi Yvan,

thank you for the quick answer, this works perfectly :slight_smile:

What I can’t figure out though is how to afterwards set the property value in case of an enum. I found this thread where you suggested the following solution:

@staticmethod
def set_p_v_value(elem, PVName, value):
    for group in elem.get_java_object().getOwnedPropertyValueGroups():
        for pv in group.getOwnedPropertyValues():
            if PVName == pv.getName():
                if isinstance(java_object, JavaObject):
                    pv.setValue(value.get_java_object())
                else:
                    pv.setValue(value)
                return

What exactly is ‘java_object’? is this supposed to be ‘value’?

Under this assumption I still get the following error:

py4j.Py4JException: Method setValue([class java.lang.String]) does not exist

This is for pv of type org.polarsys.capella.core.data.capellacore.impl.EnumerationPropertyValueImpl

I think that I still missing something here. Do I need to provide the new value as type org.polarsys.capella.core.data.capellacore.impl.EnumerationPropertyLiteralImpl?

Kind regards

Janis