labs4capella / python4capella

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

PhysicalLink.get_involving_physical_paths() doesn't work #170

Closed ylussaud closed 1 year ago

ylussaud commented 1 year ago

The following implementation should work:

    def get_involving_physical_paths(self) -> List[PhysicalPath]:
        res = []
        involvements = self.get_java_object().getInvolvingInvolvements()
        physical_path_involvement_e_class = get_e_classifier("http://www.polarsys.org/capella/core/cs/" + capella_version(), "PhysicalPathInvolvement")
        physical_path_e_class = get_e_classifier("http://www.polarsys.org/capella/core/cs/" + capella_version(), "PhysicalPath")
        for involvement in involvements:
            if physical_path_involvement_e_class.isInstance(involvement) and physical_path_e_class.isInstance(involvement.getInvolver()):
                res.append(PhysicalPath(involvement.getInvolver()))
        return res
ylussaud commented 1 year ago

This should also by done for Node.get_involving_physical_paths()