RSA model gets corrupted when refactoring.
RSA model gets corrupted when refactoring.
I have several RSA models that have many UML components and dependencies between them. I also have a UML profile that is applied to each component in the models.
I used the RSA refactoring feature to move components and dependencies from the various existing models to a single model. The problems is
1) RSA loses the profile that is applied to each of the components even though the same profile is applied to the target model.
2) RSA loses all source and target components in every dependency. It simple shows a '()' in the project explorer. Usually the dependency would appear under the source component of the dependency.
How do I solve this problem. I see the followin error repeated in the logs.
!ENTRY com.ibm.xtools.modeler.ui 4 5 2016-03-08 10:48:11.518
!MESSAGE Value 'org.eclipse.uml2.uml.internal.impl.UsageImpl@7b8d0445 (name: <unset>, visibility: <unset>)' is not legal. (platform:/resource/Reusable%20Assets%20-%20Applications%20Model%20-%20Fixing/apps_mid_way_through_fixing.emx, 7647, 323)
!STACK 0
org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.uml2.uml.internal.impl.UsageImpl@7b8d0445 (name: <unset>, visibility: <unset>)' is not legal. (platform:/resource/Reusable%20Assets%20-%20Applications%20Model%20-%20Fixing/apps_mid_way_through_fixing.emx, 7647, 323)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setManyReference(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValues(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardReferences(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(Unknown Source)
at org.eclipse.gmf.runtime.emf.core.resources.GMFHandler.endDocument(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.SAXWrapper.endDocument(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(Unknown Source)
at org.eclipse.gmf.runtime.emf.core.resources.GMFLoad.load(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(Unknown Source)
at com.ibm.xtools.emf.core.internal.resource.RMPResource.doLoad(Unknown Source)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Unknown Source)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Unknown Source)
at com.ibm.xtools.emf.core.internal.resource.RMPResource.load(Unknown Source)
at org.eclipse.gmf.runtime.emf.core.internal.domain.MSLEditingDomain.loadResource(Unknown Source)
at org.eclipse.gmf.runtime.emf.core.internal.domain.MSLEditingDomain.loadResource(Unknown Source)
at org.eclipse.gmf.runtime.emf.core.util.ResourceUtil.load(Unknown Source)
at com.ibm.xtools.modeler.ui.internal.ui.resources.OpenResourceCommand.openResource(Unknown Source)
at com.ibm.xtools.modeler.ui.navigator.internal.util.ModelerNavigatorUtil$1.run(Unknown Source)
at org.eclipse.gmf.runtime.emf.core.internal.domain.MSLTransactionalEditingDomain.runExclusive(Unknown Source)
at org.eclipse.gmf.runtime.emf.core.internal.domain.MSLEditingDomain.runExclusive(Unknown Source)
at com.ibm.xtools.modeler.ui.navigator.internal.util.ModelerNavigatorUtil.openResource(Unknown Source)
at com.ibm.xtools.modeler.ui.navigator.internal.providers.content.UMLNavigatorContentProvider.getChildren(Unknown Source)
at com.ibm.xtools.common.ui.navigator.internal.providers.AbstractContentProviderWrapper.getChildren(Unknown Source)
at org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.getChildren(Unknown Source)
at org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.getChildren(Unknown Source)
at org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.getChildren(Unknown Source)
at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider$1.run(Unknown Source)
at org.eclipse.core.runtime.SafeRunner.run(Unknown Source)
at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.internalGetChildren(Unknown Source)
at org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.getChildren(Unknown Source)
at org.eclipse.jface.viewers.AbstractTreeViewer.getRawChildren(Unknown Source)
at org.eclipse.jface.viewers.TreeViewer.getRawChildren(Unknown Source)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(Unknown Source)
at org.eclipse.jface.viewers.AbstractTreeViewer.getSortedChildren(Unknown Source)
at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(Unknown Source)
at org.eclipse.swt.custom.BusyIndicator.showWhile(Unknown Source)
at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(Unknown Source)
at org.eclipse.jface.viewers.TreeViewer.createChildren(Unknown Source)
at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(Unknown Source)
at org.eclipse.jface.viewers.AbstractTreeViewer.handleTreeExpand(Unknown Source)
at org.eclipse.jface.viewers.TreeViewer.handleTreeExpand(Unknown Source)
at org.eclipse.jface.viewers.AbstractTreeViewer$4.treeExpanded(Unknown Source)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Tree.wmNotifyChild(Unknown Source)
at org.eclipse.swt.widgets.Control.wmNotify(Unknown Source)
at org.eclipse.swt.widgets.Composite.wmNotify(Unknown Source)
at org.eclipse.swt.widgets.Control.WM_NOTIFY(Unknown Source)
at org.eclipse.swt.widgets.Control.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.CallWindowProc(Unknown Source)
at org.eclipse.swt.widgets.Tree.callWindowProc(Unknown Source)
at org.eclipse.swt.widgets.Tree.WM_LBUTTONDOWN(Unknown Source)
at org.eclipse.swt.widgets.Control.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Tree.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source)
at org.eclipse.ui.internal.Workbench.runUI(Unknown Source)
at org.eclipse.ui.internal.Workbench.access$4(Unknown Source)
at org.eclipse.ui.internal.Workbench$7.run(Unknown Source)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Unknown Source)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Unknown Source)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Unknown Source)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Unknown Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(Unknown Source)
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(Unknown Source)
at org.eclipse.equinox.launcher.Main.basicRun(Unknown Source)
at org.eclipse.equinox.launcher.Main.run(Unknown Source)
at org.eclipse.equinox.launcher.Main.main(Unknown Source)
Caused by: java.lang.IndexOutOfBoundsException: targetIndex=6, size=6
at org.eclipse.emf.common.util.BasicEList.move(Unknown Source)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.doMove(Unknown Source)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.move(Unknown Source)
... 97 more
One answer
The jazz.net forum is not the best place for 'pure' RSA questions. RSA DM yes but for RSA dW forum: https://www.ibm.com/developerworks/community/forums/html/forum?id=11111111-0000-0000-0000-000000000430&ps=25 is better.
This being said, ...
- what is the version of RSA you are using?
- what are the steps you followed to refactor your components.
- did you keep the option "Update references to moved element(s)" checked when refactoring?
For example if have create
a. profile1
b. model1 and model2 which have profile1 applied
c. a component1, in model1, stereotyped with one of the stereotypes of profile1
If you refactor move, using the right click menu refactor->move making sure the option "update references to moved elements" is selected (should be by default), the component1 to model2, then the component will be moved and its stereotype will persists.
The same should apply to relationships.
Even if you drag and drop the elements, the updates should be updated (in recent versions of RSA).
Regards,
François.