Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312485

Summary: Aspects : "right click > New child aspect" not available in JWT 0.7 and previous
Product: [SOA] JWT Reporter: Marc Dutoo <marc.dutoo>
Component: MetamodelAssignee: Project Inbox <jwt.metamodel-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: christian.saad
Version: 1.0.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Marc Dutoo CLA 2010-05-11 14:47:54 EDT
Symptom :

In the workflow editor, right-clicking on a model element and selecting "new child" should display a list containing all child aspects (like custom Properties) that can be added to this element, but these are not there.


Analysis :

Debugging JWT 0.7 (fresh installed in a new Eclipse 3.5r2) or Scarbo 1.0 (RCP application including JWT) using remote debugging shows that JWT's use of the EMF.edit framework has not been configured to use aspects. More precisely, root JWT model elements and especially ModelElement should have an item provider adapter that extends AspectEnrichedItemProviderAdapter, but they extend rather ItemProviderAdapter directly. This has been detected by tracing the execution of the following overriden method :

protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object)


Solution :

ModelElementItemProvider should extend AspectEnrichedItemProviderAdapter rather than ItemProviderAdapter, and in JWTMetaModel.genmodel the root should have the "Provider Root Extends Class" property set to "org.eclipse.jwt.we.conf.aspects.provider.AspectEnrichedItemProviderAdapter". Actually, it is already the case in the source code since January the 12th, 2010, so we only have to check it is still OK with the actual build of the upcoming yearly release.


Patch :

Patching the JWT 0.7 (or earlier) plugin jar with only the said slight change to  ModelElementItemProvider could be done if necessary.


Workaround :

Other Aspect features still work. For instance, the custom Property tab displays existing custom property aspects on the selected element and allow to change its value.

What is missing is the ability to create new aspect (or custom Property) instances. Here is a workaround : close the workflow being edited, open its .workflow_conf file using the Conf editor, and there copy and paste in the Model element an AspectInstance element that already has the right id, then select the workflow model element it decorates and save it. It'll then appear in its custom UI, for instance the custom Property tab if it is a custom Property.
Comment 1 Marc Dutoo CLA 2010-05-11 14:49:09 EDT
Another obvious workaround is to use JWT from its source code, see wiki.
Comment 2 Marc Dutoo CLA 2010-06-30 08:01:53 EDT
Hi Chris

It should have been fixed on 1.0 (Helios) !!

So either revert it to 0.7 and mark it fixed, or say it still happens.

Regards,
Marc
Comment 3 Christian Saad CLA 2010-06-30 09:35:55 EDT
Has been fixed:

public class ModelElementItemProvider extends AspectEnrichedItemProviderAdapter

I updated the entry in the genmodel which was still pointing to the old package structure but this doesn't affect the code after generation so it's fine for 0.7 and 1.0
Comment 4 Marc Dutoo CLA 2010-06-30 09:56:14 EDT
Great to know that it's fixed !

But you say that it's "fine for 0.7", how can that be fixed in 0.7 since on  2010-05-11 I tested that it was not, using the update site 0.7 jars ?
Comment 5 Christian Saad CLA 2010-06-30 10:31:57 EDT
Good point. I took a look at the ItemProvider and genmodel and they appear to be fine. Definitely not for the December release but for Helios it should have been included. But it's strange that it didn't work as late as May. Could you check again?
Comment 6 Marc Dutoo CLA 2010-06-30 10:37:21 EDT
My bad, what I mean is, if you read my previous posts :
   * with the May HEAD code it worked, so I guess it still does
   * but I tested in May that it didn't work with the 0.7 update site code
Comment 7 Marc Dutoo CLA 2011-06-06 05:27:53 EDT
Tested (back then), works OK.
Comment 8 Marc Dutoo CLA 2011-06-06 10:43:09 EDT
Patched last version where it occured : 1.0.0 .