Skip to main content



      Home
Home » Modeling » OCL » lots of errors in ocl file
lots of errors in ocl file [message #1765894] Wed, 14 June 2017 08:03 Go to next message
Eclipse UserFriend
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 08:10] by Moderator

Re: lots of errors in ocl file [message #1765898 is a reply to message #1765894] Wed, 14 June 2017 08:29 Go to previous messageGo to next message
Eclipse UserFriend
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 09:45 Go to previous messageGo to next message
Eclipse UserFriend
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 10:11 Go to previous messageGo to next message
Eclipse UserFriend
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 10:45 Go to previous messageGo to next message
Eclipse UserFriend
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 10:47] by Moderator

Re: lots of errors in ocl file [message #1765958 is a reply to message #1765949] Wed, 14 June 2017 11:18 Go to previous messageGo to next message
Eclipse UserFriend
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 12:13 Go to previous messageGo to next message
Eclipse UserFriend
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 12:14] by Moderator

Re: lots of errors in ocl file [message #1765986 is a reply to message #1765973] Wed, 14 June 2017 13:16 Go to previous message
Eclipse UserFriend
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: Fri Apr 18 01:08:37 EDT 2025

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

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

Back to the top