-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Donatas Čiukšys edited this page Jan 31, 2018
·
8 revisions
- In Eclipse: File -> New -> Project...
- Select Eclipse Modeling Framework -> EMF Project
- Specify project name
- In window "Select a Model Importer" choose "XML Schema"
- Open
.ecore
file and edit attributensURI
of the root element to contain relative path to the XSD file. - Open
.genmodel
file and:- edit root element attribute
modelDirectory
. It should contain something like{projectRootDir}/emf-gen
- edit child element
<foreignModel>
. It should contain relative path to the XSD file.
- edit root element attribute
class Main {
def static void main(String[] args) {
val f = new Bpmn2ResourceFactoryImpl
//val f = new Bpmn2XMIResourceFactoryImpl
val p = Bpmn2Package.eINSTANCE
Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put(“bpmn”, f)
val rs = new ResourceSetImpl
val r = rs.getResource(URI.createURI(“SampleProcess.bpmn”),true)
r.load(null)
println(”’
«FOR c : r.contents»
«IF c instanceof DocumentRoot»
«IF c.definitions != null»
«c.definitions.rootElements»
«ENDIF»
«ENDIF»
«ENDFOR»
”’)
}
}