Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #374409 is a reply to message #374408] Thu, 20 December 2007 15:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: s.balard.prometil.com

Hi,
thanks a lot but i can open this news :(
I think address end is masked.
Can you give me news title please ?
Regards,
Sebastien
Re: BPMN parsing problem : feature not found [message #374410 is a reply to message #374409] Thu, 20 December 2007 15:24 Go to previous message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

The title is "Feature 'version' not found"

Hope you learn to fish!

Antoine

Sebastien BALARD wrote:
> Hi,
> thanks a lot but i can open this news :(
> I think address end is masked.
> Can you give me news title please ?
> 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 #607595 is a reply to message #374403] Thu, 20 December 2007 09:54 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 #607600 is a reply to message #374408] Thu, 20 December 2007 15:18 Go to previous message
Eclipse UserFriend
Originally posted by: s.balard.prometil.com

Hi,
thanks a lot but i can open this news :(
I think address end is masked.
Can you give me news title please ?
Regards,
Sebastien
Re: BPMN parsing problem : feature not found [message #607601 is a reply to message #374409] Thu, 20 December 2007 15:24 Go to previous message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

The title is "Feature 'version' not found"

Hope you learn to fish!

Antoine

Sebastien BALARD wrote:
> Hi,
> thanks a lot but i can open this news :(
> I think address end is masked.
> Can you give me news title please ?
> 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>
Previous Topic:BPMN parsing problem : feature not found
Next Topic:Problem with SequenceEdge display
Goto Forum:
  


Current Time: Fri Apr 19 13:51:09 GMT 2024

Powered by FUDForum. Page generated in 0.02785 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top