Skip to main content



      Home
Home » Eclipse Projects » Sirius » Using types from additional MetaModels
Using types from additional MetaModels [message #1700145] Tue, 30 June 2015 07:57 Go to next message
Eclipse UserFriend
Hi,

I write an editor for a model that can be extended. Some objects in my metamodel have an URI attached that points to an EObject that I want to display in the diagram. The corresponding boxes get displayed but I cannot execute any queries on them. I get this error message from Acceleo:
!MESSAGE Compilation error for expression [self.getEntityName()/] : Cannot find operation (getEntityName()) for the type (Role)


The Metamodel is registered in the EPackage.Registry.INSTANCE and it is a normal ECore Model so I don`t think I need to register any additional factories.

What do I need to do for my expressions to be compiled successfuly?

EDIT: The plug-in which defines the additional MetaModel is registered in my MANIFEST.mf as a dependency.

[Updated on: Tue, 30 June 2015 08:00] by Moderator

Re: Using types from additional MetaModels [message #1700221 is a reply to message #1700145] Tue, 30 June 2015 18:34 Go to previous messageGo to next message
Eclipse UserFriend
I fixed this issue now, the mistake was calling the getter instead of accessing the field directly.

However I have trouble with the elements with deletion commands. I have external java commands defined for removing the objects but I this exception:
java.lang.RuntimeException
	at org.eclipse.sirius.tools.api.interpreter.InterpreterRegistry.getInterpreter(InterpreterRegistry.java:70)
	at org.eclipse.sirius.tools.api.interpreter.InterpreterUtil.getInterpreter(InterpreterUtil.java:39)
	at org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.buildDeleteFromToolTask(DeletionCommandBuilder.java:256)
	at org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.addDeleteDiagramElementFromTool(DeletionCommandBuilder.java:225)
	at org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.buildDeleteDiagramElement(DeletionCommandBuilder.java:182)
	at org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.buildCommand(DeletionCommandBuilder.java:129)
	at org.eclipse.sirius.diagram.tools.internal.command.UndoRedoCapableEMFCommandFactory.buildDeleteDiagramElement(UndoRedoCapableEMFCommandFactory.java:463)
	at org.eclipse.sirius.diagram.ui.graphical.edit.policies.NodeDeletionEditPolicy.buildGlobalDeleteCommand(NodeDeletionEditPolicy.java:87)
	at org.eclipse.sirius.diagram.ui.graphical.edit.policies.NodeDeletionEditPolicy.createDeleteSemanticCommand(NodeDeletionEditPolicy.java:80)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.ComponentEditPolicy.createDeleteCommand(ComponentEditPolicy.java:74)
	at org.eclipse.gef.editpolicies.ComponentEditPolicy.getDeleteCommand(ComponentEditPolicy.java:76)
	at org.eclipse.gef.editpolicies.ComponentEditPolicy.getCommand(ComponentEditPolicy.java:63)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.ComponentEditPolicy.getCommand(ComponentEditPolicy.java:299)
	at org.eclipse.sirius.diagram.ui.tools.api.policy.CompoundEditPolicy.getCommand(CompoundEditPolicy.java:120)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:502)


The problem seems to be that the object is not part of the models associated with the current Session. I tried to work around it this way:
SessionManager.INSTANCE.getSession(parent).addSemanticResource(child.eResource().getURI(), new NullProgressMonitor());

But I still have the same error.
Re: Using types from additional MetaModels [message #1700661 is a reply to message #1700221] Mon, 06 July 2015 05:53 Go to previous message
Eclipse UserFriend
Hi,

After adding the resource containing the object that caused the
exception, you should have no longer the problem.

Is the modelElement of InterpreterRegistry.getInterpreter (in stack
trace) in the same resource as the EObject named child in your code
(SessionManager.INSTANCE.getSession(parent).addSemanticResource(child.eResource().getURI(),
new NullProgressMonitor()))?

Regrds,

Laurent

Le 01/07/2015 00:34, Jim S. a écrit :
> I fixed this issue now, the mistake was calling the getter instead of
> accessing the field directly.
>
> However I have trouble with the elements with deletion commands. I have
> external java commands defined for removing the objects but I this
> exception:
> java.lang.RuntimeException
> at
> org.eclipse.sirius.tools.api.interpreter.InterpreterRegistry.getInterpreter(InterpreterRegistry.java:70)
>
> at
> org.eclipse.sirius.tools.api.interpreter.InterpreterUtil.getInterpreter(InterpreterUtil.java:39)
>
> at
> org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.buildDeleteFromToolTask(DeletionCommandBuilder.java:256)
>
> at
> org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.addDeleteDiagramElementFromTool(DeletionCommandBuilder.java:225)
>
> at
> org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.buildDeleteDiagramElement(DeletionCommandBuilder.java:182)
>
> at
> org.eclipse.sirius.diagram.tools.internal.command.builders.DeletionCommandBuilder.buildCommand(DeletionCommandBuilder.java:129)
>
> at
> org.eclipse.sirius.diagram.tools.internal.command.UndoRedoCapableEMFCommandFactory.buildDeleteDiagramElement(UndoRedoCapableEMFCommandFactory.java:463)
>
> at
> org.eclipse.sirius.diagram.ui.graphical.edit.policies.NodeDeletionEditPolicy.buildGlobalDeleteCommand(NodeDeletionEditPolicy.java:87)
>
> at
> org.eclipse.sirius.diagram.ui.graphical.edit.policies.NodeDeletionEditPolicy.createDeleteSemanticCommand(NodeDeletionEditPolicy.java:80)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.editpolicies.ComponentEditPolicy.createDeleteCommand(ComponentEditPolicy.java:74)
>
> at
> org.eclipse.gef.editpolicies.ComponentEditPolicy.getDeleteCommand(ComponentEditPolicy.java:76)
>
> at
> org.eclipse.gef.editpolicies.ComponentEditPolicy.getCommand(ComponentEditPolicy.java:63)
>
> at
> org.eclipse.gmf.runtime.diagram.ui.editpolicies.ComponentEditPolicy.getCommand(ComponentEditPolicy.java:299)
>
> at
> org.eclipse.sirius.diagram.ui.tools.api.policy.CompoundEditPolicy.getCommand(CompoundEditPolicy.java:120)
>
> at
> org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:502)
>
>
> The problem seems to be that the object is not part of the models
> associated with the current Session. I tried to work around it this way:
> SessionManager.INSTANCE.getSession(parent).addSemanticResource(child.eResource().getURI(),
> new NullProgressMonitor());
> But I still have the same error.


--
Laurent Redor - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Custom properties Editor with EEF
Next Topic:No dialects avaliable when creating representation programmatically
Goto Forum:
  


Current Time: Tue May 13 07:01:21 EDT 2025

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

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

Back to the top