@Test public void testDataStoreUnmarshalling() throws Exception { Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller(); Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("dataStore.json"), "").getContents().get(0)); assertTrue(definitions.getRootElements().size() == 1); assertTrue(definitions.getRootElements().iterator().next() instanceof DataStore); DataStore da = (DataStore) definitions.getRootElements().iterator().next(); assertEquals("data store", da.getName()); definitions.eResource().save(System.out, Collections.emptyMap()); }
@Override protected DataStoreReference createFlowElement(ICreateContext context) { DataStoreReference dataStoreReference = null; try { dataStoreReference = ModelHandler.FACTORY.createDataStoreReference(); dataStoreReference.setName("Data Store Ref"); DataStore dataStore = ModelHandler.FACTORY.createDataStore(); dataStore.setName("Data Store"); dataStore.setId(EcoreUtil.generateUUID()); ModelHandler.getInstance(getDiagram()).addRootElement(dataStore); } catch (IOException e) { Activator.showErrorWithLogging(e); } return dataStoreReference; }