Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Diff/Merge » Pattern - new catalog
Pattern - new catalog [message #1816095] Mon, 21 October 2019 07:54 Go to next message
Michael C is currently offline Michael CFriend
Messages: 53
Registered: April 2019
Member
Hello,

I'm trying to use Diff/Merge Pattern. I have the error :"Cannot modify resource set without a write transaction" when I try to create a catalogue from the UI.

Do I need to override some methods ?



Re: Pattern - new catalog [message #1816143 is a reply to message #1816095] Tue, 22 October 2019 10:24 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
Hi,

In which modeling tool did you deploy Patterns?
Re: Pattern - new catalog [message #1816199 is a reply to message #1816143] Wed, 23 October 2019 13:52 Go to previous messageGo to next message
Michael C is currently offline Michael CFriend
Messages: 53
Registered: April 2019
Member
Hello,

At first I tried to deploy it on a product based on Sirius.

Then I tried to deploy it on a fresh instalation of Obeo Designer using the Sirius basic family example, I got the same error.

[Updated on: Wed, 23 October 2019 14:19]

Report message to a moderator

Re: Pattern - new catalog [message #1816205 is a reply to message #1816199] Wed, 23 October 2019 15:12 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
OK. Patterns will not work out of the box, unfortunately: you will have to implement a customization for the modeling environment you target. Beware that it is more complex than overriding a few methods. Assuming you want to know more, you can find two examples: a full-fledged, complex one for Capella [1, 2] and one for UML Designer [3] which is simpler but outdated [4].

[1] Web site: https://www.polarsys.org/capella/
[2] Git repo: https://git.polarsys.org/r/#/admin/projects/capella/capella, look into the /patterns folder.
[3] Web site: http://www.umldesigner.org/
[4] Git repo: https://git.eclipse.org/r/#/admin/projects/diffmerge/org.eclipse.emf.diffmerge.patterns, look into the /umldesigner folder.
Re: Pattern - new catalog [message #1816278 is a reply to message #1816205] Fri, 25 October 2019 07:49 Go to previous messageGo to next message
Michael C is currently offline Michael CFriend
Messages: 53
Registered: April 2019
Member
Thanks Olivier, I tried to find how they fixed this error but I'm still stuck.

The error is from CreateCatalogOperation when the run method call ResourcesUtil.getUriForFile.
I can't find the extension point that I should use to fix the creation of the catalog.

[Updated on: Fri, 25 October 2019 07:49]

Report message to a moderator

Re: Pattern - new catalog [message #1816352 is a reply to message #1816278] Mon, 28 October 2019 10:16 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
Can you provide the stack trace?
Re: Pattern - new catalog [message #1816418 is a reply to message #1816352] Tue, 29 October 2019 08:53 Go to previous messageGo to next message
Michael C is currently offline Michael CFriend
Messages: 53
Registered: April 2019
Member
Hello,

Here is the stack trace :

!ENTRY org.eclipse.ui 4 0 2019-10-29 09:52:16.888
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.IllegalStateException: Cannot modify resource set without a write transaction
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:349)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:303)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processResourceNotification(TransactionChangeRecorder.java:273)
	at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:239)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.dispatchNotification(NotifyingListImpl.java:261)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:294)
	at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:304)
	at org.eclipse.emf.diffmerge.patterns.repositories.catalogs.PatternCatalogAccessor.createCatalogIn(PatternCatalogAccessor.java:88)
	at org.eclipse.emf.diffmerge.patterns.repositories.catalogs.PatternCatalogAccessor.createCatalog(PatternCatalogAccessor.java:70)
	at org.eclipse.emf.diffmerge.patterns.repositories.catalogs.operations.CreateCatalogOperation.run(CreateCatalogOperation.java:49)
	at org.eclipse.emf.diffmerge.patterns.repositories.catalogs.operations.CreateCatalogOperation.run(CreateCatalogOperation.java:1)
	at org.eclipse.emf.diffmerge.patterns.core.operations.AbstractModelOperation.run(AbstractModelOperation.java:174)
	at org.eclipse.emf.diffmerge.patterns.support.environment.DefaultModelEnvironment.execute(DefaultModelEnvironment.java:89)
	at org.eclipse.emf.diffmerge.patterns.ui.wizards.AbstractPatternPresentationPage$22.widgetSelected(AbstractPatternPresentationPage.java:843)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4173)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3986)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3585)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
	at org.eclipse.jface.window.Window.open(Window.java:799)
	at org.eclipse.emf.diffmerge.patterns.ui.actions.CreatePatternAction.coreRun(CreatePatternAction.java:46)
	at org.eclipse.emf.diffmerge.patterns.ui.actions.AbstractContextualAction.run(AbstractContextualAction.java:206)
	at org.eclipse.emf.diffmerge.patterns.ui.handlers.CreatePatternHandler.handleSelection(CreatePatternHandler.java:41)
	at org.eclipse.emf.diffmerge.patterns.ui.handlers.AbstractWorkbenchSelectionHandler.execute(AbstractWorkbenchSelectionHandler.java:55)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:283)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:95)
	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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:318)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:252)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:498)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:438)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4173)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3986)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3585)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	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:660)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1441)
