I currently doing some model transformations using EMF-UML-Implementation.
In my model transformation I create an uml class with some attributes. The attributes are type of enumerations I also created.
Some of the attribute should get a default value. The default value should be enumeration literals.
The question now is, how do I get the enumeration literals to the defaultValue-property of the Property.
I already have found that I have to use ValueSpecification. But the UML superstructure says not much about that (page 139 f.). Which properties do I have to use for setting the defaultValue to enumeration literals?
I think the main problem I have is, that the use of ValueSpecification is unclear to me. Currently I only use default to set the default values, which is type of String.
The
defaultValue-property takes aValueSpecificationargument. So in your case, you need anInstanceValuefor this purpose (which derives fromValueSpecification). TheInstanceValueitself has aninstance-property, which takes anInstanceSpecificationas argument. AsEnumerationLiteralderives fromInstanceSpecification, you can now simply assign one of yourEnumerationLiteralsto it.