Home » Archived » M2M (model-to-model transformation) » [ATL] Property type/association values lost during transformation
[ATL] Property type/association values lost during transformation [message #101242] |
Fri, 06 March 2009 15:03 |
Ronan B Messages: 273 Registered: July 2009 |
Senior Member |
|
|
Hi,
I'm doing a UML->UML transformation. Surprisingly some of my property
types are not showing up in the target model. They appear in the XMI of
the target but don't show up in the UML2 editor.
My transform is as follows....
rule CopyClass {
from s : UML!Class (s.oclIsTypeOf(UML!Class))
to t : UML!Class
(
classifierBehavior <-s.classifierBehavior ,
clientDependency <-s.clientDependency ,
collaborationUse <-s.collaborationUse ,
eAnnotations <-s.eAnnotations ,
elementImport <-s.elementImport ,
general <-s.general ,
generalization <-s.generalization ,
interfaceRealization <-s.interfaceRealization ,
isAbstract <-s.isAbstract ,
isActive <-s.isActive ,
isLeaf <-s.isLeaf ,
name <-s.name ,
nameExpression <-s.nameExpression ,
nestedClassifier <-s.nestedClassifier ,
ownedAttribute <-s.ownedAttribute ,
ownedBehavior <-s.ownedBehavior ,
ownedComment <-s.ownedComment ,
ownedConnector <-s.ownedConnector ,
ownedOperation <-s.ownedOperation ,
ownedPort <-s.ownedPort ,
ownedReception <-s.ownedReception ,
ownedRule <-s.ownedRule ,
ownedTemplateSignature <-s.ownedTemplateSignature ,
ownedTrigger <-s.ownedTrigger ,
ownedUseCase <-s.ownedUseCase ,
owningTemplateParameter <-s.owningTemplateParameter ,
package <-s.package ,
packageImport <-s.packageImport ,
powertypeExtent <-s.powertypeExtent ,
redefinedClassifier <-s.redefinedClassifier ,
representation <-s.representation ,
substitution <-s.substitution ,
superClass <-s.superClass ,
templateBinding <-s.templateBinding ,
templateParameter <-s.templateParameter ,
useCase <-s.useCase ,
visibility <-s.visibility
)
}
rule CopyPropertyWithType {
from s : UML!Property (s.oclIsTypeOf(UML!Property) and (not
s.type.oclIsUndefined()))
to t : UML!Property
(
aggregation <- s.aggregation,
association <- s.association,
associationEnd <- s.associationEnd,
clientDependency <- s.clientDependency,
datatype <- s.datatype,
default <- s.default,
defaultValue <- s.defaultValue,
deployment <- s.deployment,
eAnnotations <- s.eAnnotations,
end <- s.end,
isComposite <- s.isComposite,
isDerived <- s.isDerived,
isDerivedUnion <- s.isDerivedUnion,
isLeaf <- s.isLeaf,
isOrdered <- s.isOrdered,
isReadOnly <- s.isReadOnly,
isStatic <- s.isStatic,
isUnique <- s.isUnique,
lower <- s.lower,
lowerValue <- s.lowerValue,
name <- s.name,
nameExpression <- s.nameExpression,
opposite <- s.opposite,
ownedComment <- s.ownedComment,
owningAssociation <- s.owningAssociation,
owningTemplateParameter <- s.owningTemplateParameter,
qualifier <- s.qualifier,
redefinedProperty <- s.redefinedProperty,
subsettedProperty <- s.subsettedProperty,
templateParameter <- s.templateParameter,
type <- s.type,
upper <- s.upper,
upperValue <- s.upperValue,
visibility <- s.visibility
)
}
The output XMI has the data for the type/association as follows...
<packagedElement xsi:type="uml:Class" name="Areas" visibility="protected">
<ownedAttribute name="AreasId" visibility="protected" type="/1/String">
<upperValue xsi:type="uml:LiteralUnlimitedNatural" value="1"/>
<lowerValue xsi:type="uml:LiteralInteger" value="1"/>
</ownedAttribute>
<ownedAttribute name="_plmn" visibility="public" type="/0/Logical
View/ONRM_description/ONRM/Areas/Plmn" isUnique="false"
association="/0/Logical
View/ONRM_description/ONRM/Areas/@packagedElement.6">
<upperValue xsi:type="uml:LiteralUnlimitedNatural" value="10"/>
<lowerValue xsi:type="uml:LiteralInteger"/>
</ownedAttribute>
</packagedElement>
The values in the type/association are correct with respect to the rest of
the model but just don't appear in the editor. In fact they show as errors
i.e. undefined
Any ideas?
Thanks,
Ronan
|
|
|
Re: [ATL] Property type/association values lost during transformation [message #101280 is a reply to message #101242] |
Fri, 06 March 2009 18:36 |
Ronan B Messages: 273 Registered: July 2009 |
Senior Member |
|
|
Okay I forgot to put in the special __xmiID__ identifier in the transform.
Perhaps this property should show up in the intellisense feature of the
ATL editor? This would avoid others making this mistake. For future
reference you need to do the following for each rule...
rule CopyClass {
from s : UML!Class (s.oclIsTypeOf(UML!Class))
to t : UML!Class
(
__xmiID__ <- s.__xmiID__,
classifierBehavior <-s.classifierBehavior ,
clientDependency <-s.clientDependency ,
collaborationUse <-s.collaborationUse ,
eAnnotations <-s.eAnnotations,
elementImport <-s.elementImport ,
general <-s.general ,
generalization <-s.generalization ,
interfaceRealization <-s.interfaceRealization ,
isAbstract <-s.isAbstract ,
isActive <-s.isActive ,
isLeaf <-s.isLeaf ,
name <-s.name ,
nameExpression <-s.nameExpression ,
nestedClassifier <-s.nestedClassifier ,
ownedAttribute <-s.ownedAttribute ,
ownedBehavior <-s.ownedBehavior ,
ownedComment <-s.ownedComment ,
ownedConnector <-s.ownedConnector ,
ownedOperation <-s.ownedOperation ,
ownedPort <-s.ownedPort ,
ownedReception <-s.ownedReception ,
ownedRule <-s.ownedRule ,
ownedTemplateSignature <-s.ownedTemplateSignature ,
ownedTrigger <-s.ownedTrigger ,
ownedUseCase <-s.ownedUseCase ,
owningTemplateParameter <-s.owningTemplateParameter ,
package <-s.package ,
packageImport <-s.packageImport ,
powertypeExtent <-s.powertypeExtent ,
redefinedClassifier <-s.redefinedClassifier ,
representation <-s.representation ,
substitution <-s.substitution ,
superClass <-s.superClass ,
templateBinding <-s.templateBinding ,
templateParameter <-s.templateParameter ,
useCase <-s.useCase ,
visibility <-s.visibility
)
}
|
|
|
Goto Forum:
Current Time: Wed May 08 01:46:05 GMT 2024
Powered by FUDForum. Page generated in 0.03658 seconds
|