Hi all !
I have a tool that interprets Ecore/OCL models and documents for a specific purpose.
I want to develop a similar solution for UML/OCL models based on the first tool, so I use adapters to adapt uml to emf interfaces.
This approach worked fine for raw uml models (without OCL). when I introduce OCL the interpretation fails and returns the following error while parsing the OCL document :
org.eclipse.ocl.SemanticException: Unrecognized variable: (referee)
at org.eclipse.ocl.util.OCLUtil.checkForErrors(OCLUtil.java:358)
at org.eclipse.ocl.util.OCLUtil.checkForErrors(OCLUtil.java:328)
at org.eclipse.ocl.internal.helper.HelperUtil.checkForErrors(HelperUtil.java:518)
at org.eclipse.ocl.internal.helper.HelperUtil.parseInvariant(HelperUtil.java:207)
at org.eclipse.ocl.internal.helper.OCLHelperImpl.createInvariant(OCLHelperImpl.java:216)
at org.eclipse.ocl.ecore.OCLHelperImpl.createInvariant(OCLHelperImpl.java:75)
at org.eclipse.ocl.ecore.OCLHelperImpl.createInvariant(OCLHelperImpl.java:1)
I think that the OCLHelper fails to navigate the Resourceadapter (which is in reality an UMLResource inset into a resource Instance).
is there something wrong with this solution? is it feasible ?
But I have pursued adapter approaches myself, and found that there can
be an ambiguity around getID as to whether the adapted/adapting object
is required. This difficulty lies at the heart of EMF algorithms.
Empirical workrounds may not always succeed.
If you want to work with UML and Ecore you might consider using the new
Pivot-based EClipse OCL where the Ecore/UML/... metamodels are
normalised to a Pivot representation so that the OCL engine is more
independent of the external model. The PIvot represenmtation is coded as
an adapter on what it came from although use of the adpters has not been
activated.
Regards
Ed Willink
On 07/08/2013 10:09, Amine BEN wrote:
> Hi all !
> I have a tool that interprets Ecore/OCL models and documents for a
> specific purpose.
> I want to develop a similar solution for UML/OCL models based on the
> first tool, so I use adapters to adapt uml to emf interfaces. This
> approach worked fine for raw uml models (without OCL). when I
> introduce OCL the interpretation fails and returns the following error
> while parsing the OCL document :
>
> org.eclipse.ocl.SemanticException: Unrecognized variable: (referee)
> at org.eclipse.ocl.util.OCLUtil.checkForErrors(OCLUtil.java:358)
> at org.eclipse.ocl.util.OCLUtil.checkForErrors(OCLUtil.java:328)
> at
> org.eclipse.ocl.internal.helper.HelperUtil.checkForErrors(HelperUtil.java:518)
> at
> org.eclipse.ocl.internal.helper.HelperUtil.parseInvariant(HelperUtil.java:207)
> at
> org.eclipse.ocl.internal.helper.OCLHelperImpl.createInvariant(OCLHelperImpl.java:216)
> at
> org.eclipse.ocl.ecore.OCLHelperImpl.createInvariant(OCLHelperImpl.java:75)
> at
> org.eclipse.ocl.ecore.OCLHelperImpl.createInvariant(OCLHelperImpl.java:1)
>
> I think that the OCLHelper fails to navigate the Resourceadapter
> (which is in reality an UMLResource inset into a resource Instance).
>
> is there something wrong with this solution? is it feasible ?
>
> Thank you in advance