Re: Pattern - new catalog [message #1816457 is a reply to message #1816418] Tue, 29 October 2019 16:11 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
OK, the extension point is org.eclipse.emf.diffmerge.patterns.core.modelEnvironment. Anyway, to make things easier I have updated the Patterns integration to UML Designer so that it works (experimentally) with the current version (9.0.0). This update is at the tip of branch 0.11.x.

So you can have a look at the two plugins in folder 'umldesigner' of the Patterns Git repository in branch 0.11.x. If you transpose those plugins to your target environment, there are good chances that it works. You essentially need to remove the dependency of plugin org.eclipse.emf.diffmerge.patterns.diagrams.umldesigner to org.eclipse.uml2.uml, insert a dependency to your own metamodel plugin(s) instead, and fix the plugin accordingly.
Re: Pattern - new catalog [message #1816462 is a reply to message #1816457] Tue, 29 October 2019 16:29 Go to previous messageGo to next message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
Alternatively, if you prefer to focus solely on the problem you mentioned, you may just copy-paste and adapt UMLDesignerModelEnvironment and contribute it through the extension point I mentioned.
In any case, I'll be happy to know if you manage to solve the problem and play with Patterns in your own modeling environment.
Re: Pattern - new catalog [message #1817027 is a reply to message #1816462] Thu, 14 November 2019 09:43 Go to previous messageGo to next message
Michael C is currently offline Michael CFriend
Messages: 53
Registered: April 2019
Member
Thanks you Olivier,

I did not manage to implement it yet. I'll keep trying later and let you know about my results.
Re: Pattern - new catalog [message #1823083 is a reply to message #1817027] Thu, 19 March 2020 09:15 Go to previous messageGo to next message
Michael C is currently offline Michael CFriend
Messages: 53
Registered: April 2019
Member
Hello, I'm trying to make the pattern work with my tool again. I still have several issues.

I'm able to create a catalog.
When I create a pattern and click finish on the Wizard, the objects are added into the template but the wizard is not closed.
I don't really understand what are the roles.

When I create a pattern I have an error : "Pattern Image Computation" has encountered a problem. An internal error occurred during "Pattern Image Computation".
An internal error occurred during: "Pattern Image Computation".
loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated loading for a different type with name "org/w3c/dom/events/Event"

I'm not able to apply the pattern. I guess in a first step I should make sure that it's properly created.
Re: Pattern - new catalog [message #1823301 is a reply to message #1823083] Tue, 24 March 2020 15:35 Go to previous message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
> I don't really understand what are the roles.

You can find information in the embedded documentation: in Eclipse with Patterns installed, click Help menu -> Help Contents -> Modeling Patterns Guide -> Pattern creation -> Creation wizard tab 2: Pattern content -> Roles. Alternatively, you can find the source of the documentation in the Patterns repo in /doc/org.eclipse.emf.diffmerge.patterns.doc where you will be interested in /pages/3.

> loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated loading ...

At first sight it looks like a low-level platform construction problem. Not sure how I can help on this...

> I guess in a first step I should make sure that it's properly created.

Right. You can double-click the .patterns file, or alternatively right-click -> Open With -> Pattern Catalog. In the editor you can see the contents of the pattern and try to validate it.
Previous Topic:Disable the Coevolution
Next Topic:'Generic' EMF Diff/Merge
Goto Forum:
  


Current Time: Sun Apr 28 13:26:21 GMT 2024

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

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

Back to the top