Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » how to use the context expressions in OCL
how to use the context expressions in OCL [message #851735] Sat, 21 April 2012 08:34 Go to next message
Lucy Chan is currently offline Lucy Chan
Messages: 29
Registered: March 2012
Junior Member
I just wondering how to use the context & inv expression in OCL specification in Helios Packages. I try several times, but the result suggests it's a error expresions with misplace with struct (s) or sth. like that. Who can give a simple example or give me some suggestions on reference books? Thanks sincerely.
Re: how to use the context expressions in OCL [message #851746 is a reply to message #851735] Sat, 21 April 2012 08:49 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
Hi

The Royal and Loyal example project has many examples.

Regards

Ed Willink

On 21/04/2012 09:34, Lucy Chan wrote:
> I just wondering how to use the context & inv expression in OCL
> specification in Helios Packages. I try several times, but the result
> suggests it's a error expresions with misplace with struct (s) or sth.
> like that. Who can give a simple example or give me some suggestions
> on reference books? Thanks sincerely.
Re: how to use the context expressions in OCL [message #851823 is a reply to message #851746] Sat, 21 April 2012 10:50 Go to previous messageGo to next message
Lucy Chan is currently offline Lucy Chan
Messages: 29
Registered: March 2012
Junior Member
Thanks for your reply.
1:1:1:4 "inv:" misplaced construct(s)
The above is my error warning information. Did it mean that I wrote a wrong inv expression?
And the following expression is what I wrote: context ComponentInstance inv Login: self.multiplicity>0 where ComponentInstance is a class I defined. And Login means a instance of ComponentInstance.
Re: how to use the context expressions in OCL [message #851883 is a reply to message #851823] Sat, 21 April 2012 12:14 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
Hi

You need to provide much more information; there is a limit to my telepathy.

What version of what tool are you using?

Regards

Ed Willink

On 21/04/2012 11:50, Lucy Chan wrote:
> Thanks for your reply.
> 1:1:1:4 "inv:" misplaced construct(s)
> The above is my error warning information. Did it mean that I wrote a
> wrong inv expression?
> And the following expression is what I wrote: context
> ComponentInstance inv Login: self.multiplicity>0 where
> ComponentInstance is a class I defined. And Login means a instance of
> ComponentInstance.
Re: how to use the context expressions in OCL [message #851912 is a reply to message #851883] Sat, 21 April 2012 12:56 Go to previous messageGo to next message
Lucy Chan is currently offline Lucy Chan
Messages: 29
Registered: March 2012
Junior Member
the tool I'm using is Helios Packages for Eclipse Modeling Tools. The attachment is my file. I just want to verify if the number of the attribute multiplicity in Login ComponentInstance is >0, so I wrote the expression:
context ComponentInstance inv Login: self.multiplicity>0
but it has some errors '1:1:1:4 "inv:" misplaced construct(s)' canyou help figure out where I made mistakes?
Thanks for your help sincerely.
Re: how to use the context expressions in OCL [message #851942 is a reply to message #851912] Sat, 21 April 2012 13:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
But what tool? Sample Ecore Editor, Genmodel Editor, Console View,
OCLinEcore editoir, Complete OCL editor, Acceleo, QVTo, ....

Your attachment has no "context ComponentInstance inv Login:
self.multiplicity>0"

so what are you doing?

Regards

Ed Willink

On 21/04/2012 13:56, Lucy Chan wrote:
> the tool I'm using is Helios Packages for Eclipse Modeling Tools. The attachment is my file. I just want to verify if the number of the attribute multiplicity in Login ComponentInstance is>0, so I wrote the expression:
> context ComponentInstance inv Login: self.multiplicity>0
> but it has some errors '1:1:1:4 "inv:" misplaced construct(s)' canyou help figure out where I made mistakes?
> Thanks for your help sincerely.
Re: how to use the context expressions in OCL [message #851996 is a reply to message #851942] Sat, 21 April 2012 14:59 Go to previous messageGo to next message
Lucy Chan is currently offline Lucy Chan
Messages: 29
Registered: March 2012
Junior Member
sry, I'm using the OCL interative to write OCL expressions.
Re: how to use the context expressions in OCL [message #852005 is a reply to message #851942] Sat, 21 April 2012 15:09 Go to previous messageGo to next message
Lucy Chan is currently offline Lucy Chan
Messages: 29
Registered: March 2012
Junior Member
I'm using the OCL interative in Console View
Re: how to use the context expressions in OCL [message #852574 is a reply to message #852005] Sun, 22 April 2012 05:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
HI

OCL can be used in a variety of ways.

The Essential OCL expression language is embedded in a variety of larger
languages such as QVTo, Acceleo and ATL, and used with UML.

OCL by itself is almost useless; since it has no models to constrain.
Hence the need to embed in some language that provides context.

The Complete OCL language supports use of OCL in independent documents
that complement referenced meta-model.

The OCL Console supports Essential OCL expression entry and evaluation
using the prevailing Eclipse IDE selection as the modeling context.

Since you are using the Console you may only use Essential OCL
expressions. "context .... " is part of the Complete OCL syntax.

As from Juno M6, you may use the "Load Complete OCL Resource" menu
action to load a Complete OCL document (*.ocl extension) into another
modeling tool so that you can then exploit the additional OCLdefinitions
within the context of that tool while using the OCL Console for
interactive expression evaluation.

Regards

Ed Willink



On 21/04/2012 16:09, Lucy Chan wrote:
> I'm using the OCL interative in Console View
Re: how to use the context expressions in OCL [message #852580 is a reply to message #852005] Sun, 22 April 2012 05:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
HI

OCL can be used in a variety of ways.

The Essential OCL expression language is embedded in a variety of larger
languages such as QVTo, Acceleo and ATL, and used with UML.

OCL by itself is almost useless; since it has no models to constrain.
Hence the need to embed in some language that provides context.

The Complete OCL language supports use of OCL in independent documents
that complement referenced meta-model.

The OCL Console supports Essential OCL expression entry and evaluation
using the prevailing Eclipse IDE selection as the modeling context.

Since you are using the Console you may only use Essential OCL
expressions. "context .... " is part of the Complete OCL syntax.

As from Juno M6, you may use the "Load Complete OCL Resource" menu
action to load a Complete OCL document (*.ocl extension) into another
modeling tool so that you can then exploit the additional OCLdefinitions
within the context of that tool while using the OCL Console for
interactive expression evaluation.

Regards

Ed Willink



On 21/04/2012 16:09, Lucy Chan wrote:
> I'm using the OCL interative in Console View
Re: how to use the context expressions in OCL [message #852588 is a reply to message #852005] Sun, 22 April 2012 05:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
HI

OCL can be used in a variety of ways.

The Essential OCL expression language is embedded in a variety of larger
languages such as QVTo, Acceleo and ATL, and used with UML.

OCL by itself is almost useless; since it has no models to constrain.
Hence the need to embed in some language that provides context.

The Complete OCL language supports use of OCL in independent documents
that complement referenced meta-model.

The OCL Console supports Essential OCL expression entry and evaluation
using the prevailing Eclipse IDE selection as the modeling context.

Since you are using the Console you may only use Essential OCL
expressions. "context .... " is part of the Complete OCL syntax.

As from Juno M6, you may use the "Load Complete OCL Resource" menu
action to load a Complete OCL document (*.ocl extension) into another
modeling tool so that you can then exploit the additional OCLdefinitions
within the context of that tool while using the OCL Console for
interactive expression evaluation.

Regards

Ed Willink



On 21/04/2012 16:09, Lucy Chan wrote:
> I'm using the OCL interative in Console View
Re: how to use the context expressions in OCL [message #852596 is a reply to message #852005] Sun, 22 April 2012 05:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
HI

OCL can be used in a variety of ways.

The Essential OCL expression language is embedded in a variety of larger
languages such as QVTo, Acceleo and ATL, and used with UML.

OCL by itself is almost useless; since it has no models to constrain.
Hence the need to embed in some language that provides context.

The Complete OCL language supports use of OCL in independent documents
that complement referenced meta-model.

The OCL Console supports Essential OCL expression entry and evaluation
using the prevailing Eclipse IDE selection as the modeling context.

Since you are using the Console you may only use Essential OCL
expressions. "context .... " is part of the Complete OCL syntax.

As from Juno M6, you may use the "Load Complete OCL Resource" menu
action to load a Complete OCL document (*.ocl extension) into another
modeling tool so that you can then exploit the additional OCLdefinitions
within the context of that tool while using the OCL Console for
interactive expression evaluation.

Regards

Ed Willink



On 21/04/2012 16:09, Lucy Chan wrote:
> I'm using the OCL interative in Console View
Re: how to use the context expressions in OCL [message #852604 is a reply to message #852005] Sun, 22 April 2012 05:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
HI

OCL can be used in a variety of ways.

The Essential OCL expression language is embedded in a variety of larger
languages such as QVTo, Acceleo and ATL, and used with UML.

OCL by itself is almost useless; since it has no models to constrain.
Hence the need to embed in some language that provides context.

The Complete OCL language supports use of OCL in independent documents
that complement referenced meta-model.

The OCL Console supports Essential OCL expression entry and evaluation
using the prevailing Eclipse IDE selection as the modeling context.

Since you are using the Console you may only use Essential OCL
expressions. "context .... " is part of the Complete OCL syntax.

As from Juno M6, you may use the "Load Complete OCL Resource" menu
action to load a Complete OCL document (*.ocl extension) into another
modeling tool so that you can then exploit the additional OCLdefinitions
within the context of that tool while using the OCL Console for
interactive expression evaluation.

Regards

Ed Willink



On 21/04/2012 16:09, Lucy Chan wrote:
> I'm using the OCL interative in Console View
Re: how to use the context expressions in OCL [message #852612 is a reply to message #852005] Sun, 22 April 2012 05:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
HI

OCL can be used in a variety of ways.

The Essential OCL expression language is embedded in a variety of larger
languages such as QVTo, Acceleo and ATL, and used with UML.

OCL by itself is almost useless; since it has no models to constrain.
Hence the need to embed in some language that provides context.

The Complete OCL language supports use of OCL in independent documents
that complement referenced meta-model.

The OCL Console supports Essential OCL expression entry and evaluation
using the prevailing Eclipse IDE selection as the modeling context.

Since you are using the Console you may only use Essential OCL
expressions. "context .... " is part of the Complete OCL syntax.

As from Juno M6, you may use the "Load Complete OCL Resource" menu
action to load a Complete OCL document (*.ocl extension) into another
modeling tool so that you can then exploit the additional OCLdefinitions
within the context of that tool while using the OCL Console for
interactive expression evaluation.

Regards

Ed Willink



On 21/04/2012 16:09, Lucy Chan wrote:
> I'm using the OCL interative in Console View
Re: how to use the context expressions in OCL [message #852620 is a reply to message #852005] Sun, 22 April 2012 05:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4111
Registered: July 2009
Senior Member
HI

OCL can be used in a variety of ways.

The Essential OCL expression language is embedded in a variety of larger
languages such as QVTo, Acceleo and ATL, and used with UML.

OCL by itself is almost useless; since it has no models to constrain.
Hence the need to embed in some language that provides context.

The Complete OCL language supports use of OCL in independent documents
that complement referenced meta-model.

The OCL Console supports Essential OCL expression entry and evaluation
using the prevailing Eclipse IDE selection as the modeling context.

Since you are using the Console you may only use Essential OCL
expressions. "context .... " is part of the Complete OCL syntax.

As from Juno M6, you may use the "Load Complete OCL Resource" menu
action to load a Complete OCL document (*.ocl extension) into another
modeling tool so that you can then exploit the additional OCLdefinitions
within the context of that tool while using the OCL Console for
interactive expression evaluation.

Regards

Ed Willink



On 21/04/2012 16:09, Lucy Chan wrote:
> I'm using the OCL interative in Console View
Re: how to use the context expressions in OCL [message #852764 is a reply to message #852620] Sun, 22 April 2012 09:35 Go to previous message
Lucy Chan is currently offline Lucy Chan
Messages: 29
Registered: March 2012
Junior Member
Thanks a lot for your answer. It seems that what I have learnt is too limited. Hope to keep in touch with you. Thanks for your help again.
Previous Topic:Parse OCL Constraints - Model Instance of an UML Profile
Next Topic:OCL console: querying when having multiples resources
Goto Forum:
  


Current Time: Fri Oct 31 13:03:58 GMT 2014

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

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