Esempio n. 1
0
def copy_message(element: Message):
    return MessageCopy(
        element_copy=copy_element(element),
        send_event=copy_element(element.sendEvent)
        if element.sendEvent else None,
        receive_event=copy_element(element.receiveEvent)
        if element.receiveEvent else None,
    )
Esempio n. 2
0
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],
    )
Esempio n. 3
0
def copy_transition(element: Transition):
    return TransitionCopy(
        transition=copy_element(element),
        guard=copy_element(element.guard) if element.guard else None,
    )
Esempio n. 4
0
def copy_connector_end(element: ConnectorEnd):
    yield element.id, copy_element(element)
    if element.partWithPort:
        yield from copy(element.partWithPort)
Esempio n. 5
0
def copy_association(element: Association):
    return AssociationCopy(
        element_copy=copy_named_element(element),
        member_ends=[copy_element(end) for end in element.memberEnd],
    )
Esempio n. 6
0
def copy_connector(element: Connector):
    return ConnectorCopy(
        element_copy=copy_element(element),
        ends=[copy_element(end) for end in element.end],
        ports=[copy_element(port) for port in element.end[:].partWithPort],
    )