Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Conditional Style for relation based edges?
Conditional Style for relation based edges? [message #1689986] Tue, 24 March 2015 20:15 Go to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 209
Registered: June 2010
Senior Member
Hi,

Let's assume that I'm creating a metamodel for statemachines. In short:

A Statemachine contains States
States contain Transitions
Transitions refer to a target State.

(I know that there are better ways to model state machines but this one illustrates my problem best.)

I am able to create a state diagram based on Node mapping representing the States. I use a relation based edge mapping for representing the Transitions.

So the source and target mappings are the StateNodeMappings,
The target finder for the relation based edge is: self.transitions.target

This indeed results in visualising the state machine.

NOW: suppose that I want to color self transitions red. I suppose that I should add a conditional style to the relation based edge mapping. However, the semantic element for that edge is the source state. How do I write a predicate for the conditional style that only applies to a subset of the transitions?

Does it even make sense to have a conditional style applied on a relation based edge (except for the fact that it might color all edges based on a property of the source state)?

Greetings,
Wilbert.

(I know that in this case the solution is to use a element based edge based on the Transition itself and use the self.eContainer() als source finder expression. But I just want to know whether the reasoning above makes sense.)

Re: Conditional Style for relation based edges? [message #1690302 is a reply to message #1689986] Thu, 26 March 2015 13:08 Go to previous message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
Le 24/03/2015 21:16, Wilbert Alberts a écrit :
> Hi,

Hi Wilberts,
>
> Let's assume that I'm creating a metamodel for statemachines. In short:
>
> A Statemachine contains States
> States contain Transitions
> Transitions refer to a target State.
>
> (I know that there are better ways to model state machines but this one
> illustrates my problem best.)
>
> I am able to create a state diagram based on Node mapping representing
> the States. I use a relation based edge mapping for representing the
> Transitions.
> So the source and target mappings are the StateNodeMappings,
> The target finder for the relation based edge is: self.transitions.target
>
> This indeed results in visualising the state machine.
>
> NOW: suppose that I want to color self transitions red. I suppose that I
> should add a conditional style to the relation based edge mapping.
> However, the semantic element for that edge is the source state. How do
> I write a predicate for the conditional style that only applies to a
> subset of the transitions?

You can use the view variable in your predicate (and so navigate to
source, with sourceNode, and target , with targetNode, of this edge).

You have an example in ecoreTools [1] that uses this service [2].

>
> Does it even make sense to have a conditional style applied on a
> relation based edge (except for the fact that it might color all edges
> based on a property of the source state)?
>
> Greetings,
> Wilbert.
>
> (I know that in this case the solution is to use a element based edge
> based on the Transition itself and use the self.eContainer() als source
> finder expression. But I just want to know whether the reasoning above
> makes sense.)
>
>

Best regards,

[1]
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/tree/org.eclipse.emf.ecoretools.design/description/ecore.odesign#n94
[2]
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/tree/org.eclipse.emf.ecoretools.design/src/org/eclipse/emf/ecoretools/design/service/DesignServices.java#n255

--
Laurent Redor - Obeo

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


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Behavior Tool
Next Topic:Example for sequence diagrams
Goto Forum:
  


Current Time: Fri Apr 26 10:42:45 GMT 2024

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

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

Back to the top