The UML2 adapter for oAW is available since version 4.1. It is based upon the UML2 2.0 framework of Eclipse and provides a type mapping from the UML 2.1 metamodel implementation to the oAW type system. Hence one can access the whole UML2 metamodel from Check, Xtend, and Xpand. Additionally, and more important, the adapter dynamically maps stereotypes applied to model elements to oAW types and tagged values to oAW properties. You do not have to implement additional Java classes anymore. Just export your models and applied profiles. That's all!
First you need to install the UML2 feature from eclipse.org:
http://download.eclipse.org/tools/uml2/updates/site-interim.xml
The oAW uml2adapter is available from the oAW update site:
http://www.openarchitectureware.org/updatesite/milestone/site.xml
(Go to the home page of the project and find the current location if either of the sites do not work)
Restart your Eclipse workbench when Eclipse asks you to do so.
You need to configure your project (or the whole workspace) to use the UML2Adapter.
Right-click on the project and choose 'properties' from the pop-up menu. Therein open the 'openArchitectureWare' tab, activate the checkboxes (nature and specific metamodel contributors) and add the UMLProfiles metamodel contributor.
At runtime, you just need the
org.openarchitectureware.uml2.adapter-4.1.0.jar
(or
later). You can use the dependency mechanism of Eclipse from the PDE, or
copy or reference the respective JAR file directly. It does not matter,
you just have to take care that it is on the classpath.
If you have written some Check, Xtend or Xpand files and now want to execute them, you have to provide the right configuration.
You need to configure the UML2 metamodel and a profile metamodel for each profile you used directly. A typical configuration looks like this:
<workflow> <bean class="oaw.uml2.Setup" standardUML2Setup="true"/> <component class="oaw.emf.XmiReader"> ... </component> <component class="oaw.xpand2.Generator"> <metaModel class="oaw.uml2.UML2MetaModel"/> <metaModel class="oaw.uml2.profile.ProfileMetaModel"> <profile value="myProfile.profile.uml2"/> </metaModel> ... </component> <workflow>
Note the bean configuration in the second line. It statically configures the XmiReader to use the right factories for *.uml and *.uml2 files. This is very important.
If you are invoking several oAW components, you should use the
id
/ idRef
mechanism:
<workflow> <bean class="oaw.uml2.Setup" standardUML2Setup="true"/> <component class="oaw.emf.XmiReader"> ... </component> <component class="oaw.xpand2.Generator"> <metaModel id="uml" class="oaw.uml2.UML2MetaModel"/> <metaModel id="profile" class="oaw.uml2.profile.ProfileMetaModel"> <profile value="myProfile.profile.uml"/> </metaModel> ... </component> <component class="oaw.xpand2.Generator"> <metaModel idRef="uml"/> <metaModel idRef="profile"/> ... </component>