Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » lots of errors in ocl file
lots of errors in ocl file [message #1765894] Wed, 14 June 2017 12:03 Go to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 254
Registered: July 2016
Senior Member
Hi,

When I open an .ocl file in eclipse, I have several errors (Unresolved " 'eshop', etc.). I attached the related screenshots for the program and installed ocl software.
I also registered the metamodel. However, the errors didn't disappear.

[Updated on: Wed, 14 June 2017 12:10]

Report message to a moderator

Re: lots of errors in ocl file [message #1765898 is a reply to message #1765894] Wed, 14 June 2017 12:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5434
Registered: July 2009
Senior Member
Hi

Have you looked at any of the Complete OCL examples? You need an import statement.

'registration' was a solution in the old Eclipse OCL support that was only available in conjunction with a Java API.

The import statement overcomes the total inability of Complete OCL as specified to be used with anything. One day OMG OCL will endorse an import statement.

Regards

Ed Willink
Re: lots of errors in ocl file [message #1765928 is a reply to message #1765898] Wed, 14 June 2017 13:45 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 254
Registered: July 2016
Senior Member
Thank you very much indeed.
When I use import statement, many of the errors disappear. However, I still have 2 errors and one warning. I attached screenshots of the program.
Re: lots of errors in ocl file [message #1765938 is a reply to message #1765928] Wed, 14 June 2017 14:11 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5434
Registered: July 2009
Senior Member
Hi

Providing only partial information makes it impossible to help you further. See https://wiki.eclipse.org/OCL/ForumNetiquette

Regards

Ed Willink
Re: lots of errors in ocl file [message #1765949 is a reply to message #1765938] Wed, 14 June 2017 14:45 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 254
Registered: July 2016
Senior Member
Hi,
something went wrong with that address.

On line 1, import statement, I have bellow warning:
index.php/fa/29650/0/

For line 6, inv minStock: Product::allInstances()->forAll(p|p.stock>=5), I have the bellow error:
index.php/fa/29651/0/

on line 9, inv salesAmount: GoldCustomer::allInstances()->forAll(g| g.sale->select(s| s.paid).amount->sum()>10000), I have the bellow error:
index.php/fa/29652/0/

I also attached the metamodel and ocl file.

[Updated on: Wed, 14 June 2017 14:47]

Report message to a moderator

Re: lots of errors in ocl file [message #1765958 is a reply to message #1765949] Wed, 14 June 2017 15:18 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5434
Registered: July 2009
Senior Member
Hi

I don't know why you do

import eShop : 'http://www.example.com/'

For which the error message is:

Multiple markers at this line
- Unresolved Namespace 'http://www.example.com/'
- The required feature 'pivot::Import::importedNamespace' of 'eShop : ┬źnull┬╗' must be set

If I do

import eShop : 'eShop.ecore'

it works fine.

Regards

Ed Willink
Re: lots of errors in ocl file [message #1765973 is a reply to message #1765958] Wed, 14 June 2017 16:13 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 254
Registered: July 2016
Senior Member
Since in the EPackageRegistry the uri of this ecore is http://www.example.com, I used this address in the import statement.

When I test eShop.ecore instead of this address, I have the same error. I also change the uri of this ecore to eShop or eShop.ecore but the error doesn't disappear.

[Updated on: Wed, 14 June 2017 16:14]

Report message to a moderator

Re: lots of errors in ocl file [message #1765986 is a reply to message #1765973] Wed, 14 June 2017 17:16 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5434
Registered: July 2009
Senior Member
Hi

The EPackageRegistry is useful for applications that use installed facilities. Editors generally use dynamic models. Certainly eShop.ecore is a dynamic model. I have no idea how you actually poke the EPackageRegistry .

Since an import works for me and you do not tell me precisely what you do, I cannot help tell you what you did wrong.

Regards

Ed Willink
Previous Topic:Using Java APIs
Next Topic:ETL constraints to OCL
Goto Forum:
  


Current Time: Sun Oct 22 12:01:06 GMT 2017

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

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