Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [Solved]How to bind edges only in the container
[Solved]How to bind edges only in the container [message #1527965] Thu, 25 December 2014 12:39 Go to next message
Xue Liu is currently offline Xue LiuFriend
Messages: 21
Registered: May 2014
Junior Member
Hello,

I am a newbie of Sirius. Now I want to implement a data flow diagram editor based on Sirius. The meta model is simple and shown below
index.php/fa/20301/0/

In Sirius, the "PrivilegeBoundary" is represented by a container. The "Component" is represented by a node, and the "DataFlow" is represented by element based edge. It is also clear to see different "PrivilegeBounday"s can contained same "Component" s inside. Now the problem is that there are duplicated "DataFlow"s shown between "PriviliegeBoundary"s, which are not I want. I want "DataFlow"s only shown in the container. I have try constraints in the "Precondition Expression", but they do not work.
index.php/fa/20302/0/

Thanks in advance and Happy Christmas

Update: Add sample projects

Xue Liu

[Updated on: Mon, 12 January 2015 14:33]

Report message to a moderator

Re: How to constraint edges only in the container [message #1547448 is a reply to message #1527965] Mon, 05 January 2015 12:39 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi Xue,

To limit what edges are displayed for your DataFlows, we can use either
the "Semantic Candidates Expression" either the "Precondition Expression".
If I understand correctly your need, you want display edge for your
DataFlow only if its source/target Component belongs to the same
PrivilegeBoundary? If it is your need you can write a Acceleo 3 boolean
expression to set in the "Precondition Expression", for example :

[source.eContainer(PrivilegeBoundary) =
target.eContainer(PrivilegeBoundary)/]

Also you talk about an issue with duplicates edges for a single
DataFlow, this issue can be caused by the "Source Finder Expression" and
the "Target Finder Expression". What have you set for these expressions?
If you can provide your example to test it will be more helpful to check
what is wrong.


Best Regards.

Le 25/12/2014 13:39, Xue Liu a écrit :
> Hello,
>
> I am a newbie of Sirius. Now I want to implement a data flow diagram editor based on Sirius. The meta model is simple and shown below
>
>
> In Sirius, the "PrivilegeBoundary" is represented by a container. The "Component" is represented by a node, and the "DataFlow" is represented by element based edge. It is also clear to see different "PrivilegeBounday"s can contained same "Component" s inside. Now the problem is that there are duplicated "DataFlow"s shown between "PriviliegeBoundary"s, which are not I want. I want "DataFlow"s only shown in the container. I have try constraints in the "Precondition Expression", but they do not work.
>
>
> Thanks in advance and Happy Christmas
>
> Xue Liu
>



--
Esteban Dugueperoux - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to constraint edges only in the container [message #1547523 is a reply to message #1547448] Mon, 05 January 2015 13:34 Go to previous messageGo to next message
Xue Liu is currently offline Xue LiuFriend
Messages: 21
Registered: May 2014
Junior Member
Hello Esteban,

Thank you for your reply. I would like to provide the examples in the attachment.
Re: How to constraint edges only in the container [message #1548997 is a reply to message #1547523] Tue, 06 January 2015 09:00 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hello Xue,

Looking quickly at your example, I see several problems :

1. If you use Acceleo 3, you must reference your metamodel to have
Viewpoint specification model validation succeed, we can reference you
metamodel on Diagram Description in the Metamodels tab of the properties
view.
2. According to your metamodel, as Components are not contained in
PrivilegeBoundary but in DataFlowDiagram, the precondition of the Edge
Mapping is incorrect. You must find an expression to test if the
Components in source and in target are referenced by the same
PrivilegeBoundary according to the PrivilegeBoundary.componetsWithin
references. As there is not EOpposite reference to this last one, we can
either create an EOpposite and use eInverse() Acceleo 3 call [1].
For example :

[source.eInverse(PrivilegeBoundary) = target.eInverse(PrivilegeBoundary)/]

[1]
https://wiki.eclipse.org/Acceleo/Acceleo_Operations_Reference#eInverse_.28OclType_oclType.29_:_Sequence.28oclType.29

Best Regards.

Le 05/01/2015 14:34, Xue Liu a écrit :
> Hello Esteban,
>
> Thank you for your reply. I would like to provide the examples in the attachment.
>



--
Esteban Dugueperoux - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to constraint edges only in the container [message #1550005 is a reply to message #1548997] Tue, 06 January 2015 21:37 Go to previous messageGo to next message
Philippe Dul is currently offline Philippe DulFriend
Messages: 25
Registered: November 2013
Junior Member
Hi,

like Esteban said, there is no containement between a PrimaryBoundary and a Component so the Acceleo expression [source.eContainer(PrivilegeBoundary) =
target.eContainer(PrivilegeBoundary)/] will not work.

To filter these duplicated edges between PrimaryBoundary, you can use a graphical precondition expression based on graphical source and target of edges :

Following expression should do the job :
 [sourceView.eContainer() = targetView.eContainer()/] 


but you can use more easily java like you did with your class HelperServices. In the precondition expression:
service:isValidEdge(sourceView,targetView)


And in the HelperServices class:
public boolean isValidEdge(EObject source, DSemanticDecorator sourceView, DSemanticDecorator targetView) {
  return sourceView.eContainer().equals(targetView.eContainer();
}

This code will return true if both source and target of the edge are located in the same graphical container (ie same graphical representation of PrimaryBoundary)
Re: How to constraint edges only in the container [message #1550154 is a reply to message #1550005] Tue, 06 January 2015 23:37 Go to previous message
Xue Liu is currently offline Xue LiuFriend
Messages: 21
Registered: May 2014
Junior Member
Hi philippe,

Thanks for your reply. The Java helper service does work for me Smile. And
[sourceView.eContainer().equals(targetView.eContainer())/]
is also working.

Regards,

Xue Liu

[Updated on: Tue, 06 January 2015 23:38]

Report message to a moderator

Previous Topic:Sample tree diagram specification
Next Topic:What is wrong
Goto Forum:
  


Current Time: Tue Apr 16 17:06:56 GMT 2024

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

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

Back to the top