[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] How to set TYPE in UMl models


Hi Friends
I am felling problem in assigning type to UML class diagram attribute. Consider the example


helper def: primitiveTypeMap : Map(String, String) =
Map {
('String', 'pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#string'),
('Integer', 'pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#int'),
('Boolean', 'pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#boolean'),
('Comment', 'pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#string')


};

lazy rule CreateAttribute{
from
de : DDMM!DataElement
to
out : CDMM!Property(
name <- de.name,
defaultValue <- new_dValue,
visibility <- #public,
type <- new_dataType ),
new_dValue:CDMM!LiteralString(
value<- de.getElementValue(de)
)
,
new_dataType : CDMM!PrimitiveType(
name <- thisModule.primitiveTypeMap.get(de.valueSpecification.name)


)
}
Here CDMM is a UML Metamodel and i want to create a property for a class but i cannot find a way how to assign primitive type or user define type for property. In the above i want to create property for my each defined data element. In XMI , if i assign type in this way then generated output is like that.


Excerpt of Output File :

<ownedAttribute xmi:id="_yor48TIKEd226PNED25asQ" name="TelephoneNumber" visibility="public" type="_yo1p8DIKEd226PNED25asQ">
<defaultValue xmi:type="uml:LiteralString" xmi:id="_yor48jIKEd226PNED25asQ" value="false"/>
</ownedAttribute>


<uml:DataType xmi:id="_ymTTUzIKEd226PNED25asQ" name="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#string"/>
<uml:DataType xmi:id="_yo1p8DIKEd226PNED25asQ" name="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#boolean"/>
<uml:DataType xmi:id="_ynfmIzIKEd226PNED25asQ" name="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#int"/>



In this UML data Type produces repeatedly , can anyone help me out to sort that issue. or any example in whihc UML model is generated from some other model for instance table2Class etc I am a new user in ATL .
Thanks in Advance.