OCL Pre- and Post- Conditions [message #6985] |
Mon, 19 February 2007 02:20  |
Eclipse User |
|
|
|
Hello,
Is it possible to specify pre- and post- conditions in MDT OCL and then
evaluate them
against some EMF data, i.e. a before and after state? If so, how might I go
about it?
Thanks,
Andy
|
|
|
Re: OCL Pre- and Post- Conditions [message #7012 is a reply to message #6985] |
Mon, 19 February 2007 09:30   |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Ase,
Have a look at the org.eclipse.ocl.ecore.tests plug-in for some examples of
parsing operation pre- and post-conditions. In particular:
- the OCLDocumentTest.java class which parses the
model/test_constraints.ocl text file and, in the
test_multipleMixedOperationConstraints() method introspects the
operation constraints
- the org.eclipse.ocl.ecore.helper.tests.ParsingTest which demonstrates
usage of the OCLHelper API to parse operation constraints
Once a constraint has been parsed either from text (an OCL document) or via
the OCLHelper, evaluation of the constraint at run-time simply requires
binding the values of any context variables and evaluating as demonstrated
for operation body expressions in
http://www.eclipse.org/articles/Article-EMF-Codegen-with-OCL /article.html
Note that the MDT OCL component does not currently support the evaluation of
@pre and oclIsNew() expressions in post-conditions. For that, you would
need to define a custom implementation of the EvaluationEnvironment.
HTH,
Christian
ase wrote:
> Hello,
>
> Is it possible to specify pre- and post- conditions in MDT OCL and then
> evaluate them
> against some EMF data, i.e. a before and after state? If so, how might I
> go about it?
>
> Thanks,
>
> Andy
|
|
|
Re: OCL Pre- and Post- Conditions [message #7036 is a reply to message #7012] |
Mon, 19 February 2007 09:31  |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
My apologies, Andy. I mistakenly addressed you as "Ase" from the "From:"
header in your posting.
I should read more carefully than that.
Christian
Christian W. Damus wrote:
>
> Hi, Ase,
>
<snip>
|
|
|
Powered by
FUDForum. Page generated in 0.02713 seconds