Attribute with derived value [message #690867] |
Thu, 30 June 2011 06:49  |
Eclipse User |
|
|
|
Hello,
I have a derived attribute to calculate, the solution that I have found is to add ocl constraint to my model,
The derived value is specified by an EStructuralFeature EAnnotation with:
Source = "http://www.eclipse.org/emf/2002/Ecore/OCL"
Key = "derivation"
Value = ...the OCL expression..
But when on runtime workbench when I validate, the value of attribute wouldn't be calculate,
Is there a way to calculate the value of my derived attribute.
thanks,
regards.
|
|
|
Re: Attribute with derived value [message #690957 is a reply to message #690867] |
Thu, 30 June 2011 09:15   |
Eclipse User |
|
|
|
Hi Emna,
have you added an annotation to the enclosing EPackage that activates the OCL setting delegate? It's explained, e.g., here: http://www.slideshare.net/EdWillink/enriching-withocl (see slide #36). You may also use the OCLInEcore editor to textually edit your Ecore models. In this case, the delegate annotations will, as far as I know, be added automatically for you. Ed may have more details.
Anyway, the annotation source URI to be used on the EPackage is http://www.eclipse.org/emf/2002/Ecore, the key is "invocationDelegates" and the value is "http://www.eclipse.org/emf/2002/Ecore/OCL".
Cheers,
-- Axel
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03504 seconds