Skip to content

Commit

Permalink
Fixed #213 StateTransition .get_source() and .get_target() always ret…
Browse files Browse the repository at this point in the history
…urn an empty JavaList.
  • Loading branch information
ylussaud committed Aug 6, 2024
1 parent caef934 commit 90e9b03
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
22 changes: 20 additions & 2 deletions plugins/Python4Capella/simplified_api/capella.py
Original file line number Diff line number Diff line change
Expand Up @@ -2451,12 +2451,30 @@ def get_source(self):
"""
Returns: AbstractState
"""
return capella_query_by_name(self, "Source")
value = self.get_java_object().getSource()
if value is None:
return value
else:
e_object_class = getattr(sys.modules["__main__"], "EObject")
specific_cls = e_object_class.get_class(value)
if specific_cls is None:
return None
else:
return specific_cls(value)
def get_target(self):
"""
Returns: AbstractState
"""
return capella_query_by_name(self, "Target")
value = self.get_java_object().getTarget()
if value is None:
return value
else:
e_object_class = getattr(sys.modules["__main__"], "EObject")
specific_cls = e_object_class.get_class(value)
if specific_cls is None:
return None
else:
return specific_cls(value)
def get_triggers(self) -> List[AbstractEvent]:
"""
Returns: AbstractEvent[*]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def get_source(self):
"""
Returns: AbstractState
"""
value = self.get_java_object().getSource()
if value is None:
return value
else:
e_object_class = getattr(sys.modules["__main__"], "EObject")
specific_cls = e_object_class.get_class(value)
if specific_cls is None:
return None
else:
return specific_cls(value)

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def get_target(self):
"""
Returns: AbstractState
"""
value = self.get_java_object().getTarget()
if value is None:
return value
else:
e_object_class = getattr(sys.modules["__main__"], "EObject")
specific_cls = e_object_class.get_class(value)
if specific_cls is None:
return None
else:
return specific_cls(value)

0 comments on commit 90e9b03

Please sign in to comment.