|Specifying constraints at Model Instance (M0) level [message #670894]
||Mon, 16 May 2011 01:56
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!
Powered by FUDForum
. Page generated in 0.19987 seconds