September 17, 2008

(English) Generate HTML report of a model transformation tracing model

A short while ago I created a blog entry to get oaw's tracing extension to work. After achieving this I tried to generate a HTML report of my tracing model. Fortunately there is already a Xpand template that does this stuff. But it takes a while for me to get it running, so that I will show you the workflow. It expects to have the org.openarchitectureware.util.stdlib project checked out from the CVS in your workspace, as explained earlier.
<workflow>
<property file="workflow.properties"/>
<component class='oaw.workflow.common.DirectoryCleaner' directories='${targetDir}/tracedoc'/>

<bean >
<platformUri value=".."/>
<registerEcoreFile value="../org.openarchitectureware.util.stdlib/
src/org/openarchitectureware/util/stdlib/trace.ecore" />
<!-- register metamodels referenced by the tracing model -->
<registerGeneratedEPackage value="my.DataPackage" />
</bean>

<component>
<modelFile value="gen/tracing.trace"/>
<outputSlot value="tracemodel"/>
</component>

<component>
<!-- important to get it working -->
<metaModel />
<fileEncoding value="ISO-8859-1"/>
<expand value="org::openarchitectureware::util::stdlib::
tracing::templates::html::root FOR tracemodel"/>
<outlet>
<path value="gen/tracedoc"/>
</outlet>
</component>
</workflow>

Sample oaw Tracing Report
Sample oaw Tracing Report

September 16, 2008

(English) Getting oaw TraceComponent working

For openarchitectureware 4.3 there is a tracing extension available. It allows to create a tracing model of your model2model or model2text transformations. For example you can process this tracing model to generate a HTML, XML, ... documentation of your model transformations.

Unfortunately the extension does not work out of the box for me. I'm using openarchitectureware 4.3.1 from the oaw-development pluginbuilder on a mac. Exactly I use 4.3.1.20080910-1400PRD. After a little time of debugging I found a solution to get it working:

  • check out project org.openarchitectureware.util.stdlib from the oaw CVS

  • switch that projet to branch B_v43 (Team - Switch to Another Branch or Version...)

  • hint: the project must be placed in the workspace where the oaw project is located that will use tracing, because a reference to the trace metamodel (trace.ecore) in the plugin is incorrect (it points to ${workspace}/org.openarchitectureware.util.stdlib/src/org/openarchitectureware/util/stdlib/trace.ecore)


workflow:
<workflow>
<bean class="org.eclipse.mwe.emf.StandaloneSetup" >
<-- important to get the correct workspace path -->
<platformUri value=".."/>
</bean>

<-- XtendComponent and/or Generator -->

<component class="org.openarchitectureware.util.stdlib.TraceComponent">
<traceModelSlot value="tracemodel" />
<traceName value="trace" />
</component>

<component id="traceWriter" class="org.openarchitectureware.emf.XmiWriter">
<inputSlot value="tracemodel"/>
<modelFile value="gen/tracing.trace"/>
</component>
</workflow>

An short example of tracing model2model transformation shows the following snippet:
extension org::openarchitectureware::util::stdlib::tracing;

create Class Class2Table(Class c) :
createTrace(c,this,"m2m") ->
setName(c.name);