Converting Enterprise Architect Model to EMF UML2 model

Tags: , , , EMF, UML 1 Kommentar »

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.

Mission Accomplished

Eclipse, OSEE Kein Kommentar »

My talk on OSEE at Eclipse Summit 2009 was a success for me personally. The topic was of course not sexy as the modeling sessions that went on in parallel and through out the day. I hoped, the title “Get Lean with OSEE” would get the attention of some more guys who would think of it as a session on how to burn some fat ;) So it wasn’t really a shock for me when only 11 people turned up (out of which 2 were my colleagues and 2 were my old Bosch colleagues).

Open System Engineering Environment (OSEE) is the only Eclipse based open source tool currently available that could be used in a engineering environment (be it Aeronautics or Automotive) to provide an integrated environment for tools to share a common data model. Purpose of the talk was not really to sell OSEE (which I made it clear during the talk), but to give the results of an evaluation of OSEE we did as part of a research project.

Spending some time on the slides over the weekend wasn’t a bad idea as I could bring some coolness into the talk with this. However, I saw that the people got more interested when I started the demo of the tool (which took three quarters of the time of the total session). There was time for some Q&A in the end where we discussed about the potential of the tool. It was concluded that the tool has great potential, but the inactive newsgroups and disintegrated documentation would drive early adopters away.

The committers need to realize the huge possibilities of “selling” this tool in the Automotive engineering environments (which is much more in Europe than where the makers come from) and work more on “marketing” the tool. Integration of some existing Eclipse technologies as replacement for many self written components could be one way to gain some synergy and get more attention.  Also publishing reliable release plans is very important.

The slides from the presentation can be viewed here: http://www.slideshare.net/nirmalts/get-lean-with-osee

Cheating OSEE to install on Mac OS X

Tags: , , , Eclipse Kein Kommentar »

If you are a Microsoft Windows user and want to install OSEE (Open System Engineering Environment), you are plain lucky. The “platform independent” OSEE at the moment seems highly tuned to run on Windows. Follow the pointers here and you could get OSEE installed on Windows in no time. Coming back to the discriminated Mac OS X users, the hard truth is – the current version of OSEE (0.7.0) will NOT run on a Mac. But you could trick OSEE and make it run on a Mac with the steps below (but some features still does not work).

I wouldn’t advise to do this on a live/production environment. Try to get a Windows box and install OSEE or if you have only a Mac, install OSEE using a virtual machine like VirtualBox.

Why can’t OSEE run on Mac OS X?

One of the major reasons for this is that the current version of OSEE (0.7.0) requires Java 1.6 to run. Though Apple delivered 1.6.0 for Leopard, they delivered only a 64 bit version of it (and has no plans as of now to deliver a 32 bit version). Eclipse (more precisely SWT) cannot make use of 64bit unless you are using Eclipse Galileo Cocoa 64 bit. Unfortunately, OSEE client doesn’t run on Galileo Cocoa 64 bit, due to missing plugin dependencies. This leaves us with no option but use OSEE client with Eclipse Ganymede (3.4.2) as prescribed, by cheating it a bit.

Preparation

You need the following to make OSEE database, server and client run on a Mac.

1. PostgreSQL 8.4.0 (Download)

2. OSEE Application Server 0.7.0 (Download)

3. Eclipse (3.4.2) Ganyemde IDE for Java and Report Developers (Download)

4. OSEE Client 0.7.0 (Download)

5. OSEE Addons 0.7.0 (Download)

The above are the basic items you would need to run OSEE on any platform (unless you decide to use a database other than PostgresSQL). To run OSEE on Mac you additionally need:

6. SoyLatte Java 6 Port 1.0.2 (Download - Use username: “jrl” and password: “I am a Licensee in good standing”. Please note that SoyLatte 1.0.3 would not work)

7. WebKit Build for Safari 3.2.1 (Download – If you have Safari 4.0+ installed, YOU NEED this)

8. A bunch of shell scripts I made to make things easy (Download)

You can download these separately and configure it yourself or download the configured All-in-one bundle I made from here. Download and extract it to any folder, for example, $HOME/OSEE. The PostgresSQL installer is however not included in the bundle. You need to download and install it as per the steps below.

Installing PostGresSql

1. Run the PostgresSQL installer and follow the wizard, leaving the defaults as it is (unless you know what you are doing).
2. In the Password form enter password as “postgres” and confirm it. This is the password to be used for the superuser account (postgres) in the database cluster.

3. In the last step, UNCHECK “Launch Stack Builder at exit?”

Stack Builder Launch

Setting up PostGresSql for OSEE

PostGresSql installation creates a new service user account in your OS (this is different from the “postgres” super account in the database, the password for which you already provided in the wizard during installation). This is a standard OS user who could start/stop/administer the database. You need to set a password for this user to enable you to do database operations in the future.

1. Start Terminal and execute the following

sudo passwd postgres

Enter the new password as “postgres” and confirm.

Don’t be surprised if you see a new user called PostGresSQL the next time you log in to your OS.

2. Launch “pgAdmin III” from Applications.

3. Double Click on PostgreSQL Database Server (listed under Servers on the left hand side). If you are prompted for a password, type the password “postgres” selected during installation (user should be postgres by default)

4. OSEE needs a special database account named “osee”.To create it, right-click on Login Roles (at the bottom of the tree on the left hand side) and select “New Login Role…”. Enter the following in the dialog.

Please forgive me for the German text in screenshots

5. OSEE also needs a special database named “OSEE”. To create it, right-click on Databases and select “New Database…”. Enter the following in the dialog.

6. Click on OSEE and expand it and expand Schemas. Create a ”osee” schema by right-clicking on Schemas and selecting “New Schema…”. Enter the following in the dialog.

Starting PostGresSql

The installer starts up the database after it is finished. Also you could start/stop the database manually as follows:

1. Start Terminal and navigate to the “scripts” folder of the All-in-one bundle.

2. Execute the following:

./pg.sh start

3. Enter the password as “postgres”. This is the password for the service user account PostGresSQL created.

4. You could stop the database later by the following

./pg.sh stop

Initializing PostGresSql for OSEE

Before OSEE can start using the database, you need to initialize it with the initialization steps below:

1. Start Terminal and navigate to the “scripts” folder of the All-in-one bundle.

2. Assuming that the database is already running with the step above, you need to start the application server by executing the following:

./startserver.sh

3. Start database initialization by

./initdb.sh

Starting OSEE client

Now you are ready to startup and use the OSEE client.

1. Start Terminal and navigate to the “scripts” folder of the All-in-one bundle.

2. Execute the following

./osee.sh

What doesn’t work yet

1. The XWidgets included in OSEE doesn’t seem to work properly on Mac. Hence you see an error while opening forms which has these widgets.


Wordpress Themes by Mobile Themes / Jim / Übersetzt ins Deutsche von Pascal Senn
Copyright © 2007 Nirmal’s blog. All rights reserved.