Question

I would like to be able to programmatically retrieve the same URI that is available through BIRT (getURI). I am developing an Rational Software Modeler plug-let and need to get the unique identifier for the diagram elements. This would enable the elements to be recognized in later database ETL processes.

I have found a URI available through EObject.eResource().getURI(), except it only returns half of what is returned in the BIRT reports. BIRT reports something like "platform:/resource/Common/S.efx#_c0KLYFImEd-iIqDctBy_JQ" while EObject.eResource().getURI() only returns "platform:/resource/Common/S.efx"

Any help would be appreciated.

Was it helpful?

Solution

You should be able to get the whole URI with ECoreUtil.getURI(EObject) function, it should also include the fragment part.

EObject.eResource().getURI() returns you the resource's URI where this object is located, so it will not include the Objects own unique ID there.

That fragment ending hash there is EObjects XMI-ID, that can be returned using ECoreUtil.getID(EObject) if needed. But that ECoreUtil.getURI(EObject) should be just ok.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top