def copy_operation(element: Operation): yield element.id, copy_named_element(element) for feature in itertools.chain( element.formalParameter, element.returnResult, ): yield from copy(feature)
def copy_class(element): yield element.id, copy_named_element(element) for feature in itertools.chain( element.ownedAttribute, element.ownedOperation, ): yield from copy(feature)
def copy_state(element: State): yield element.id, copy_named_element(element) if element.entry: yield from copy(element.entry) if element.exit: yield from copy(element.exit) if element.doActivity: yield from copy(element.doActivity)
def copy_class(element): return ClassCopy( element_copy=copy_named_element(element), owned_attributes=[ copy_element(attr) for attr in element.ownedAttribute if not attr.association ], owned_parameters=[ copy_element(oper) for oper in itertools.chain( element.ownedOperation[:].formalParameter, element.ownedOperation[:].returnResult, ) ], owned_operations=[copy_element(oper) for oper in element.ownedOperation], )
def copy_association(element: Association): yield element.id, copy_named_element(element) for end in element.memberEnd: yield from copy(end)
def copy_operation(element: Operation): yield element.id, copy_named_element(element) for feature in element.ownedParameter: yield from copy(feature)
def copy_transition(element: Transition): yield element.id, copy_named_element(element) if element.guard: yield from copy(element.guard)
def copy_connector(element: Connector): yield element.id, copy_named_element(element) for end in element.end: yield from copy(end)
def copy_message(element: Message): yield element.id, copy_named_element(element) if element.sendEvent: yield from copy(element.sendEvent) if element.receiveEvent: yield from copy(element.receiveEvent)
def copy_execution_specification(element: ExecutionSpecification): yield element.id, copy_named_element(element) for occurrence in element.executionOccurrenceSpecification: yield from copy(occurrence)
def copy_association(element: Association): return AssociationCopy( element_copy=copy_named_element(element), member_ends=[copy_element(end) for end in element.memberEnd], )