|
|
Re: Ecore data types map to OCL type [message #526758 is a reply to message #526742] |
Mon, 12 April 2010 19:46 |
Jesse Messages: 5 Registered: April 2010 |
Junior Member |
|
|
Hi, Ed,
What I mean is, I want to create an OCL operation "getInform" in my .ecore model, for example , in the context of Class A. This operation has parameters and returns equivalent to an OCL expression
getInform(names: Set(Tuple(firstName:String,lastName:String)))
:Set(Tuple(ssn:Integer,address:String)) =.....(execution omitted here)
In .ecore, I can create an EOperation, on which EParameter can be created to represent parameters. In my example above, what data type in .ecore model should the EParameter have that equals to Set(Tuple(firstName:String,lastName:String)). Or how to build such an EOperation with these input parameter and return type. I do not mean operation body.
Do I make it clear?
Thank you.
|
|
|
Re: Ecore data types map to OCL type [message #526813 is a reply to message #526758] |
Tue, 13 April 2010 05:06 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi Jesse
I'm having great difficulty understanding you.
'I want to create an OCL operation'
is this a reflective declaration?
What language are you trying to program in?
What editor are you trying to use?
What execution engine do you want to use?
An OCL operation is defined by an appropriately parameterised
ExpressionInOcl instance. Is this what you want? Use
EcoreFactory.createExpressionInOCL().
I've given you an OCL declaration.
If it's an Ecore declaration to generate Java code that you want, decide
what you would want in Java and just transliterate it. You may find
org.eclipse.ocl/model/OCL.ecore provides clues as to how to define many
of the generic qualifications.
Regards
On 12/04/2010 20:46, Jesse wrote:
> Hi, Ed,
> What I mean is, I want to create an OCL operation "getInform" in my
> .ecore model, for example , in the context of Class A. This operation
> has parameters and returns equivalent to an OCL expression
>
> getInform(names: Set(Tuple(firstName:String,lastName:String)))
> :Set(Tuple(ssn:Integer,address:String)) =.....(execution omitted here)
>
> In .ecore, I can create an EOperation, on which EParameter can be
> created to represent parameters. In my example above, what data type in
> .ecore model should the EParameter have that equals to
> Set(Tuple(firstName:String,lastName:String)). Or how to build such an
> EOperation with these input parameter and return type. I do not mean
> operation body.
>
> Do I make it clear?
>
> Thank you.
|
|
|
Powered by
FUDForum. Page generated in 1.77837 seconds