Skip to main content



      Home
Home » Modeling » OCL » Ecore data types map to OCL type(issues about OCL sequence, set and tuple)
Ecore data types map to OCL type [message #526678] Mon, 12 April 2010 11:05 Go to next message
Eclipse UserFriend
I want to define an OCL operation like this:

context A def:

getInform(names: Set(Sequence(firstName:String,lastName:String)))
:Set(TupleTyple(ssn:Integer,address:String)) = ......

How to define Set, Sequence, Tuple and Bag of OCL in .ecore model, all use EElist?


Re: Ecore data types map to OCL type [message #526742 is a reply to message #526678] Mon, 12 April 2010 15:02 Go to previous messageGo to next message
Eclipse UserFriend
Hi

On 12/04/2010 16:05, yliang10@crimson.ua.edu wrote:
> I want to define an OCL operation like this:
>
> context A def:
>
> getInform(names: Set(Sequence(firstName:String,lastName:String)))
> :Set(TupleTyple(ssn:Integer,address:String)) = ......

> How to define Set, Sequence, Tuple and Bag of OCL in .ecore model, all
> use EElist?
>
Is

def:

getInform(names: Set(Tuple(firstName:String,lastName:String)))
:Set(Tuple(ssn:Integer,address:String)) = null

what you mean?

Regards

Ed Willink
Re: Ecore data types map to OCL type [message #526758 is a reply to message #526742] Mon, 12 April 2010 15:46 Go to previous messageGo to next message
Eclipse UserFriend
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 01:06 Go to previous message
Eclipse UserFriend
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.
Previous Topic:passing references as parameter
Next Topic:Parse an OCL String without any Kind Information
Goto Forum:
  


Current Time: Wed Jul 23 17:37:11 EDT 2025

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

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

Back to the top