Skip to content

Commit

Permalink
Fixed another case of wrong memberEnd ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Nov 16, 2024
1 parent 22e219c commit 5fe4453
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@ Class {

{ #category : 'transforming' }
OntoUMLTransformAssociation >> createAssociation [

| association |
association := OPUMLAssociation new.
association name: transformed name;
association := OPUMLAssociation new.
association
name: transformed name;
isDerived: transformed isDerived.
self tranformAssociationEnd: transformed memberEnds first forAssociation: association.
self tranformAssociationEnd: transformed memberEnds second forAssociation: association.
self copyCommentsFrom: transformed to: association.
association memberEnds addAll: association ownedEnds asArray.
^ association.
association memberEnds add: (self
tranformAssociationEnd: transformed memberEnds first
forAssociation: association).
association memberEnds add: (self
tranformAssociationEnd: transformed memberEnds second
forAssociation: association).
self copyCommentsFrom: transformed to: association.

self validateAssociation: association.

^ association
]

{ #category : 'transforming' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ OntoUMLTransformComposition >> createComposition [
withEndType: transformed specific
withOpposingEnd: transformed general
navigable: true).
self assert: composition memberEnds size = 2 description: [
'Generated association has only 1 end. '
, (transformer transformed generalizations size = 1
ifTrue: [
' Might be caused by generalization set with only 1 generalization' ]
ifFalse: [ '' ]) ].

self validateAssociation: composition.

^ composition
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ OntoUMLTransformGeneralizationSet >> createCompositionWithSource: aSource withTa
self createCompositionEndFor: composition withEndType: aSource withOpposingEnd: aTarget navigable: true.
self createCompositionEndFor: composition withEndType: aTarget withOpposingEnd: aSource navigable: false.
composition memberEnds addAll: composition ownedEnds.

self validateAssociation: composition.

^ composition.
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,11 @@ OntoUMLTransformation >> transformer: anObject [

transformer := anObject
]

{ #category : 'as yet unclassified' }
OntoUMLTransformation >> validateAssociation: anAssociation [

OPUmlAssociationController new
model: anAssociation;
validate
]

0 comments on commit 5fe4453

Please sign in to comment.