Archive

Posts Tagged ‘Enterprise Architect’

Converting Enterprise Architect Model to EMF UML2 model

February 11, 2010 23 comments

Recently, I had a task of a converting a UML model in Enterprise Architect to a EMF UML2 model. Googling with the keywords took me straightaway to Ueli Brawand and his tool EA_UML2Exporter. It is a wonderful little tool that works with openArchitectureWare and gets the task done in no time. However, setting it up does consume some time. I thought of summarizing the steps I did, incase it helps others.

1. Downloading Enterprise Architect

  • If you don’t have Enterprise Architect, download a 30-day trial from here: http://www.sparxsystems.com/products/ea/trial.html.
    Please note that Enterprise Architect runs only on Microsoft Windows. If you are using other environments, please use a virtual Windows environment to install Enterprise Architect.

2. Downloading openArchitectureWare

3. Downloading EA_UML2Exporter

4. Setting up a new openArchitectureWare Project

  • Start the downloaded Eclipse distribution with oAW and create a new openArchitectureWare Project.
  • The EA_UML2Exporter libraries needs to be added to the project. Select Project Properties from context menu and add the EA_UML2Exporter JARs using Java Build Path -> Libraries ->  Add External JARs….
    Adding external Jars
  • The EA Java API library now needs to be added to the project in the same way. Browse to the Java API folder within Enterprise Architect Installation folder and add eaapi.jar to the project in the same way as above.
  • SSJavaCOM.dll within the Enterprise Architect Java API folder needs to be in the system path. Easiest would be to add this to the root of the newly created project.
  • Open MANIFEST.MF and add the following plugin dependencies:

org.eclipse.uml2

org.eclipse.uml2.uml

org.eclipse.uml2.uml.ecore.exporter

org.eclipse.uml2.uml.ecore.importer

org.eclipse.uml2.uml.resources

org.openarchitectureware.uml2.adapter

Plug-in Dependencies

  • Copy the to be converted Enterprise Architect EAP file to the src folder.
  • Create an empty file called model.uml within the src folder.
    This would be your converted UML2 model after the workflow is run.
  • Within this src folder create a workflow file (workflow.oaw) with the following content:

<?xml version=”1.0″ encoding=”UTF-8″?>

<workflow>

<property file=“workflow.properties”/>

<bean class=“oaw.uml2.Setup” standardUML2Setup=“true” />

<!– Metamodel-Definition –>

<bean id=“EmfMM” class=“oaw.type.emf.EmfMetaModel”>

<metaModelPackage value=“org.eclipse.emf.ecore.EcorePackage”/>

</bean>

<bean id=“UmlMM” class=“oaw.uml2.UML2MetaModel”/>

<component class=“oaw.uml2.toolsupport.ea.EA_Xmi2Exporter” >

<EapFile value=“${project_root}${ea_file}” />

<ModelFile value=“${model_file}” />

<PackageName value=“${model_pkg}” />

<Cleanup value=“true”/>

</component>

</workflow>

  • Within this src folder create a workflow properties file (workflow.properties) with the following content:

project_root =

# EA filename

ea_file =

#Output UML2 filename

model_file =

#Package within EA Model

model_pkg =

  • Fill in the missing values in the properties file.
    project_root: You could leave this empty
    ea_file: EAP file to be converted
    model_file: UML2 model to be created
    model_pkg: Package within EAP file to be converted (this could be the root package, if you want the whole file to be converted) 

    The properties file might look, for example, as below:

project_root =

# EA filename

ea_file = src/2006-10-04 RiF-Meta-Modell_v1.1_PUBLIC.EAP

#Output UML2 filename

model_file = src/model.uml

#Package within EA Model

model_pkg = RIF/ExchangeFile

  • If the project is setup correctly, it would look like this:
    oAW Project

5. Running the openArchitectureWare workflow

  • Run the workflow by selecting the workflow file (workflow.oaw) and choosing Run As -> oAW Worlflow from context menu.
  • Enterprise Architect would now be started in the background.
  • If the conversion is successful you would get a console output similiar to below:

0    INFO  WorkflowRunner     – ————————————————————————————–

0    INFO  WorkflowRunner     – openArchitectureWare 4.3.1, Build 20090107-2000PRD

0    INFO  WorkflowRunner     – (c) 2005-2008 openarchitectureware.org and contributors

0    INFO  WorkflowRunner     – ————————————————————————————–

0    INFO  WorkflowRunner     – running workflow: workflow.oaw

0    INFO  WorkflowRunner     –

1281 INFO  CompositeComponent – EA_Xmi2Exporter

1281 INFO  EA_Xmi2ExportBase  – UML2Exporter for EA (1.7.0-SNAPSHOT)

1281 INFO  EA_Xmi2ExportBase  –   EAP-File   : src\2006-10-04 RiF-Meta-Modell_v1.1_PUBLIC.EAP

1281 INFO  EA_Xmi2ExportBase  –   Package    : RIF/ExchangeFile

1281 INFO  EA_Xmi2ExportBase  –   OutputFile : src\model.uml

70266 INFO  EA_Xmi2ExportBase  – Start XML2.0-output …

86891 INFO  EA_Xmi2ExportBase  – XML2.0-Export done.

86891 INFO  WorkflowRunner     – workflow completed in 85610ms!

  • model.uml file would now be the converted UML2 file.
Advertisements