Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Precondition Expression and Conditional Type of Relation Based Edge
Precondition Expression and Conditional Type of Relation Based Edge [message #1698052] Wed, 10 June 2015 16:51 Go to next message
Shin-Yi Lin is currently offline Shin-Yi LinFriend
Messages: 34
Registered: June 2015
Member
Hi all,

I want to draw relation-based-edges based on AND, OR, and Equal different relationships between Nodes.

When I draw the edges with EMPTY precondition expression and predicate expression of conditional style, it works.
However, when I try to write:
(1) [self.contribTypeToParent.name='AND'/]
(2) [self.contribTypeToParent.name.contains('AND')/]
(3) [self.contribTypeToParent.name.toString()='AND'/]
(4) [view.getProperty(self.contribTypeToParent.name).contains('OR')/]
, those all fail.

Could anyone help me the issue? Thanks.

Here is my metamodel:
index.php/fa/22160/0/

The precondition expression location:
index.php/fa/22133/0/

The predicate expression of conditional style location:
index.php/fa/22134/0/

The relationship of diagram I want to build:
index.php/fa/22135/0/
  • Attachment: 1.jpg
    (Size: 37.01KB, Downloaded 861 times)
  • Attachment: 2.jpg
    (Size: 66.36KB, Downloaded 860 times)
  • Attachment: 3.jpg
    (Size: 11.16KB, Downloaded 860 times)
  • Attachment: test.jpg
    (Size: 19.06KB, Downloaded 769 times)

[Updated on: Fri, 12 June 2015 16:11]

Report message to a moderator

Re: Precondition Expression and Conditional Type of Relation Based Edge [message #1698128 is a reply to message #1698052] Thu, 11 June 2015 13:39 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

I do not know how the name field of your "Contribution" element is set.
Furthermore, I am a little confused by the fact that you named your Edge
Mapping "AND".
From what I see, what I would do is an Element based Edge Mapping with
the Domain Class as Decomposition or Contribution (depending on the
undisplayed metaclasses inheriting Contribution). The source finder
expression would be [eContainer()/] and the target expression
[targetSoftGoal/].
Then in your conditional style if you want different display for your
ANDDecomposition, ORDecomposition and EQLDecomposition, you simply test
the type of Decomposition respectively
[self.oclIsTypeOf(ANDDecomposition)/], [self.oclIsTypeOf(ORDecomposition
)/] and [self.oclIsTypeOf(EQLDecomposition)/].
Does this sound right to you?

Note that if the name field of "Contribution" is just used to fill it
has AND, OR or EQL...then maybe the conditional style are not usefull
and you should just have one style and the label should display this
name feature.

Regards,
Steve

Le 10/06/2015 18:51, Shin-Yi Lin a écrit :
> Hi all,
>
> I want to draw relation-based-edges based on AND, OR, and Equal different relationships between Nodes.
>
> When I draw the edges with EMPTY precondition expression and predicate expression of conditional style, it works.
> However, when I try to write:
> (1) [self.contribTypeToParent.name='AND'/]
> (2) [self.contribTypeToParent.name.contains('AND')/]
> (3) [self.contribTypeToParent.name.toString()='AND'/]
> (4) [view.getProperty(self.contribTypeToParent.name).contains('OR')/]
> , those all fail.
>
> Could anyone help me the issue? Thanks.
>
> Here is my metamodel:
>
>
> The precondition expression location:
>
>
> The predicate expression of conditional style location:
>
>
> The relationship of diagram I want to build:
>
>


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Precondition Expression and Conditional Type of Relation Based Edge [message #1698183 is a reply to message #1698128] Thu, 11 June 2015 22:35 Go to previous message
Shin-Yi Lin is currently offline Shin-Yi LinFriend
Messages: 34
Registered: June 2015
Member
Hi Steve,

Thank you for answering my question. It really helps me a lot. I's stuck by this for some days. I can keep progressing now.

I named the name fields of Contribution "AND".
Because the model AND three sources softgoals, Confidentiality, Availability, and Integrity, I named the Edge Mapping "AND".

[self.oclIsTypeOf(ANDDecomposition)/]
It works in Precondition Expression, but not in the conditional style. But it still solve my problem. Thank you so much Surprised

Regards,

Shin-Yi
Previous Topic:broken link for documentation
Next Topic:Node Creation Problem
Goto Forum:
  


Current Time: Thu Apr 18 11:05:16 GMT 2024

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

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

Back to the top