Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Link Constraint with oclIsKindOf
Link Constraint with oclIsKindOf [message #121619] Wed, 25 April 2007 07:55 Go to next message
Mathias Freier is currently offline Mathias FreierFriend
Messages: 10
Registered: July 2009
Junior Member
Hello,

I have two Metamodels: Core and Entity (Entity knows Core). Core defines
something like ModelElement and Dependency. In the Editor I created a
LinkMapping to have Dependencies between entity::Entity and
entity::EntityConstants. Of cource, the the normal behavior is that one
can create Dependencies between all ModelElements and this is not what I
want. I want to restrict the Dependency creation to Entity ->
EntityConstants.
I tried to define link constraints like:
self.oclIsKindOf(EntityConstants)
self.oclIsKindOf(Entity)

This fails because Entity/EntityConstants seem to be unknown:
Invalid expression body 'self.oclIsKindOf(Entity)
'. Cause: Invalid expression body 'self.oclIsKindOf(Entity)
'. Cause: ERROR in (variableExpCS): (Unrecognized variable: (Entity))


Can anyone give me hint how to proceed.

Cheers,
Mathias
Re: Link Constraint with oclIsKindOf [message #121686 is a reply to message #121619] Wed, 25 April 2007 09:39 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Mathias,

Try using entity::EntityConstants as a parameter of oclIsKindOf.

-----------------
Alex Shatalin
Re: Link Constraint with oclIsKindOf [message #125057 is a reply to message #121686] Thu, 10 May 2007 07:39 Go to previous messageGo to next message
Mathias Freier is currently offline Mathias FreierFriend
Messages: 10
Registered: July 2009
Junior Member
Hello Alex,

I tried (in several variations: ::, : , fqn ...), but it does not work.

Mathias

Alex Shatalin schrieb:
> Hello Mathias,
>
> Try using entity::EntityConstants as a parameter of oclIsKindOf.
>
> -----------------
> Alex Shatalin
>
>
Re: Link Constraint with oclIsKindOf [message #125410 is a reply to message #125057] Thu, 10 May 2007 12:12 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Mathias,

Use both type names as qualified, the way Alex has suggested.
As you use two metamodels, it is unclear which package was taken
as the default one for resolving un-qualified names.

If you have tried so already, could you please post a simple test models
that we could reproduce this?

Regards,
/Radek


On Thu, 10 May 2007 09:39:41 +0200, Mathias Freier
<mathias.freier@gentleware.com> wrote:

> Hello Alex,
>
> I tried (in several variations: ::, : , fqn ...), but it does not work.
>
> Mathias
>
> Alex Shatalin schrieb:
>> Hello Mathias,
>> Try using entity::EntityConstants as a parameter of oclIsKindOf.
>> -----------------
>> Alex Shatalin
>>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: Link Constraint with oclIsKindOf [message #129205 is a reply to message #125410] Thu, 24 May 2007 10:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hiiiii

I am also facing the same prob

I hv two metamodels Tde & UseCase

All the elements in UseCase extends from DiagramElement which i hv defined
in Tde & also the diagram of usecase extends from class which i hv define
in Tde.


By the way UseCase is usecase editor & Tde is statemachine editor.
now when i define

self.ocliskindof(Actor) in usecase it gives error.

but when i define
self.ocliskindof(StartState) in Tde it works fine.

i tried to define

self.ocliskindof(Actor::DiagramElement) but still it gives error.

what i want is that i dnt want any incoming transition on actor

Thanks

Varun Bhatia
Re: Link Constraint with oclIsKindOf [message #129752 is a reply to message #129205] Fri, 25 May 2007 05:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hiii

plz reply to my above ques.

thanks
varun Bhatia
Re: Link Constraint with oclIsKindOf [message #130307 is a reply to message #129752] Fri, 25 May 2007 12:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bhatia1984.yahoo.com

hiiiii

is there any example on net where constraints are defined in java

thanks
Varun Bhatia
Re: Link Constraint with oclIsKindOf [message #130540 is a reply to message #130307] Mon, 28 May 2007 06:50 Go to previous messageGo to next message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Varun,

Have a look at http://wiki.eclipse.org/index.php/GMF_Constraints#Java

/Radek

On Fri, 25 May 2007 14:17:35 +0200, varun bhatia <bhatia1984@yahoo.com>
wrote:

> hiiiii
>
> is there any example on net where constraints are defined in java
>
> thanks
> Varun Bhatia
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: Link Constraint with oclIsKindOf [message #130553 is a reply to message #129205] Mon, 28 May 2007 07:03 Go to previous message
Radomil Dvorak is currently offline Radomil DvorakFriend
Messages: 249
Registered: July 2009
Senior Member
Hi Varun,

It is not easy to see what erros you report here,
as you use 'ocliskindof' instead of 'oclIsKindOf'.
Also, 'Actor' used as type first and then as a package
in 'Actor::DiagramElement' indicates there might be other
causes of errors.

Regards,
/Radek

On Thu, 24 May 2007 12:33:00 +0200, varun <bhatia1984@yahoo.com> wrote:

> hiiiii
>
> I am also facing the same prob
>
> I hv two metamodels Tde & UseCase
>
> All the elements in UseCase extends from DiagramElement which i hv
> defined in Tde & also the diagram of usecase extends from class which i
> hv define in Tde.
>
>
> By the way UseCase is usecase editor & Tde is statemachine editor.
> now when i define
>
> self.ocliskindof(Actor) in usecase it gives error.
>
> but when i define self.ocliskindof(StartState) in Tde it works fine.
>
> i tried to define self.ocliskindof(Actor::DiagramElement) but still it
> gives error.
>
> what i want is that i dnt want any incoming transition on actor
>
> Thanks
>
> Varun Bhatia
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Previous Topic:How can I render a figure like Rational Rose style?
Next Topic:diagram refresh on delete connection
Goto Forum:
  


Current Time: Sat Jul 27 16:48:17 GMT 2024

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

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

Back to the top