Home » Modeling » EMF Parsley » Treeviewer Other Editing Domain(Using a specific transactional editing domain with treeviewer context menu)
|
Re: Treeviewer Other Editing Domain [message #1708992 is a reply to message #1708923] |
Wed, 23 September 2015 07:50   |
|
On 22/09/2015 15:39, Martin Jonsson wrote:
> Hello all.
>
> I'm using EMF Parsley together with the eclipse BPMN2 modeler to model a
> view on extension data. A particularity of this is that it uses a
> specific transactional editing domain without which you cannot save the
> data.
>
> By extending the EditDomainFinder to get this editing domain from the
> EObject, for existing objects, all goes well. However, for objects that
> are added through the context menu, it does not work at all.
>
> 1) The editing domain for the context menu is specified with the context
> menu helper. This must be a AdapterFactoryEditingDomain. This is not
> dependant on the EObject and leads to different save commands for the
> added entry and the other modifications in the model. This leads to
> dreaded "not write command" error.
>
> 2) By trying to overcome this by extending the EditingMenuBuilder and
> putting the correct editing domain, I get a EMF EDIT error that the
> string representation of the feature is incorrect. It truly expects a
> AdapterFactoryEditingDomain.
>
> Is it possible to add a specific Transational Editing Domain also for
> the context menu? Otherwise, integrated scenarios for treeviewer that
> are not based on the EMF Edit editors are impossible.
Hi Martin
could you please provide some more information about the errors? A
stack trace would be nice, to help us understand whether we can relax
the requirement for an AdapterFactoryEditingDomain. Note that context
menu construction, unless customized, simply delegate to the standard
EMF.Edit behavior.
Also, a small reproducible example using a transaction editing domain
would be good.
Thanks in advance
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| |
Re: Treeviewer Other Editing Domain [message #1709433 is a reply to message #1709399] |
Mon, 28 September 2015 11:49   |
|
On 28/09/2015 11:03, Martin Jonsson wrote:
> Hello Lorenzo.
>
> Sorry for the late reply, I was on travel for a few days.
>
> I added stacktrace but manageble example is somewhat hard. You need to:
>
> 1 install the eclipse BPMN2 modeler
> 2 add extension element to the BPMN model via a custom model
> 3 Create parsley view on this custom model
>
> So I don't know this is possible without posting my complete plugin. So if you can figure out something from the stacktrace, that is great, otherwise we have to try something more complicated.
>
> Cheers
> Martin
>
Hi Martin
the relevant part of the stacktrace is this one
Caused by: java.lang.IllegalStateException: Cannot modify resource set
without a write transaction
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(TransactionChangeRecorder.java:284)
at
org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:240)
at
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at
org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:457)
at
org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:400)
at org.eclipse.emf.common.util.AbstractEList.addAll(AbstractEList.java:370)
at org.eclipse.emf.edit.command.AddCommand.doExecute(AddCommand.java:399)
but this seems to indicate that the transactional editing domain is not
used, otherwise I guess the standard EMF command would be executed in a
transaction, wouldn't they?
I mean, in the stacktrace Parsley is not involved at all.
So this stacktrace does not seem to be related to your original post (I
seem to recall that you manage to force to use a transactional editing
domain), or did I miss something?
Please keep in mind that I have no experience with transactional editing
domains, that's why I asked for a small example. I don't think all the
BPMN2 modeler is required: just an example using transactional editing
domain.
hope to hear from you soon
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Re: Treeviewer Other Editing Domain [message #1709672 is a reply to message #1709433] |
Wed, 30 September 2015 08:38   |
Martin Jonsson Messages: 21 Registered: March 2013 |
Junior Member |
|
|
Hello Lorenzo.
You are correct that the trace has nothing to do with Parsley.
The problem is as follows:
1) Parent EObject that belongs to a BPMN2 Transaction Domain.
2) Context menu adds a child EObject that belongs to a Parsley Abstract Editing Domain.
3) When the child object is appended as containment reference to the parent, EMF complains that there is no write command, which is correct, because the write command belongs to the child editing domain and not the parent editing domain.
So without the ability to set the editing domain at runtime, as a transactional editing domain from the parent, I cannot see how to use EMF parsley in more specialized scenarios than normal EMF Editors.
PS. The problem is also described in GMF - EMF integration on the following page:
http://www.eclipse.org/articles/Article-Integrating-EMF-GMF-Editors/#upgrading_the_editing_domain
under the "Upgrading the Editing Domain" section.
Hope you see the problem better now.
Cheers
Martin
[Updated on: Wed, 30 September 2015 08:51] Report message to a moderator
|
|
|
Re: Treeviewer Other Editing Domain [message #1709787 is a reply to message #1709672] |
Thu, 01 October 2015 06:51   |
|
On 30/09/2015 10:38, Martin Jonsson wrote:
> Hello Lorenzo.
>
> You are correct that the trace has nothing to do with Parsley.
>
> The problem is as follows:
>
> 1) Parent EObject that belongs to a BPMN2 Transaction Domain.
>
> 2) Context menu adds a child EObject that belongs to a Parsley Abstract
> Editing Domain.
>
> 3) When the child object is appended as containment reference to the
> parent, EMF complains that there is no write command, which is correct,
> because the write command belongs to the child editing domain and not
> the parent editing domain.
>
> So without the ability to set the editing domain at runtime, as a
> transactional editing domain from the parent, I cannot see how to use
> EMF parsley in more specialized scenarios than normal EMF Editors.
>
Hi Martin
so we could try to relax the assumption that the editing domain is an
adapter factory editing domain, from what I understand, so that you'll
be able to pass a transaction editing domain.
is that correct?
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
| | | | | | | | |
Goto Forum:
Current Time: Wed Dec 06 22:22:55 GMT 2023
Powered by FUDForum. Page generated in 0.03057 seconds
|