문제

I'm writing a module which writes an LDIF file,

I've a stereotype called 'User' defined by a metaclasse that have many attributs (username, password, role,..)

The problem is that I cannot access those attributs from within the module..

How should I do!

도움이 되었습니까?

해결책

Use the getValue operation. In the example below the elem has a stereotype 'EnumLiteralCodeValue' of the profile 'clbProfile' attached which has a property of type 'value'

[elem.getValue(elem.getAppliedStereotype('clbProfile::EnumLiteralCodeValue'),'value')/] 

다른 팁

In your acceleo script, you can get the stereotypes using getAppliedStereotypes :

Example (t is an UML Type in my script) :

[template public myrule (t : Type)]
[if t.getApplicableStereotypes() <> null/]
// blabla
[/if]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top