|
Re: Evaluate Ecore Instances programatically [message #663315 is a reply to message #663276] |
Mon, 04 April 2011 15:10 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Khurram,
This is really more of an OCL question best asked on the OCL newsgroup.
khurram wrote:
> Hi,
>
> I am creating ECore model with OCL embedded in it programatically
> using JAVA. I am also creating instances of Ecore model but i want
> instances with evaluated values with respect to OCL derivations
> defined inside Ecore. As there are some attribute having derivation
> statement. I want to access those attributes and want to get the
> derived values from them.
>
> class Library
> {
> property totalBooks : ecore_0::EDouble[1] { derived,volatile }
> {
> derivation: self.books.copies->sum() + testFunction1();
> }
> property books : Book[*] { composes };
> property members : Member[*] { composes };
> property loans : Loan[*] { composes };
> operation testFunction1() : ecore_0::EInt[?]
> {
> body: 2;
> }
> }
> class Book
> {
> attribute name : String[?];
> attribute copies : ecore_0::EIntegerObject[?];
> }
> class Loan
> {
> property member : Member[1];
> property book : Book[1];
> }
>
> This is structure of my generated Ecore. I am taking the instance of
> library and added few books into it and wants that Library.totalBooks
> should have calculated values.
>
> Please guide me!
>
> Warmest Regards,
> Khurram
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03714 seconds