Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Specifying constraints at Model Instance (M0) level
Specifying constraints at Model Instance (M0) level [message #670894] Mon, 16 May 2011 05:56
Nidhi  is currently offline Nidhi
Messages: 92
Registered: December 2009


I am re-posting my earlier question (posted in the EMFT forum) regarding defining expressions at Model Instance Level.

My usecase is the following:

1. My domain Ecore model contains the following entities:
- parameters : Parameter

2. On declaratively instantiating this model, the end user creates the following entities:
Customer (corresponding to Stakeholder)
- CustomerProfile (corresponding to Parameter)

3. Now I need to enable the end users of my tool to further decleratively define an expression on the instantiated
Parameter entity "CustomerProfile"(and not the Parameter model entity itself):
CustomerProfile == "Gold"

This expression would later be evaluated as a business rule and help identify the path in a business
process workflow to be taken. But for the time being I just need a mechanism to help define the expression,
irrespective of the action that needs to be taken post the expression is evaluated.
So the end user first declaratively creates a model instance CustomerProfile and then declaratively defines
the expression using it. (CustomerProfile == "Gold").

This leads to the question, would it be possible to define constraints at M0 level using OCL decleratively.

As Edward replies in my earlier post:
"if(Customer Profile == "Gold"), do this else do that... " is not a constraint. It is a procedure, which you
may model with an operation whose body can be defined using OCL.

@Edward: I hope I am getting this right but how can I achieve this, as while defining my domain model (M1) I yet
dont know what parameters user would create and hence what expressions he/she would define using these parameters.
Any pointers would really be very useful!

Best Regards,
Previous Topic:A conceptual understanding problem with invariant conditions?
Next Topic:Re: Specifying constraints at Model Instance (M0) level
Goto Forum:

Current Time: Tue Oct 21 19:52:30 GMT 2014

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

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