Creating ReqIF model programmatically [message #1696217] |
Sat, 23 May 2015 09:08  |
Eclipse User |
|
|
|
Hello,
I have my own EMF model, and I want to transform it ReqIF model. I could not find an example. So I try to do it like below:
public static ReqIF convert(Resource r) {
ReqIF reqif = factory.createReqIF();
ReqIFContent reqifContent = factory.createReqIFContent();
Specification specification = factory.createSpecification();
specification.setDesc("Deneme Reqif Specs");
reqifContent.getSpecifications().add(specification);
try {
// Get the resource
resource = r;
// try to load the file into resource
resource.load(null);
Iterator<EObject> resourceObjects = resource.getAllContents();
while (resourceObjects.hasNext()) {
Object o = resourceObjects.next();
SpecObject so = factory.createSpecObject();
so.setDesc("deneme spec obj");
reqifContent.getSpecObjects().add(so);
}
}// end of try
catch (NullPointerException | IOException e) {
e.printStackTrace();
}
reqif.setCoreContent(reqifContent);
return reqif;
}
When I try to open ReqIF in ProR editor, I get nulllPointerException.
I outline view, I can see specObjects and requirements but there is no connections between them. I do not know how to do that.
Any suggestions are appreciated.
Quote:java.lang.NullPointerException
at org.eclipse.rmf.reqif10.pror.editor.agilegrid.ProrLayoutAdvisor.getRowHeight(ProrLayoutAdvisor.java:96)
at org.eclipse.rmf.reqif10.pror.editor.agilegrid.ProrAgileGridViewer$10.getLocation(ProrAgileGridViewer.java:821)
at org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter.helper(EditingDomainViewerDropAdapter.java:284)
at org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter.dragEnter(EditingDomainViewerDropAdapter.java:144)
at org.eclipse.rmf.reqif10.pror.editor.agilegrid.ProrAgileGridViewer$10.dragEnter(ProrAgileGridViewer.java:716)
at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:61)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:782)
at org.eclipse.swt.dnd.DropTarget.DragEnter(DropTarget.java:297)
at org.eclipse.swt.dnd.DropTarget.DragEnter_64(DropTarget.java:275)
at org.eclipse.swt.dnd.DropTarget$3.method3(DropTarget.java:245)
at org.eclipse.swt.internal.ole.win32.COMObject.callback3(COMObject.java:92)
at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:363)
at org.eclipse.swt.dnd.DragSource.access$0(DragSource.java:289)
at org.eclipse.swt.dnd.DragSource$1.handleEvent(DragSource.java:172)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
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:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
|
|
|
|
Re: Creating ReqIF model programmatically [message #1696363 is a reply to message #1696222] |
Tue, 26 May 2015 06:13  |
Eclipse User |
|
|
|
Hello Furkan,
Glad to hear you oculd figure out how to build a model.
> I cannot set the name of the specification document and spec objects. I have setted the desc. of SpecificationType and SpecObjectType. nothing happened.
The name in the GUI is actually taken from the AttributeValues. There is a separate configuration that decides which values are used. In the GUI, you configure it via ProR | General Configuration | Default label.
I assume that you want to do this programmatically: This information is stored in the tool extensions, and there is a separate plugin (I think called org.eclipse.rmf.pror.configuration or similar), which contains the eCore model and code for accessing it.
Best,
- Michael
|
|
|
Powered by
FUDForum. Page generated in 0.03544 seconds