Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Checking if the ecore model is valid in code(checking model validity in code)
Checking if the ecore model is valid in code [message #1220594] Thu, 12 December 2013 16:33 Go to next message
Hamid Qartal is currently offline Hamid QartalFriend
Messages: 33
Registered: December 2013
Member
For the provided ecore(meta-model) annotated with some OCL expression (e.g. by OCLInEcore) and model(instance) file, if would like to check if the model is the (valid) instance of the ecore file or not?

I would like to do so in code, so I am wondering if there is any API provided in EMF to do that.

checking model conformance (as far as I am concerned ) include two steps (which is kind of mixed in EMF):
1- checking if there is a morphism between the instance graph and meta-model graph.
2- check if the instance conforms to the OCL constraints in the meta-model.

In case the instance is not the valid instance of the meta-model, it would be better that the API returns the reason.


Thanks
Hamid

Re: Checking if the ecore model is valid in code [message #1220621 is a reply to message #1220594] Thu, 12 December 2013 18:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Try reading the tutorials that are provided to enlighten you.

Regards

Ed Willink

On 12/12/2013 17:30, Hamid Gh wrote:
> For the provided ecore(meta-model) annotated with some OCL expression
> (e.g. by OCLInEcore) and model(instance) file, if would like to check
> if the model is the (valid) instance of the ecore file or not?
>
> I would like to do so in code, so I am wondering if there is any API
> provided in EMF to do that.
>
> checking model conformance (as far as I am concerned ) include two
> steps (which is kind of mixed in EMF):
> 1- checking if there is a morphism between the instance graph and
> meta-model graph.
> 2- check if the instance conforms to the OCL constraints in the
> meta-model.
>
> In case the instance is not the valid instance of the meta-model, it
> would be better that the API returns the reason.
>
>
> Thanks
> Hamid
>
>
Re: Checking if the ecore model is valid in code [message #1220624 is a reply to message #1220621] Thu, 12 December 2013 18:26 Go to previous messageGo to next message
Hamid Qartal is currently offline Hamid QartalFriend
Messages: 33
Registered: December 2013
Member
can you please let me know which tutorial I should look, I could not find the link to the tutorial in your response.

I know how to do this inside eclipse, by right click and clicking the validate from the pop up menu, but I don't know how to use the API behind that.

Thanks
Hamid
Re: Checking if the ecore model is valid in code [message #1220626 is a reply to message #1220624] Thu, 12 December 2013 18:44 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The documentation is obtained by Help->Help Contents, or Googling for
"Eclipse OCL Tutorial"

In the OCL Documentation you will find tutorials.

Rgards

Ed Willink


On 12/12/2013 18:26, Hamid Gh wrote:
> can you please let me know which tutorial I should look, I could not
> find the link to the tutorial in your response.
>
> I know how to do this inside eclipse, by right click and clicking the
> validate from the pop up menu, but I don't know how to use the API
> behind that.
> Thanks
> Hamid
Previous Topic:Ternary Association
Next Topic:OCL standard library error : no viable alternative at input 'validating'
Goto Forum:
  


Current Time: Thu Mar 28 11:33:10 GMT 2024

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

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

Back to the top