uml:Extension support [message #1274390] |
Fri, 21 March 2014 08:01  |
Eclipse User |
|
|
|
There is an OCL invariant in my profile:
let standardId : String = getValue(getAppliedStereotype('EECProfile::EECDataModel'), 'standardId').oclAsType(String) in
let ss : Package = allOwningPackages()->any(getAppliedStereotype('EECProfile::NamespaceSubset') <> null) in
standardId <> null and standardId.size() > 0 and ss <> null
implies
standardId.substring(1, 8) = ss.oclAsType(Package).extension_EECDataModel.standardId.concat('-')
It works fine in Rational Software Architect. But Eclipse OCL parsers says:
Unrecognized variable: (extension_EECDataModel)
extension_EECDataModel is an association between uml:Package and EECDataModel (uml:Stereotype):
<packagedElement xmi:type="uml:Stereotype" xmi:id="_QhZAwPQoEeK4sawTC9jIzA" name="EECDataModel">
<ownedAttribute xmi:id="_xnYL0P2MEeK7ttZiuYmhaw" name="base_Package" association="_xnWWoP2MEeK7ttZiuYmhaw">
<eAnnotations xmi:id="_6wTfMP2MEeK7ttZiuYmhaw" source="uml2.extensions">
<details xmi:id="_6wTfMf2MEeK7ttZiuYmhaw" key="addedInVersion" value="205"/>
</eAnnotations>
<type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Package"/>
</ownedAttribute>
</packagedElement>
...
<packagedElement xmi:type="uml:Extension" xmi:id="_xnWWoP2MEeK7ttZiuYmhaw" name="Package_EECDataModel" memberEnd="_xnW9sP2MEeK7ttZiuYmhaw _xnYL0P2MEeK7ttZiuYmhaw">
<eAnnotations xmi:id="_6wUGQv2MEeK7ttZiuYmhaw" source="uml2.extensions">
<details xmi:id="_6wUGQ_2MEeK7ttZiuYmhaw" key="addedInVersion" value="205"/>
</eAnnotations>
<ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_xnW9sP2MEeK7ttZiuYmhaw" name="extension_EECDataModel" type="_QhZAwPQoEeK4sawTC9jIzA" aggregation="composite" association="_xnWWoP2MEeK7ttZiuYmhaw">
<eAnnotations xmi:id="_6wUGRP2MEeK7ttZiuYmhaw" source="uml2.extensions">
<details xmi:id="_6wUGRf2MEeK7ttZiuYmhaw" key="addedInVersion" value="205"/>
</eAnnotations>
<lowerValue xmi:type="uml:LiteralInteger" xmi:id="_xnXkwP2MEeK7ttZiuYmhaw" value="1">
<eAnnotations xmi:id="_6wUGRv2MEeK7ttZiuYmhaw" source="uml2.extensions">
<details xmi:id="_6wUGR_2MEeK7ttZiuYmhaw" key="addedInVersion" value="205"/>
</eAnnotations>
</lowerValue>
</ownedEnd>
</packagedElement>
Is there a work around to add a support for such associations? It's very strange that it works in RSA... I think it use Eclipse OCL too.
|
|
|
|
|
|
|
|
|
Re: uml:Extension support [message #1276189 is a reply to message #1275790] |
Mon, 24 March 2014 03:57  |
Eclipse User |
|
|
|
Thanks!
I've renamed TTDataModel package to distinguish it from the model itself. And it works in OCL 4.1.1.v20140210-1137 and UML 4.1.2.v20140202-2055!
(I don't insist on this point, but I don't think that it's wrong to have multiple same-named packages within one model. It's only wrong to have multiple indistinguishable objects within one namespace (same-named packages owned by one package, same-named properties owned by one class, ...). Maybe packages must be merged by a fully qualified names?)
But it still doesn't work in OCL and UML 5.
Is it wrong to use extension_EECDataModel or is there something broken in UML and OCL 5? What is a right way to access the extension? According to your last message uml:Package doesn't have an extension_EECDataModel association and instead of
pkg.extension_EECDataModel.standardId
I should write:
pkg.getValue(getAppliedStereotype('EECProfile::EECDataModel'), 'standardId').oclAsType(String)
But the former works in UML/OCL 4 and also here is an example of an extension_* usage (lines 2397, 2404, ...):
http://www1.unece.org/cefact/platform/download/attachments/44204303/Specification_UMM_Base_Module_V2.0_TechnicalSpecification.pdf
And also I think that once extension_EECDataModel is defined in a model it should be accessible somehow.
|
|
|
Powered by
FUDForum. Page generated in 0.04908 seconds