Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320169 - Code generation on RQM execution.ecore fails using EMF 2.5.0 and is successful using EMF 2.4.2
Summary: Code generation on RQM execution.ecore fails using EMF 2.5.0 and is successfu...
Status: RESOLVED INVALID
Alias: None
Product: EMF
Classification: Modeling
Component: Tools (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dave Steinberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-17 10:56 EDT by Thomas Neal CLA
Modified: 2010-07-18 12:25 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Neal CLA 2010-07-17 10:56:56 EDT
Build Identifier: Version: 3.0 Build id: RTC-I20100709-1136

Following is the description of the problem and how we discovered it was related to the version of EMF being used to generate the code.

When I moved my RQM 3.0 M8 development environment to use an RTC 3.0 M7 client I was no longer able to generate code (via the Jazz Tools code generation package) from the execution.ecore model.  I would always encounter the following error.

A containment or bidirectional reference must be unique if its upper bound is different from 1

Pramod was able to successfully generate code from the execution.ecore model using the same version of the RTC 3.0 M7 client as I had (3.0 Build id: RTC-I20100709-1136).  We  began to search for differences in our development environments and found that he was using EMF 2.4.2 (via an Eclipse extension).  He had used the Installation Manager to update his RTC client to 3.0 M7 while I had installed the RTC 3.0 M7 client fresh from a zip (which contained EMF 2.5.0).  After I extracted the RTC 3.0 M7 client zip I installed the Jazz Tools code generation package (com.ibm.team.tools.codegen.feature 1.1.34.201001070913) and the EMF 2.5.0 Sample Ecore Editor via Help->Install New Software.

To verify if the problem was really the version of EMF being used, I removed the Jazz Tools code generation and EMF related packages (including XSD packages since they are combined for EMF 2.5.0) via Help->About->Installation Details->Installed Software.  The RTC client reported that it had modified the list of packages I wanted to remove because it could not remove all of them, but let me continue with the uninstall.  I then restarted the RTC client and installed the Jazz Tools code generation package and EMF Sample Ecore Editor from the EMF 2.4.2 SDK via Help->Install New Software.  I installed EMF 2.4.2 using the EMF Update Site at http://download.eclipse.org/modeling/emf/updates/.  I again restarted the RTC client and was then able to generate code successfully from the execution.ecore model.

I think the problem is specific to EMF 2.5.0 and our execution.ecore model because I can successfully generate code from other .ecore models in our source tree using EMF 2.5.0.  I can make the execution.ecore model (and any supporting artifacts) available to an IBM developer as this will probably be the quickest way to reproduce and resolve the problem.

Michael F. Fiedler (fiedler@us.ibm.com) can be contacted as an alternate about this issue.

Reproducible: Always

Steps to Reproduce:
1. Execute "Jazz Tools->Generate Component" from context menu of execution.ecore
2. 
3.
Comment 1 Ed Merks CLA 2010-07-18 12:25:39 EDT
That was a new constraint added to EMF 2.5. 

  https://bugs.eclipse.org/bugs/show_bug.cgi?id=320169

You'll just have to live with it. I.e., change your model to make those multi-valued references unique or generate despite the constraint violations. The Generator allows that, but I'm not sure if the Jazz tools do...