i am attempting to get the allocated functions from a deployed physical component as shown below:
for dpc in selected_elem.get_deployed_physical_components():
all_pf = dpc.get_allocated_physical_functions()
I have added the above functions to the capella api(to both capella element and physical component) and ‘selected elem’ in this case is a physical component using the get first selected element method to run my script.
I am aware that for this physical component there is only one deployed component, but my error message appears as follows:
AttributeError: ‘JavaMember’ object has no attribute ‘get_allocated_physical_functions’
I ran these print statements and this is what i got:
starting export of model Distributed Systems
<class ‘tuple’>
<class ‘py4j.java_gateway.JavaMember’>
<py4j.java_gateway.JavaMember object at 0x000001638524E048>
False
org.eclipse.ease.ScriptExecutionException: Traceback (most recent call last):
File “L/Python4Capella/sample_scripts/FFMEAExportPhysicalComponentScript.py”, line 348, in
if k.startswith(‘EASE’) or ((not k.startswith('’)) and (not k.startswith(‘pyease’)) and (not v.class.module.startswith(‘py4j.’)) and (not hasattr(v, ‘ease’)) and (not v.class.name == ‘module’))
File “L/Python4Capella/sample_scripts/FFMEAExportPhysicalComponentScript.py”, line 285, in main
File “L/Python4Capella/sample_scripts/FFMEAExportPhysicalComponentScript.py”, line 165, in PhysicalFunctionName
self.engine = engine
AttributeError: ‘JavaMember’ object has no attribute ‘get_allocated_physical_functions’
I have been implementing it two ways, the above error was without the create elist part and now that i added the elist part i am getting the error as shown below:
<class ‘main.JavaList’>
org.eclipse.ease.ScriptExecutionException: Traceback (most recent call last):
File “L/Python4Capella/sample_scripts/FFMEAExportPhysicalComponentScript.py”, line 348, in
if k.startswith(‘EASE’) or ((not k.startswith('’)) and (not k.startswith(‘pyease’)) and (not v.class.module.startswith(‘py4j.’)) and (not hasattr(v, ‘ease’)) and (not v.class.name == ‘module’))
File “L/Python4Capella/sample_scripts/FFMEAExportPhysicalComponentScript.py”, line 285, in main
File “L/Python4Capella/sample_scripts/FFMEAExportPhysicalComponentScript.py”, line 161, in PhysicalFunctionName
‘’’
File “L/Python4Capella/java_api/Java_API.py”, line 40, in iter
_pyease_integer_types = (int, long)
AttributeError: ‘JavaMember’ object has no attribute ‘iterator’