Skip to content
Donatas Čiukšys edited this page Jan 21, 2018 · 8 revisions

Transform XSD to eCore and GenModel

  1. In Eclipse: File -> New -> Project...
  2. Select Eclipse Modeling Framework -> EMF Project
  3. Specify project name
  4. In window "Select a Model Importer" choose "XML Schema"

BPMN example

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»
        ”’)
    }
}
Clone this wiki locally