Feature 'version' not found [message #632667] |
Wed, 13 October 2010 15:39  |
Eclipse User |
|
|
|
Hi,
I am trying to programatically read a BPMN file created using Eclipse BPMN editor. I am getting the following error while trying to read the model:
Feature 'version' not found. (file:///C:/code/workspaces/bpmn/BPMNPoC/src/GPGJoin.bpmn, 2, 175)
The following is my source code:
public class BPMNReader {
@SuppressWarnings("unchecked")
public static void main(String[] args) {
registerMetaModels();
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn", new BpmnResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new EcoreFactoryImpl());
Resource resource = resourceSet.getResource(URI.createFileURI("src/GPGJoin.bpmn"), true);
}
private static void registerMetaModels() {
EcorePackage.eINSTANCE.eClass();
EcoreFactory.eINSTANCE.eClass();
GMFGraphPackage.eINSTANCE.eClass();
GMFMapPackage.eINSTANCE.eClass();
GMFToolPackage.eINSTANCE.eClass();
NotationPackage.eINSTANCE.eClass();
BpmnPackage.eINSTANCE.eClass();
BpmnFactory.eINSTANCE.eClass();
}
}
Can someone please tell me how I can fix this error?
Thanks,
Venkat
|
|
|
Re: Feature 'version' not found [message #632672 is a reply to message #632667] |
Wed, 13 October 2010 16:15  |
Eclipse User |
|
|
|
I fixed the issue by modifying the code to the following:
@SuppressWarnings("unchecked")
public static void main(String[] args) {
BpmnPackage.eINSTANCE.eClass();
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn", new XMIResourceFactoryImpl());
Resource resource = resourceSet.getResource(URI.createFileURI("src/GPGJoin.bpmn"), true);
BpmnDiagram bpmnModel = (BpmnDiagram) resource.getContents().get(0);
}
|
|
|
Powered by
FUDForum. Page generated in 0.05693 seconds