|
|
|
|
Re: Read the value of properties of stereotype in Acceleo [message #1808608 is a reply to message #1808575] |
Thu, 27 June 2019 13:50   |
Eclipse User |
|
|
|
Thanks Ed Willink you alway help me very well. Your given link help me.
i used the following code and it resolved my problem very well
[ '[' /]Column(TypeName = "[p.getTaggedValue(p, p.getApplicableStereotype('PropertiesProfile::dbtypes').qualifiedName, 'datatype')/]([p.getTaggedValue(p, p.getApplicableStereotype('PropertiesProfile::dbtypes').qualifiedName, 'length')/])")[ ']' /]
[query public getTaggedValue(stereotypedElement : Element, stereotypeName : String, propertyName : String) : OclAny =
let stereotype : Stereotype = stereotypedElement.getAppliedStereotype(stereotypeName) in
if not stereotype.oclIsUndefined() then
if propertyName ='datatype' then
stereotypedElement.getValue(stereotype, propertyName).oclAsType(EnumerationLiteral).name
else
stereotypedElement.getValue(stereotype, propertyName)
endif
else
null
endif/]
Thanks again for your help
[Updated on: Thu, 27 June 2019 13:51] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04732 seconds