Hi everyone,
I’m trying to create a Component Exchange
in Capella using Python4Capella, but I can’t seem to properly set the Kind
and Orientation
attributes. The syntax I use directly assigns these attributes.
Interestingly, when I print print(pfip.Orientation)
, it correctly shows IN
, but the element in Capella always appears as UNSET
.
Here’s an example of my code snippet:
cmp_S = find_logical_component_by_name("LC 7",se)
cmp_D = find_logical_component_by_name("LC 8",se)
fe = ComponentExchange()
fe.set_name('test-' + str(myRow))
fe.name='test-' + str(myRow)
fe.Kind = 'FLOW'
lc_root.get_java_object().getOwnedComponentExchanges().add(fe.get_java_object())
pfip = ComponentPort()
pfip.Kind = 'FLOW'
pfip.Orientation='IN'
print(pfip.Orientation)
BehavioralComponent(cmp_S).get_java_object().getOwnedFeatures().add(pfip.get_java_object())
pfop = ComponentPort()
pfop.Kind = 'FLOW'
pfop.Orientation='OUT'
BehavioralComponent(cmp_D).get_java_object().getOwnedFeatures().add(pfop.get_java_object())
print(pfop.Orientation)
fe.get_java_object().setSource(pfip.get_java_object())
fe.get_java_object().setTarget(pfop.get_java_object())
Does anyone know why the values are not properly applied in Capella? Is there an additional step I might be missing?
Thanks in advance for your help!