labs4capella / python4capella

Python for Capella
Eclipse Public License 2.0
52 stars 10 forks source link

Wrong method in capella.py class OperationalActivity #201

Closed mc2172 closed 2 weeks ago

mc2172 commented 8 months ago

The OperationalActivity method get_involving_operational_processes:

        def get_involving_operational_processes(self) -> List[OperationalProcess]:
        """
        Returns: OperationalProcess[*]
        """
        return create_e_list(self.get_java_object().getInvolvingOperationalProcesses(), OperationalProcess)

returns an exception for invocation of non existed method getOperationalProcess(). The Java OperationaActivityImpl extends the AbstractFunctionImpl class which defined the generic method getInvolvingFunctionalChains(), which should be used instead. Therefore capella.py should be modified as follows:

        def get_involving_operational_processes(self) -> List[OperationalProcess]:
        """
        Returns: OperationalProcess[*]
        """
        return create_e_list(self.get_java_object().getInvolvingFunctionalChains(), OperationalProcess)
ylussaud commented 2 weeks ago

There is an issue with the implementation of get_involving_operational_processes(), I'll fix it. But your fix is not related, you could use the method get_involving_functional_chains().