Allocate Functional Exchange to a Component Exchange

Hello everybody,

I’m trying to allocate one or many functional exchange(s) to a component exchange. I found on the documentation that the get/set are available:

But I can only find the ‘get_allocated_functional_exchanges()’ in the API.

I’ve search for many other option but always unsuccessful :frowning:
If anyone can help me on this !
Thank you

You need to use the Java API because the Python API is the result of the semantic browser query:

myComponentExchange = ...
myfunctionalExchange = ...


More information on passing from and to the Java API in the tips and tricks.

Thank you for your answer, I’ve tried this one too but it returns me this error:

at org.eclipse.emf.common.util.BasicEList$UnmodifiableEList.add(
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at java.base/java.lang.reflect.Method.invoke(
at py4j.reflection.MethodInvoker.invoke(
at py4j.reflection.ReflectionEngine.invoke(
at py4j.Gateway.invoke(
at py4j.commands.AbstractCommand.invokeMethod(
at py4j.commands.CallCommand.execute(
at py4j.ClientServerConnection.sendCommand(
at py4j.CallbackClient.sendCommand(
at py4j.CallbackClient.sendCommand(
at py4j.reflection.PythonProxyHandler.invoke(
at jdk.proxy12/jdk.proxy12.$Proxy25.executeScript(Unknown Source)
at org.eclipse.ease.lang.python.py4j.internal.Py4jScriptEngine.internalExecute(
at org.eclipse.ease.lang.python.py4j.internal.Py4jScriptEngine.execute(
at org.eclipse.ease.AbstractScriptEngine.inject(

It seems like I can’t modify this attribute.

I’ve found this on “FunctionalAnalysis.ecore”


maybe i need to find the EStructuratFeature that can be modified, but how can I do that ?

After diving a bit deeper in the Capella metamodel, I think we need to create a ComponentExchangeFunctionalExchangeAllocation:

myComponentExchange = ...
myfunctionalExchange = ...

allocation = create_e_object("" + capella_version(), "ComponentExchangeFunctionalExchangeAllocation")


Thank you Yvan, it’s working !

The fuctionnal exchange is allocated in the model, the last problem is its visual representation that is not working:

We need to do the port allocation I guess. We can call the Capella code to do so:

org.polarsys.capella.core.model.helpers.ComponentExchangeExt.synchronizePortAllocations(myComponentExchange.get_java_object(), myfunctionalExchange.get_java_object())

You will have an error in the PyDev editor on the org symbol. You can ignore it or configure PyDev to ignore it.

It’s all good with this one

Thank you very much !

1 Like

I also discovered new things about Capella :wink: