Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:05 Go to next message
Jesse is currently offline JesseFriend
Messages: 5
Registered: April 2010
Junior Member
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 19:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 19:46 Go to previous messageGo to next message
Jesse is currently offline JesseFriend
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 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
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.
Previous Topic:passing references as parameter
Next Topic:Parse an OCL String without any Kind Information
Goto Forum:
  


Current Time: Thu Apr 25 13:54:44 GMT 2024

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

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

Back to the top