Home » Archived » Service Oriented Architecture Tools Platform (STP) » BPMN parsing problem : feature not found
BPMN parsing problem : feature not found [message #374403] |
Thu, 20 December 2007 09:39 |
Eclipse User |
|
|
|
Originally posted by: s.balard.prometil.com
Hi,
I've generated BPMN java classes architecture from bpmn.xsd using EMF
genmodel tools. I want to access to BPMN data throught these classes. I've
created a short main method :
public static void main(String[] args) {
// Create a resource set.
ResourceSet resourceSet = new ResourceSetImpl();
final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
resourceSet.getPackageRegistry());
resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
extendedMetaData);
resourceSet.getPackageRegistry().put("bpmn", BpmnPackage.eINSTANCE);
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put("bpmn", new BpmnResourceFactoryImpl());
// Get the URI of the model file.
URI fileURI = URI.createFileURI(new File("resources/modeler.bpmn")
.getAbsolutePath());
Resource resource = resourceSet.getResource(fileURI, true);
BpmnDiagramImpl root = (BpmnDiagramImpl) resource.getContents().get(0);
System.out.println("loading ok");
}
Here, first lines of modeler.bpmn :
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:BpmnDiagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:bpmn="http://stp.eclipse.org/bpmn"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmi:id="_l1KbkZgZEdyr1JEvf_kQJA" iD="_l1KbkJgZEdyr1JEvf_kQJA">
<pools xmi:type="bpmn:Pool" xmi:id="_l1zUwZgZEdyr1JEvf_kQJA"
iD="_l1zUwJgZEdyr1JEvf_kQJA" name="Processus">
...
</pools>
</bpmn:BpmnDiagram>
I have a problem with xmi:XXX attribute type. Indeed, for
BpmnResourceFactory, feature version is not defined in bpmn.xsd, it's a
xmi attribute (defined in xmi.xsd).
My question : Is it possible to specify to ignore this attribute type
(with xmi prefix) in BpmnResourceFactory or can I delegate xmi attributes
treatment to another ResourceFactory ?
Regards,
Sebastien
|
|
|
Re: BPMN parsing problem : feature not found [message #374404 is a reply to message #374403] |
Thu, 20 December 2007 09:54 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
Hi,
you'll need to register the Ecore factory as well. It will handle the
xmi attributes it added for EModelElements.
Regards,
Antoine
Sebastien BALARD wrote:
> Hi,
> I've generated BPMN java classes architecture from bpmn.xsd using EMF
> genmodel tools. I want to access to BPMN data throught these classes.
> I've created a short main method :
>
> public static void main(String[] args) {
>
> // Create a resource set.
> ResourceSet resourceSet = new ResourceSetImpl();
>
> final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
> resourceSet.getPackageRegistry());
>
> resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
> extendedMetaData);
> resourceSet.getPackageRegistry().put("bpmn", BpmnPackage.eINSTANCE);
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
> .put("bpmn", new BpmnResourceFactoryImpl());
>
> // Get the URI of the model file.
> URI fileURI = URI.createFileURI(new File("resources/modeler.bpmn")
> .getAbsolutePath());
> Resource resource = resourceSet.getResource(fileURI, true);
>
> BpmnDiagramImpl root = (BpmnDiagramImpl) resource.getContents().get(0);
>
> System.out.println("loading ok");
> }
>
> Here, first lines of modeler.bpmn :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <bpmn:BpmnDiagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:bpmn="http://stp.eclipse.org/bpmn"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmi:id="_l1KbkZgZEdyr1JEvf_kQJA" iD="_l1KbkJgZEdyr1JEvf_kQJA">
> <pools xmi:type="bpmn:Pool" xmi:id="_l1zUwZgZEdyr1JEvf_kQJA"
> iD="_l1zUwJgZEdyr1JEvf_kQJA" name="Processus">
> ...
> </pools>
> </bpmn:BpmnDiagram>
>
> I have a problem with xmi:XXX attribute type. Indeed, for
> BpmnResourceFactory, feature version is not defined in bpmn.xsd, it's a
> xmi attribute (defined in xmi.xsd).
> My question : Is it possible to specify to ignore this attribute type
> (with xmi prefix) in BpmnResourceFactory or can I delegate xmi
> attributes treatment to another ResourceFactory ?
>
> Regards,
> Sebastien
>
--
Intalio, the Open Source BPMS Company
<a href="http://www.intalio.com">http://www.intalio.com</a>
<a href="http://bpms.intalio.com">Community website</a>
|
|
|
Re: BPMN parsing problem : feature not found [message #374405 is a reply to message #374404] |
Thu, 20 December 2007 13:20 |
Eclipse User |
|
|
|
Originally posted by: s.balard.prometil.com
Hi,
I always have the same error (Feature 'version' not found) with this code
(corrected using your suggestion) :
// create a ResourceSet.
this.resourceSet = new ResourceSetImpl();
// initialize ResourceSet
final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
resourceSet.getPackageRegistry());
resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
extendedMetaData);
resourceSet.getPackageRegistry().put("bpmn", BpmnPackage.eINSTANCE);
resourceSet.getPackageRegistry().put("xmi", EcorePackage.eINSTANCE);
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put("bpmn", new BpmnResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put("xmi", new EcoreFactoryImpl());
Did i make a mistale in my Ecore factory registration ?
Regards,
Sebastien
|
|
|
Re: BPMN parsing problem : feature not found [message #374406 is a reply to message #374405] |
Thu, 20 December 2007 13:32 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
Hi Sebastien,please see comments inline:
Sebastien BALARD wrote:
> Hi,
> I always have the same error (Feature 'version' not found) with this
> code (corrected using your suggestion) :
>
> // create a ResourceSet.
> this.resourceSet = new ResourceSetImpl();
> // initialize ResourceSet
> final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
> resourceSet.getPackageRegistry());
>
> resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
> extendedMetaData);
> resourceSet.getPackageRegistry().put("bpmn", BpmnPackage.eINSTANCE);
> resourceSet.getPackageRegistry().put("xmi", EcorePackage.eINSTANCE);
I think you should put the namespace here, not the file extension.
Look at the EPackage$Registry javadoc:
A map from {@link EPackage#getNsURI() namespace URI} to {@link EPackage}.
so it should be:
resourceSet.getPackageRegistry().put(BpmnPackage.getNsURI(),
BpmnPackage.eINSTANCE);
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
> .put("bpmn", new BpmnResourceFactoryImpl());
This is necessary.
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
> .put("xmi", new EcoreFactoryImpl());
this is of no use.
>
> Did i make a mistale in my Ecore factory registration ?
>
> Regards,
> Sebastien
>
HTH
Antoine
--
Intalio, the Open Source BPMS Company
<a href="http://www.intalio.com">http://www.intalio.com</a>
<a href="http://bpms.intalio.com">Community website</a>
|
|
|
Re: BPMN parsing problem : feature not found [message #374407 is a reply to message #374406] |
Thu, 20 December 2007 14:08 |
Eclipse User |
|
|
|
Originally posted by: s.balard.prometil.com
Hi,
I have this now, and same effect (Feature 'version' not found)
// create a ResourceSet.
this.resourceSet = new ResourceSetImpl();
// initialize ResourceSet
final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
resourceSet.getPackageRegistry());
resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
extendedMetaData);
resourceSet.getPackageRegistry().put(BpmnPackage.eNS_URI,
BpmnPackage.eINSTANCE);
resourceSet.getPackageRegistry().put(EcorePackage.eNS_URI,Ec orePackage.eINSTANCE);
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put("bpmn", new BpmnResourceFactoryImpl());
Thanks,
Sebastien
|
|
|
Re: BPMN parsing problem : feature not found [message #374408 is a reply to message #374407] |
Thu, 20 December 2007 14:14 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
I looked into the emf newsgroup and found the solution:
news://news.eclipse.org:119/dv3qpc$9u6$4@utils.eclipse.org
Regards,
Antoine
Sebastien BALARD wrote:
> Hi,
> I have this now, and same effect (Feature 'version' not found)
>
> // create a ResourceSet.
> this.resourceSet = new ResourceSetImpl();
> // initialize ResourceSet
> final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
> resourceSet.getPackageRegistry());
>
> resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
> extendedMetaData);
> resourceSet.getPackageRegistry().put(BpmnPackage.eNS_URI,
> BpmnPackage.eINSTANCE);
> resourceSet.getPackageRegistry().put(EcorePackage.eNS_URI,Ec orePackage.eINSTANCE);
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
> .put("bpmn", new BpmnResourceFactoryImpl());
>
> Thanks,
> Sebastien
>
--
Intalio, the Open Source BPMS Company
<a href="http://www.intalio.com">http://www.intalio.com</a>
<a href="http://bpms.intalio.com">Community website</a>
|
|
| | |
Re: BPMN parsing problem : feature not found [message #607595 is a reply to message #374403] |
Thu, 20 December 2007 09:54 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
Hi,
you'll need to register the Ecore factory as well. It will handle the
xmi attributes it added for EModelElements.
Regards,
Antoine
Sebastien BALARD wrote:
> Hi,
> I've generated BPMN java classes architecture from bpmn.xsd using EMF
> genmodel tools. I want to access to BPMN data throught these classes.
> I've created a short main method :
>
> public static void main(String[] args) {
>
> // Create a resource set.
> ResourceSet resourceSet = new ResourceSetImpl();
>
> final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
> resourceSet.getPackageRegistry());
>
> resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
> extendedMetaData);
> resourceSet.getPackageRegistry().put("bpmn", BpmnPackage.eINSTANCE);
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
> .put("bpmn", new BpmnResourceFactoryImpl());
>
> // Get the URI of the model file.
> URI fileURI = URI.createFileURI(new File("resources/modeler.bpmn")
> .getAbsolutePath());
> Resource resource = resourceSet.getResource(fileURI, true);
>
> BpmnDiagramImpl root = (BpmnDiagramImpl) resource.getContents().get(0);
>
> System.out.println("loading ok");
> }
>
> Here, first lines of modeler.bpmn :
>
> <?xml version="1.0" encoding="UTF-8"?>
> <bpmn:BpmnDiagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:bpmn="http://stp.eclipse.org/bpmn"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmi:id="_l1KbkZgZEdyr1JEvf_kQJA" iD="_l1KbkJgZEdyr1JEvf_kQJA">
> <pools xmi:type="bpmn:Pool" xmi:id="_l1zUwZgZEdyr1JEvf_kQJA"
> iD="_l1zUwJgZEdyr1JEvf_kQJA" name="Processus">
> ...
> </pools>
> </bpmn:BpmnDiagram>
>
> I have a problem with xmi:XXX attribute type. Indeed, for
> BpmnResourceFactory, feature version is not defined in bpmn.xsd, it's a
> xmi attribute (defined in xmi.xsd).
> My question : Is it possible to specify to ignore this attribute type
> (with xmi prefix) in BpmnResourceFactory or can I delegate xmi
> attributes treatment to another ResourceFactory ?
>
> Regards,
> Sebastien
>
--
Intalio, the Open Source BPMS Company
<a href="http://www.intalio.com">http://www.intalio.com</a>
<a href="http://bpms.intalio.com">Community website</a>
|
|
|
Re: BPMN parsing problem : feature not found [message #607596 is a reply to message #374404] |
Thu, 20 December 2007 13:20 |
Eclipse User |
|
|
|
Originally posted by: s.balard.prometil.com
Hi,
I always have the same error (Feature 'version' not found) with this code
(corrected using your suggestion) :
// create a ResourceSet.
this.resourceSet = new ResourceSetImpl();
// initialize ResourceSet
final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
resourceSet.getPackageRegistry());
resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
extendedMetaData);
resourceSet.getPackageRegistry().put("bpmn", BpmnPackage.eINSTANCE);
resourceSet.getPackageRegistry().put("xmi", EcorePackage.eINSTANCE);
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put("bpmn", new BpmnResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put("xmi", new EcoreFactoryImpl());
Did i make a mistale in my Ecore factory registration ?
Regards,
Sebastien
|
|
|
Re: BPMN parsing problem : feature not found [message #607597 is a reply to message #374405] |
Thu, 20 December 2007 13:32 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
Hi Sebastien,please see comments inline:
Sebastien BALARD wrote:
> Hi,
> I always have the same error (Feature 'version' not found) with this
> code (corrected using your suggestion) :
>
> // create a ResourceSet.
> this.resourceSet = new ResourceSetImpl();
> // initialize ResourceSet
> final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
> resourceSet.getPackageRegistry());
>
> resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
> extendedMetaData);
> resourceSet.getPackageRegistry().put("bpmn", BpmnPackage.eINSTANCE);
> resourceSet.getPackageRegistry().put("xmi", EcorePackage.eINSTANCE);
I think you should put the namespace here, not the file extension.
Look at the EPackage$Registry javadoc:
A map from {@link EPackage#getNsURI() namespace URI} to {@link EPackage}.
so it should be:
resourceSet.getPackageRegistry().put(BpmnPackage.getNsURI(),
BpmnPackage.eINSTANCE);
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
> .put("bpmn", new BpmnResourceFactoryImpl());
This is necessary.
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
> .put("xmi", new EcoreFactoryImpl());
this is of no use.
>
> Did i make a mistale in my Ecore factory registration ?
>
> Regards,
> Sebastien
>
HTH
Antoine
--
Intalio, the Open Source BPMS Company
<a href="http://www.intalio.com">http://www.intalio.com</a>
<a href="http://bpms.intalio.com">Community website</a>
|
|
|
Re: BPMN parsing problem : feature not found [message #607598 is a reply to message #374406] |
Thu, 20 December 2007 14:08 |
Eclipse User |
|
|
|
Originally posted by: s.balard.prometil.com
Hi,
I have this now, and same effect (Feature 'version' not found)
// create a ResourceSet.
this.resourceSet = new ResourceSetImpl();
// initialize ResourceSet
final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
resourceSet.getPackageRegistry());
resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
extendedMetaData);
resourceSet.getPackageRegistry().put(BpmnPackage.eNS_URI,
BpmnPackage.eINSTANCE);
resourceSet.getPackageRegistry().put(EcorePackage.eNS_URI,Ec orePackage.eINSTANCE);
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
.put("bpmn", new BpmnResourceFactoryImpl());
Thanks,
Sebastien
|
|
|
Re: BPMN parsing problem : feature not found [message #607599 is a reply to message #374407] |
Thu, 20 December 2007 14:14 |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
I looked into the emf newsgroup and found the solution:
news://news.eclipse.org:119/dv3qpc$9u6$4@utils.eclipse.org
Regards,
Antoine
Sebastien BALARD wrote:
> Hi,
> I have this now, and same effect (Feature 'version' not found)
>
> // create a ResourceSet.
> this.resourceSet = new ResourceSetImpl();
> // initialize ResourceSet
> final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(
> resourceSet.getPackageRegistry());
>
> resourceSet.getLoadOptions().put(XMLResource.OPTION_EXTENDED _META_DATA,
> extendedMetaData);
> resourceSet.getPackageRegistry().put(BpmnPackage.eNS_URI,
> BpmnPackage.eINSTANCE);
> resourceSet.getPackageRegistry().put(EcorePackage.eNS_URI,Ec orePackage.eINSTANCE);
>
> resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap()
> .put("bpmn", new BpmnResourceFactoryImpl());
>
> Thanks,
> Sebastien
>
--
Intalio, the Open Source BPMS Company
<a href="http://www.intalio.com">http://www.intalio.com</a>
<a href="http://bpms.intalio.com">Community website</a>
|
|
| | |
Goto Forum:
Current Time: Mon Sep 23 07:10:28 GMT 2024
Powered by FUDForum. Page generated in 0.04256 seconds
|