예제 #1
0
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)
예제 #2
0
def copy_class(element):
    yield element.id, copy_named_element(element)
    for feature in itertools.chain(
            element.ownedAttribute,
            element.ownedOperation,
    ):
        yield from copy(feature)
예제 #3
0
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)
예제 #4
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],
    )
예제 #5
0
def copy_association(element: Association):
    yield element.id, copy_named_element(element)
    for end in element.memberEnd:
        yield from copy(end)
예제 #6
0
def copy_operation(element: Operation):
    yield element.id, copy_named_element(element)
    for feature in element.ownedParameter:
        yield from copy(feature)
예제 #7
0
def copy_transition(element: Transition):
    yield element.id, copy_named_element(element)
    if element.guard:
        yield from copy(element.guard)
예제 #8
0
def copy_connector(element: Connector):
    yield element.id, copy_named_element(element)
    for end in element.end:
        yield from copy(end)
예제 #9
0
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)
예제 #10
0
def copy_execution_specification(element: ExecutionSpecification):
    yield element.id, copy_named_element(element)
    for occurrence in element.executionOccurrenceSpecification:
        yield from copy(occurrence)
예제 #11
0
def copy_association(element: Association):
    return AssociationCopy(
        element_copy=copy_named_element(element),
        member_ends=[copy_element(end) for end in element.memberEnd],
    )