Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » A node is source of a relation only once(relation disappear when creating same relation with another target)
A node is source of a relation only once [message #1766485] Thu, 22 June 2017 03:29 Go to next message
Lina 20 is currently offline Lina 20Friend
Messages: 32
Registered: March 2017
Member
Hi,

I have an Application Collaboration (node) that can have an aggregation relation with other Applications Collaborations and/or Groups. The problem that I have is when i try to create a relation with a node that already have an aggregation relation (with other target element). What happen is that the relation that exists before disappear and the new one is drawed. and I need the two relations with the same source and different target to be drawed.
index.php/fa/29751/0/
In this case when I draw the relation from t1 to t2, the relation from t1 to ej1 disappear and the new one is drawed.

I check my metamodel and the relation is zero to many index.php/fa/29748/0/

This is my aggregation relation based edge specification index.php/fa/29749/0/

This is my edge creation for the relation
index.php/fa/29750/0/

Thank you so much for your help,


Lina
Re: A node is source of a relation only once [message #1766502 is a reply to message #1766485] Thu, 22 June 2017 09:41 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 172
Registered: July 2009
Senior Member
Hi Lina,

This is not a problem from Sirius,
Sirius enable to have many edge from the same source. I joined you an example that do that.
I don't understand why the edge is replaced. Have you the 2 relations in the semantic model. The problem is maybe here.

Regards
Re: A node is source of a relation only once [message #1766549 is a reply to message #1766502] Thu, 22 June 2017 23:20 Go to previous messageGo to next message
Lina 20 is currently offline Lina 20Friend
Messages: 32
Registered: March 2017
Member
Hi Julien,

Thanks for your help. I was looking at your example and I realize that this metamodel do not work for me because I have so many elements and I have to create the relations between them manually, so I changed my metamodel to have relations and my application element to have a relation of one kind.
index.php/fa/29766/0/
index.php/fa/29767/0/

On the other side I change my relation based edge to an element based edge.
index.php/fa/29768/0/
*my root element has reations to ArchimateRelations.

And in the create of the edge I change context to source, so i can add the relation -others-
index.php/fa/29769/0/

And I'm getting the following error.

!MESSAGE execute
!STACK 0
org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:496)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:71)
at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramCommandStack.execute(DDiagramCommandStack.java:52)
at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack.execute(DiagramCommandStack.java:156)
at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
at org.eclipse.gef.tools.AbstractConnectionCreationTool.handleCreateConnection(AbstractConnectionCreationTool.java:256)
at org.eclipse.gef.tools.ConnectionCreationTool.handleButtonDown(ConnectionCreationTool.java:77)
at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.java:1091)
at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:245)
at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMousePressed(DomainEventDispatcher.java:348)
at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDown(LightweightSystem.java:523)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:193)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to archimateC3.ArchimateElement
at archimateC3.impl.ArchimateRelationImpl.eSet(ArchimateRelationImpl.java:221)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1071)
at org.eclipse.sirius.ecore.extender.business.internal.accessor.ecore.EcoreIntrinsicExtender.eSet(EcoreIntrinsicExtender.java:318)
at org.eclipse.sirius.ecore.extender.business.api.accessor.CompositeMetamodelExtender.eSet(CompositeMetamodelExtender.java:310)
at org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor.eSet(ModelAccessor.java:201)
at org.eclipse.sirius.business.internal.helper.task.operations.SetValueTask.execute(SetValueTask.java:104)
at org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask.executeTask(ExecuteToolOperationTask.java:127)
at org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask.executeTask(ExecuteToolOperationTask.java:138)
at org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask.executeTask(ExecuteToolOperationTask.java:138)
at org.eclipse.sirius.business.internal.helper.task.ExecuteToolOperationTask.execute(ExecuteToolOperationTask.java:111)
at org.eclipse.sirius.business.api.helper.task.TaskExecutor.execute(TaskExecutor.java:64)
at org.eclipse.sirius.tools.api.command.SiriusCommand.doExecute(SiriusCommand.java:80)
at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
at org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper.doExecuteWithResult(GMFCommandWrapper.java:102)
at org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand.doExecute(AbstractTransactionalCommand.java:247)
at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
at org.eclipse.gmf.runtime.common.core.command.CompositeCommand.doExecuteWithResult(CompositeCommand.java:403)
at org.eclipse.gmf.runtime.common.core.command.AbstractCommand.execute(AbstractCommand.java:134)
at org.eclipse.sirius.diagram.ui.tools.internal.commands.WrappingCommandIgnoringAffectedFiles.execute(WrappingCommandIgnoringAffectedFiles.java:124)
at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:488)
... 39 more


When I check the odesign is ok, and I do not understand why a string cannot be cast to an archimate element if I think i'm just using archimate elements, not strings. The relation is not being created.

Thank you so much for your help.

Lina

[Updated on: Thu, 22 June 2017 23:21]

Report message to a moderator

Re: A node is source of a relation only once [message #1766612 is a reply to message #1766549] Fri, 23 June 2017 13:26 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 172
Registered: July 2009
Senior Member
Hi Lina,

Could you send me a use case with your metamodel and odesign project?
There is a mistake in the specification file (.odesign) that produce the error but I don't know what.

Regards,
Re: A node is source of a relation only once [message #1766630 is a reply to message #1766612] Fri, 23 June 2017 15:39 Go to previous messageGo to next message
Lina 20 is currently offline Lina 20Friend
Messages: 32
Registered: March 2017
Member
Hi Julien,

Thank you so so much for your help.
I attached my odesign and ecore in a use case project. If you want you can leave only the archimatesoloviewpoint in the odesign file.


Thank you! Looking forward to your answer!

Lina

[Updated on: Fri, 23 June 2017 15:41]

Report message to a moderator

Re: A node is source of a relation only once [message #1766780 is a reply to message #1766630] Tue, 27 June 2017 09:17 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 172
Registered: July 2009
Senior Member
Hi Lina,

The problem come from the creation tool.
In the creation tool you do a changeContext to var:source, but in this case source correspond to an ApplicationCollaboration, but ApplicationCollaboration does not contains an Access. Access is contained by ArchimateModel, so you should use the Change Context to aql:source.eContainer().
In the Access Create Instance the Reference Name is relations and not others.
In the Set sourceC you should use the value expression var:source and not only source. This is why you have the Exception Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to archimateC3.ArchimateElement
Do the same thing for targetC.

Regards,
Re: A node is source of a relation only once [message #1766832 is a reply to message #1766780] Tue, 27 June 2017 19:09 Go to previous message
Lina 20 is currently offline Lina 20Friend
Messages: 32
Registered: March 2017
Member
Hi Julien,

Thank you so so much for your help. It works perfectly!

Lina
Previous Topic:Conditional style for EMF Map entries as Nodes in List container
Next Topic:Single-step undo
Goto Forum:
  


Current Time: Thu Mar 28 22:47:07 GMT 2024

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

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

Back to the top