Skip to content

Alf support

Zoltán Ujhelyi edited this page Apr 16, 2015 · 6 revisions

All description here relies on the Alf integration from Papyrus 1.1.0 M6+

Dependencies and initialization

In the background, OCL and QVT are used for validation and AlfMapper (basically resolution)

##Dependencies

  • org.eclipse.papyrus.uml.alf;bundle-version="1.1.0",
  • com.google.inject, -- for Xtext API
  • org.eclipse.emf.ecore,
  • org.eclipse.ocl.pivot;bundle-version="1.0.0",
  • org.eclipse.ocl.uml;bundle-version="5.0.100",
  • org.eclipse.uml2.uml.resources;bundle-version="5.1.0",
  • org.eclipse.uml2;bundle-version="5.0.0",
  • org.eclipse.ocl.xtext.essentialocl;bundle-version="1.0.0",
  • org.eclipse.ocl.pivot.uml;bundle-version="1.0.0", -- required for AlfMapper_ (if missing runtime exceptions are thrown)
  • org.eclipse.papyrus.uml.alf.to.fuml;bundle-version="1.1.0" -- required for AlfMapper (if missing runtime exceptions are thrown)

##Initial registrations In Eclipse environment, everything should be registered if org.eclipse.papyrus.uml.alf.ui project is loaded. Otherwise, the following registrations are required:

//Once in the application
injector = new AlfStandaloneSetup().createInjectorAndDoEMFRegistration()
EssentialOCLStandaloneSetup.doSetup
OCLstdlib.install()
//Once per resourceset
OCL.initialize(resourceSet)
OCLDelegateDomain.initialize(resourceSet)

Parsing standalone Alf files

var Resource resource = this.resourceSet.createResource(URI.createURI("temp.alf"))
resource.load(new StringInputStream(input), #{})
//Running resolution
val AlfMapper mapper = new AlfMapper()
mapper.map(resource.contents)

Parsing in-UML Alf files

To be researched

Clone this wiki locally