Skip to main content



      Home
Home » Eclipse Projects » Sirius » Only one Edge between two nodes
Only one Edge between two nodes [message #1707173] Wed, 02 September 2015 14:52 Go to next message
Eclipse UserFriend
Hello,

I'am working on an extended Version of Petri Nets (new edge types, new nodes).

I've implemented the needed creation Tools but now I can create two edges with the same source and target. Is there an easy way to restrict it or do I have to use Condition Expressions in the creation tool?

EMF diagram and an example are attached.

Thank you in advance!
Best regards,
Alex
  • Attachment: Beispiel.JPG
    (Size: 32.18KB, Downloaded 267 times)
  • Attachment: EMF.JPG
    (Size: 45.78KB, Downloaded 229 times)

[Updated on: Wed, 02 September 2015 14:54] by Moderator

Re: Only one Edge between two nodes [message #1707919 is a reply to message #1707173] Thu, 10 September 2015 10:06 Go to previous messageGo to next message
Eclipse UserFriend
Le 02/09/2015 20:52, Alexander Schledewitz a écrit :
> Hello,
>
> I'am working on an extended Version of Petri Nets (new edge types, new
> nodes).
>
> EMF:
>
I guess you forgot the image here ...
>
> I've implemented the needed creation Tools but now I can create two
> edges with the same source and target. Is there an easy way to restrict
> it or do I have to use Condition Expressions in the creation tool?
> Example:
.... and here
>
>
> Thank you in advance!
> Best regards,
> Alex
Re: Only one Edge between two nodes [message #1707977 is a reply to message #1707919] Fri, 11 September 2015 03:39 Go to previous messageGo to next message
Eclipse UserFriend
Le 10/09/2015 16:06, Laurent Fasani a écrit :
> Le 02/09/2015 20:52, Alexander Schledewitz a écrit :
>> Hello,
>>
>> I'am working on an extended Version of Petri Nets (new edge types, new
>> nodes).
>>
>> EMF:
>>
> I guess you forgot the image here ...
>>
>> I've implemented the needed creation Tools but now I can create two
>> edges with the same source and target. Is there an easy way to restrict
>> it or do I have to use Condition Expressions in the creation tool?
>> Example:
> ... and here
>>
>>
>> Thank you in advance!
>> Best regards,
>> Alex
>
oups sorry. The images were attached but i could not see it from
thunderbird.
Yes, use the precondition and use preSource/preSourceView and
preTarget/preTarget to make a condition on what you are about to select.

Regards
Laurent
Re: Only one Edge between two nodes [message #1709147 is a reply to message #1707977] Thu, 24 September 2015 09:10 Go to previous messageGo to next message
Eclipse UserFriend
Thank you, it worked Smile
Re: Only one Edge between two nodes [message #1743626 is a reply to message #1709147] Sat, 17 September 2016 05:42 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

I have a similar problem. I have tried to fix it by:

aql:preTarget.differs(preSource.outgoings -> filter(target))
or
aql:(preSource.outgoings -> filter (target)) -> excludes (preTarget)

But it doesn't work.
Does anybody have a hint, where I am thinking wrong?

Cheers, Xing

[Updated on: Sat, 17 September 2016 09:29] by Moderator

Re: Only one Edge between two nodes [message #1743635 is a reply to message #1743626] Sat, 17 September 2016 08:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi

You provide no repro so ...

Have you checked the source syntax errors? "filter" takes an OclType argument and "target" does not look like a type.

The isUnique iteration can help make uniqueness constraints readable.

Regards

Ed Willink
Re: Only one Edge between two nodes [message #1743638 is a reply to message #1743635] Sat, 17 September 2016 09:30 Go to previous messageGo to next message
Eclipse UserFriend
Hello Ed,

thanks for the answer.
I was referring to the example EMF from above.

But now I fixed it by:

aql:not(preSource.outgoings.target->exists(s | s = preTarget))

Is that ok, or is it not very elegant?

Do I put it in the Node Representation Precondition or the Node Creation Representation?
Because when I go with the curser over the ? of the Node Representation Precondition, it also says "Prevent Creation of the Element", but that is referring to the view, is that correct?


Cheers, Xing
Re: Only one Edge between two nodes [message #1744872 is a reply to message #1743638] Sat, 01 October 2016 03:14 Go to previous message
Eclipse UserFriend
Hello,

I am referring in the following to Alexander's EMF model.
The expression I presented in my last post works perfectly.

But I still get an error:

Description: Feature outgoings not found in EClass EObject
Location Problem: EMF Problem

Can I just ignore it? Because it does work exactly how I want it to work. So obviously my expression and therefore "outgoings" must be working, so it mus be found somewhere. And the error does not effect me.

Thank you
Xing
Previous Topic:Working with a container to group model elements by dragging
Next Topic:[AQL] Change Context Back
Goto Forum:
  


Current Time: Thu Mar 27 22:39:40 EDT 2025

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

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

Back to the top