Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » UML2ECORE via adapter(OCL cannot navigate the adapters )
UML2ECORE via adapter [message #1081470] Wed, 07 August 2013 09:09 Go to next message
Amine BENELALLAM is currently offline Amine BENELALLAMFriend
Messages: 13
Registered: January 2013
Junior Member
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
Re: UML2ECORE via adapter [message #1081617 is a reply to message #1081470] Wed, 07 August 2013 13:12 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4188
Registered: July 2009
Senior Member
Hi

It's only software so I expect it's 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
Previous Topic:Simple Question about OCL indexOf operation
Next Topic:Parsing an ocl file (complete OCL) to define operations in an environment
Goto Forum:
  


Current Time: Sat Dec 20 21:41:57 GMT 2014

Powered by FUDForum. Page generated in 0.01543 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software