Precondition Expression and Conditional Type of Relation Based Edge [message #1698052] |
Wed, 10 June 2015 16:51 |
Shin-Yi Lin 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:
The precondition expression location:
The predicate expression of conditional style location:
The relationship of diagram I want to build:
-
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 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.02552 seconds