Archi Forum

Archi => Archi Development => Topic started by: richdijk on September 10, 2017, 13:38:37 PM

Title: Archi development issue
Post by: richdijk on September 10, 2017, 13:38:37 PM
Dear Archi community,

For a research program I am adding 2 new relationship concepts. The first being a copy of the aggregation relationship went smooth; the second (also a copy of aggregation) gives me an issue. The problem is that the added png figure for the Palette does not show up and using the new relation via the magic connector gives the following error:

!SESSION 2017-09-08 21:33:04.122 -----------------------------------------------
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product com.archimatetool.editor.product
Command-line arguments:  -product com.archimatetool.editor.product -data C:\Users\Richard\workspace\neon3/../runtime-archi.product -dev file:C:/Users/Richard/workspace/neon3/.metadata/.plugins/org.eclipse.pde.core/archi.product/ -os win32 -ws win32 -arch x86 -consoleLog

!ENTRY com.archimatetool.editor 4 0 2017-09-10 14:16:05.996
!MESSAGE Could not create EditPart for: com.archimatetool.model.impl.DiagramModelArchimateConnection@15f56ff (id: c14dbfc3-698c-40dc-981d-12f10c5237c1, name: ) (font: null, fontColor: null, documentation: , lineWidth: 1, lineColor: null, text: , textPosition: 1, type: 0)

!ENTRY org.eclipse.ui 4 0 2017-09-10 14:16:06.337
!MESSAGE Unhandled event loop exception
java.lang.ClassCastException: com.archimatetool.editor.diagram.editparts.diagram.EmptyEditPart cannot be cast to org.eclipse.gef.ConnectionEditPart
   at org.eclipse.gef.editparts.AbstractGraphicalEditPart.createConnection(
   at org.eclipse.gef.editparts.AbstractGraphicalEditPart.createOrFindConnection(
   at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refreshSourceConnections(

Can somebody give me a hint for the location to solve? Thank you.

Kind regards,
Twitter: @richdijkstra
Title: Re: Archi development issue
Post by: Phil Beauvoir on September 10, 2017, 14:23:54 PM
Hi Richard,

Here's an old set of instructions:

Edit: way out of date!

Title: Re: Archi development issue
Post by: Phil Beauvoir on September 10, 2017, 14:47:09 PM
Actually I think that method is way out of date.   ???

The UIProvider class should look like this one:

public class MyAggregationRelationshipUIProvider extends AbstractArchimateRelationshipUIProvider {

    public EClass providerFor() {
        return IArchimatePackage.eINSTANCE.getMyAggregationRelationship();
    public EditPart createEditPart() {
        return new ArchimateRelationshipEditPart(MyAggregationConnectionFigure.class);

    public String getDefaultName() {
        return "My Relationship";

    public Image getImage() {
        return IArchiImages.ImageFactory.getImage(IArchiImages.ICON_MY_AGGREGATION_RELATION);

    public ImageDescriptor getImageDescriptor() {
        return IArchiImages.ImageFactory.getImageDescriptor(IArchiImages.ICON_MY_AGGREGATION_RELATION);

And should be registered in the plugin.xml as a objectUIProvider.
Title: Re: Archi development issue
Post by: richdijk on September 10, 2017, 16:00:41 PM
Thank you.

In fact the UIProvider class mentioned in the developer resource looks ok to me; at least this is the same structure I got from Github.

I will have a check.