Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » EssentialOCL creation, loading and parsing
EssentialOCL creation, loading and parsing [message #1369035] Tue, 20 May 2014 11:43 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

I have an ecore model, i can convert it to pivot and i want to further convert it to essentialocl document (may be i require one .essentialocl for every OCL expression in Ecore). There is not much help available regarding creating/loading and parsing .essentialocl file. Is there any help material for this. (I have succefully used .oclinecore and .ocl but i need something for single ocl expression).

Is there any help material available?

cheers,
Re: EssentialOCL creation, loading and parsing [message #1371118 is a reply to message #1369035] Wed, 21 May 2014 08:16 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
On 20/05/2014 13:43, ModelGeek Mising name wrote:
> Hi,
>
> I have an ecore model, i can convert it to pivot and i want to further
> convert it to essentialocl document (may be i require one .essentialocl
> for every OCL expression in Ecore). There is not much help available
> regarding creating/loading and parsing .essentialocl file. Is there any
> help material for this. (I have succefully used .oclinecore and .ocl but
> i need something for single ocl expression).

Maybe you can look at the interactive pivot console?
Re: EssentialOCL creation, loading and parsing [message #1371199 is a reply to message #1371118] Wed, 21 May 2014 09:04 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
On 21/05/2014 09:16, Felix Dorner wrote:
> On 20/05/2014 13:43, ModelGeek Mising name wrote:
>> Hi,
>>
>> I have an ecore model, i can convert it to pivot and i want to further
>> convert it to essentialocl document (may be i require one .essentialocl
>> for every OCL expression in Ecore). There is not much help available
>> regarding creating/loading and parsing .essentialocl file. Is there any
>> help material for this. (I have succefully used .oclinecore and .ocl but
>> i need something for single ocl expression).
>
> Maybe you can look at the interactive pivot console?
>
And in the latest code, the debugger launch converts the OCL expression
to a Complete OCL document for debug.

The problem with the minimal *.essentialocl is that it has no import
capability so you need to ensure that the surrounding infrastructure
provides the relevant models.

The documentation in the OCL Documentation is quite substantial, but
there could be a very great deal more. One day.

You explain your non-working solution. In my experience the attempt to
make such solutions work underpins many failures in the engineering
industry. You/I need to understand the problem first so that you/I can
choose the most appropriate solution rather than pursuing the usually
misguided instinct of someone unfamiliar with the domain.

Regards

Ed Willink
Re: EssentialOCL creation, loading and parsing [message #1384685 is a reply to message #1371199] Fri, 30 May 2014 11:02 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Here comes the plugin project (Please run this as eclipse application and please ignore the GUI part).

I am trying to re-factor an OCL statement and i want to know the position of specific property call. I want to create ".essentialocl" document so i can use
org.eclipse.xtext.nodemodel.util.NodeModelUtils.getNode(elemcs).getOffset(); to get the positioning of any property call for a single OCL statement. I have tried .oclinecore but it is not what i am looking for. I did the refactor in classic OCL and now i want to do it using pivot and xtext. (Ed advised me to use .essentialocl for this : http://www.eclipse.org/forums/index.php/mv/msg/711483/1342263/#msg_1342263)



Please run the plugin and console will show exception.
when i try to save the model as ".essentialocl" then i get the following exception. PivotOCL.java is the class and "saveEssentialOCL" is the operation.

org.eclipse.xtext.validation.IConcreteSyntaxValidator$InvalidConcreteSyntaxException: These errors need to be fixed before the model can be serialized.
RootPackageCS.ownedImport[0]->ImportCS'ecore'.pathName->PathNameCS.path[0]->PathElementWithURICS: An object of type PathElementCS is needed instead of PathElementWithURICS for serialization with rule NextPathElementCS.
RootPackageCS.ownedImport[0]->ImportCS'ecore'.pathName->PathNameCS.path[0]->PathElementWithURICS: An object of type PathElementCS is needed instead of PathElementWithURICS for serialization with rule FirstPathElementCS.
RootPackageCS.ownedNestedPackage[0]->PackageCS'temp'.ownedType[0]->ClassCS'TestClass'.ownedProperty[0]->AttributeCS't1'.ownedType->TypedTypeRefCS: An object of type TupleTypeCS or TypeNameExpCS or CollectionTypeCS or PrimitiveTypeRefCS is needed instead of TypedTypeRefCS for serialization with rule TypeExpCS.
RootPackageCS.ownedNestedPackage[0]->PackageCS'temp'.ownedType[0]->ClassCS'TestClass'.ownedProperty[0]->AttributeCS't1'.ownedType->TypedTypeRefCS: An object of type TupleTypeCS or CollectionTypeCS or PrimitiveTypeRefCS is needed instead of TypedTypeRefCS for serialization with rule TypeLiteralWithMultiplicityCS.
RootPackageCS.ownedNestedPackage[0]->PackageCS'temp'.ownedType[0]->ClassCS'TestClass'.ownedProperty[1]->AttributeCS't2'.ownedType->TypedTypeRefCS: An object of type TupleTypeCS or TypeNameExpCS or CollectionTypeCS or PrimitiveTypeRefCS is needed instead of TypedTypeRefCS for serialization with rule TypeExpCS.
RootPackageCS.ownedNestedPackage[0]->PackageCS'temp'.ownedType[0]->ClassCS'TestClass'.ownedProperty[1]->AttributeCS't2'.ownedType->TypedTypeRefCS: An object of type TupleTypeCS or CollectionTypeCS or PrimitiveTypeRefCS is needed instead of TypedTypeRefCS for serialization with rule TypeLiteralWithMultiplicityCS.

at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:96)
at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:130)
at org.eclipse.xtext.resource.XtextResource.doSave(XtextResource.java:344)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
at pivotvisitortest.PivotOCL.saveEssentialOCL(PivotOCL.java:114)

cheers,
Re: EssentialOCL creation, loading and parsing [message #1384749 is a reply to message #1384685] Sat, 31 May 2014 09:00 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

[When things obstinately refuse to work using a JUnit test as the launch
can reduce the start time significantly.]

If you want to create a *.essentialocl file then you need to provide a
CS model that could have been produced by the EssentialOCL.xtext grammar.

Your CS model includes ImportCS, which is not supported by that grammar.
The Xtext failed to serialize messages can be hard to understand. They
seem to be complaining about the content of ImportCS rather than
ImportCS itself, but they certainly point to bad input.

The bad TupleTypeCS etc are probably because you have not structured the
orphanage appropriately.

As I've commented before, I rerally do not understand what you are
trying to do and what I see seems quite mad. Refactoring is fairly
simple but you seem to be making it incredibly complicated.

If you want a textual form of an expression then PrettyPrinter is much
easier.

Regards

Ed Willink


On 30/05/2014 12:02, ModelGeek Mising name wrote:
> Here comes the plugin project (Please run this as eclipse application and please ignore the GUI part).
>
> I am trying to re-factor an OCL statement and i want to know the position of specific property call. I want to create ".essentialocl" document so i can use
> org.eclipse.xtext.nodemodel.util.NodeModelUtils.getNode(elemcs).getOffset(); to get the positioning of any property call for a single OCL statement. I have tried .oclinecore but it is not what i am looking for. I did the refactor in classic OCL and now i want to do it using pivot and xtext. (Ed advised me to use .essentialocl for this : http://www.eclipse.org/forums/index.php/mv/msg/711483/1342263/#msg_1342263)
>
>
>
> Please run the plugin and console will show exception.
> when i try to save the model as ".essentialocl" then i get the following exception. PivotOCL.java is the class and "saveEssentialOCL" is the operation.
>
> org.eclipse.xtext.validation.IConcreteSyntaxValidator$InvalidConcreteSyntaxException: These errors need to be fixed before the model can be serialized.
> RootPackageCS.ownedImport[0]->ImportCS'ecore'.pathName->PathNameCS.path[0]->PathElementWithURICS: An object of type PathElementCS is needed instead of PathElementWithURICS for serialization with rule NextPathElementCS.
> RootPackageCS.ownedImport[0]->ImportCS'ecore'.pathName->PathNameCS.path[0]->PathElementWithURICS: An object of type PathElementCS is needed instead of PathElementWithURICS for serialization with rule FirstPathElementCS.
> RootPackageCS.ownedNestedPackage[0]->PackageCS'temp'.ownedType[0]->ClassCS'TestClass'.ownedProperty[0]->AttributeCS't1'.ownedType->TypedTypeRefCS: An object of type TupleTypeCS or TypeNameExpCS or CollectionTypeCS or PrimitiveTypeRefCS is needed instead of TypedTypeRefCS for serialization with rule TypeExpCS.
> RootPackageCS.ownedNestedPackage[0]->PackageCS'temp'.ownedType[0]->ClassCS'TestClass'.ownedProperty[0]->AttributeCS't1'.ownedType->TypedTypeRefCS: An object of type TupleTypeCS or CollectionTypeCS or PrimitiveTypeRefCS is needed instead of TypedTypeRefCS for serialization with rule TypeLiteralWithMultiplicityCS.
> RootPackageCS.ownedNestedPackage[0]->PackageCS'temp'.ownedType[0]->ClassCS'TestClass'.ownedProperty[1]->AttributeCS't2'.ownedType->TypedTypeRefCS: An object of type TupleTypeCS or TypeNameExpCS or CollectionTypeCS or PrimitiveTypeRefCS is needed instead of TypedTypeRefCS for serialization with rule TypeExpCS.
> RootPackageCS.ownedNestedPackage[0]->PackageCS'temp'.ownedType[0]->ClassCS'TestClass'.ownedProperty[1]->AttributeCS't2'.ownedType->TypedTypeRefCS: An object of type TupleTypeCS or CollectionTypeCS or PrimitiveTypeRefCS is needed instead of TypedTypeRefCS for serialization with rule TypeLiteralWithMultiplicityCS.
>
> at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:96)
> at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:130)
> at org.eclipse.xtext.resource.XtextResource.doSave(XtextResource.java:344)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
> at pivotvisitortest.PivotOCL.saveEssentialOCL(PivotOCL.java:114)
>
> cheers,
Re: EssentialOCL creation, loading and parsing [message #1384750 is a reply to message #1384749] Sat, 31 May 2014 09:06 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
On 31/05/2014 10:00, Ed Willink wrote:
> Hi
> As I've commented before, I rerally do not understand what you are
> trying to do and what I see seems quite mad. Refactoring is fairly
> simple but you seem to be making it incredibly complicated.
I suggest that you start a new thread in which you clearly identify:

The context of your problem: what model representations you have, with a
small example

The problem to solve: what changes you want in those model
representations, with a small example

Do not confuse the issue by assuming a particular technology or approach.

Regards

Ed Willink
Previous Topic:PivotEObjectValidator with existing validator
Next Topic:Refactor OCL statement, PrettyPrinter ignores code formatting
Goto Forum:
  


Current Time: Sat Apr 20 04:01:40 GMT 2024

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

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

Back to the top