Enterprise Architect

From Informatics

Jump to: navigation, search

See also: caGrid Datatypes

These are general notes as well as "problem areas" I encountered when working with Enterprise Architect and the workaround. This is by no means meant to be a comprehensive guide on using Enterprise Architect. Please refer to the Enterprise Architect help for further information, and/or the project C:\java\apps\geWorkbench_caGrid_enablement.EAP (caldev) for a practical example.



  • Use Enterprise Architect on caldev. We have a license for it.
  • Store your .eap projects under C:\java\apps\ea_workspace so others can access it.
  • If you want to hack around, use the Dummy.eap project in C:\java/apps\ea_workspace.

Sequence Diagrams

  • Create a project.
  • In the Project Browser view (to enable this, use View->Project Browser), right click on the Use Case Model->Add Diagram->UML Behavioural.
  • Select Sequence.
  • Right click on the dashboard and Create Element or Connector->Interaction Elements->Actor.

Object Models

  • Create a project.
  • Open the Project Browser view (to enable this, use View->Project Browser).
  • Add the packages from Java you will be using. For example, if you want to use a java.lang.String, you would create the package java/lang/, create a diagram named lang, and add a Class String to this. This String class can be empty, but it must exist.
  • In the Logical View->Logical Model create your package structure. For example, edu/columbia/geworkbench/cagrid/anova.
  • Right click on the Logical View->Logical Model->Add Diagram.
  • Select Class.
    • Right click on the dashboard and Create Element or Connector->Class Elements->Class.

caBIG Projects

  • If you are modelling for caGrid projects, do not add text to the "Notes" section of a class. This has to do with a parsing issue in the Semantic Integration Workbench. It is probably easier if just don't add text to the Notes section in any case.
  • Add description and documentation tags to all classes, and description tags to all attributes.
  • If you are modelling for caGrid projects, you'll also need to model an execute() interface for it (under "Logical View"-"Service Model"). They only want to see how many parameters needed for this method. You don't really need to make associations for the interface, since they will not use that model to generate codes.

Import Existing XMI Files

  • To import an existing XMI file into your EAP model, make sure the model of interest was exported with the options
    • Export Diagrams
    • Format XMI Output

(you probably don't have to format the XMI, but I haven't tried this out).

  • When you input the XMI (into your existing model), make sure you
    • Import Diagrams
    • Strip GUIDs

Constructor with Attributes

  • Add an operation to the class. That is, right click on the class and select Features->Operations.
  • Remove the return type of the operation.

String Attributes

  • Right click on the class and select Features->Attributes.
  • You'll notice under Type, String does not exist. Just type in String and it will get interpreted correctly when generating both java and xml.

Object Attributes

  • I can't seem to find the correct type in EA (and typing Object doesn't seem to work) but using xs:anyType seems to generate java.lang.Object. The following is an example of a valid schema that generates java.lang.Object elements.


<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified" attributeFormDefault="unqualified">
           <xs:element name="GridInput" type="tns:GridInput" />
           <xs:complexType name="GridInput">
                                   <xs:element name="inputKeys" type="xs:anyType" minOccurs="0"
                                               maxOccurs="unbounded" />


 * GridInput.java
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.2RC2 Apr 28, 2006 (12:42:00 EDT) WSDL2Java emitter.
public class GridInput  implements java.io.Serializable {
   private java.lang.Object[] inputKeys;
   public GridInput() {
   public GridInput(
          java.lang.Object[] inputKeys) {
          this.inputKeys = inputKeys;
    * Gets the inputKeys value for this GridInput.
    * @return inputKeys
   public java.lang.Object[] getInputKeys() {
       return inputKeys;
    * Sets the inputKeys value for this GridInput.
    * @param inputKeys
   public void setInputKeys(java.lang.Object[] inputKeys) {
       this.inputKeys = inputKeys;
   public java.lang.Object getInputKeys(int i) {
       return this.inputKeys[i];
   public void setInputKeys(int i, java.lang.Object _value) {
       this.inputKeys[i] = _value;
   private java.lang.Object __equalsCalc = null;
   public synchronized boolean equals(java.lang.Object obj) {
       if (!(obj instanceof GridInput)) return false;
       GridInput other = (GridInput) obj;
       if (obj == null) return false;
       if (this == obj) return true;
       if (__equalsCalc != null) {
           return (__equalsCalc == obj);
       __equalsCalc = obj;
       boolean _equals;
       _equals = true && 
           ((this.inputKeys==null && other.getInputKeys()==null) || 
            (this.inputKeys!=null &&
             java.util.Arrays.equals(this.inputKeys, other.getInputKeys())));
       __equalsCalc = null;
       return _equals;
   private boolean __hashCodeCalc = false;
   public synchronized int hashCode() {
       if (__hashCodeCalc) {
           return 0;
       __hashCodeCalc = true;
       int _hashCode = 1;
       if (getInputKeys() != null) {
           for (int i=0;
                i++) {
               java.lang.Object obj = java.lang.reflect.Array.get(getInputKeys(), i);
               if (obj != null &&
                   !obj.getClass().isArray()) {
                   _hashCode += obj.hashCode();
       __hashCodeCalc = false;
       return _hashCode;
   // Type metadata
   private static org.apache.axis.description.TypeDesc typeDesc =
       new org.apache.axis.description.TypeDesc(GridInput.class, true);
   static {
       typeDesc.setXmlType(new javax.xml.namespace.QName("gme://cagrid.c2b2.columbia.edu/1/edu.columbia.c2b2.cagrid", "GridInput"));
       org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
       elemField.setXmlName(new javax.xml.namespace.QName("gme://cagrid.c2b2.columbia.edu/1/edu.columbia.c2b2.cagrid", "inputKeys"));
       elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "anyType"));
    * Return type metadata object
   public static org.apache.axis.description.TypeDesc getTypeDesc() {
       return typeDesc;
    * Get Custom Serializer
   public static org.apache.axis.encoding.Serializer getSerializer(
          java.lang.String mechType, 
          java.lang.Class _javaType,  
          javax.xml.namespace.QName _xmlType) {
         new  org.apache.axis.encoding.ser.BeanSerializer(
           _javaType, _xmlType, typeDesc);
    * Get Custom Deserializer
   public static org.apache.axis.encoding.Deserializer getDeserializer(
          java.lang.String mechType, 
          java.lang.Class _javaType,  
          javax.xml.namespace.QName _xmlType) {
         new  org.apache.axis.encoding.ser.BeanDeserializer(
           _javaType, _xmlType, typeDesc);


  • Many UML modelling tools tend to refer to the start of an association as the target, and the end the source (yes, this is confusing). By default, Enterprise Architect is no different but you can switch the direction to Source->Destination.
  • Double click on the association and under the General tab, set the direction to Source->Destination. To do this, click on the association and set the Direction in the General tab.
  • Under the Target Role tab, set the role to be the attribute you would like to see appear in your Java class. Set the multiplicity. Also, set the name on the target of the association. For instance, if you have an association between Foo and Bar and would like Foo to contain the attribute barType (of type Bar), you would set the association name on the target end to barType.
  • Under the Source Role tab, set the multiplicity of the owner of the association. Also set the Aggregation.

delete associations

Say if you want to delete the association, but you select the model you don't want and hit delete, you won't see the association anymore. BUT, when you generate xsd file, you saw the association and referenced type are still in xsd file. That probably not what you want.

To fix it:

  1. right click the class which contains unwanted association in project browser in EA, select properties.
  2. select the Links tab
  3. right click on the relationship you don't want, select delete.


An array in the .xsd file corresponds to:

<xs:element ref="HierarchicalClusterNode" minOccurs="0" maxOccurs="unbounded"/>

You may need to generate an array either from an attribute or an association. This is discussed below.

Arrays from Attributes

To generate an xsd file with the above entry, select the attribute and under the Detail tab, set the lower bound multiplicity to 0, and the higher bound to unbounded (you can just type it in).

Arrays from Associations

To generate an xsd file with the above entry, make sure you set the association end to 0..* (0-to-many).


  • Use the enumeration stereotype.
  • If the enumerated type is a String, when you generated an xsd from the model you'll notice that xs:String appears in the xsd. This needs to be changed to xs:string (lowercase). An example of what this should look like is:
<xs:element name="HierarchicalClusteringParameter" type="HierarchicalClusteringParameter"/>
 <xs:complexType name="HierarchicalClusteringParameter">
   <xs:documentation>Tuning Parameters for the Hierarchical Clustering algorithm.</xs:documentation>
   <xs:element name="dim" type="dim"/>
   <xs:element name="distance" type="distance"/>
   <xs:element name="method" type="method"/>
<xs:simpleType name="method">
  <xs:restriction base="xs:string">
   <xs:enumeration value="single"/>
   <xs:enumeration value="average"/>
   <xs:enumeration value="complete"/>
<xs:simpleType name="dim">
 <xs:restriction base="xs:string">
 <xs:enumeration value="marker">
   <xs:documentation>Cluster by marker.</xs:documentation>
 <xs:enumeration value="microarray">
   <xs:documentation>Cluster by microarray.</xs:documentation>
 <xs:enumeration value="both">
   <xs:documentation>Cluster by both marker and microarray.</xs:documentation>
<xs:simpleType name="distance">
 <xs:restriction base="xs:string">
  <xs:enumeration value="euclidean"/>
  <xs:enumeration value="spearman"/>
  <xs:enumeration value="pearson"/>
  • You must add the following seven tags to enum data type classes to avoid errors in SIW (see tags for ANOVA in SIW as an example):
  1. CADSR_ValueDomainDefinition
  2. CADSR_ValueDomainDatatype
  3. CADSR_ValueDomainType
  4. CADSR_ConceptualDomainPublicID
  5. CADSR_ConceptualDomainVersion
  6. CADSR_RepresentationPublicID
  7. CADSR_RepresentationVersion
  • You must add the following four tags to enum data type classes to avoid warnnings in SIW: (Values can be obtained using NCI Terminology Browser)
  1. ValueMeaningConceptCode
  2. ValueMeaningConceptDefinition
  3. ValueMeaningConceptDefinitionSource
  4. ValueMeaningConceptName

For more detail information about tags mentioned above, please check Page 134 in caCORE SDK 3.2.1 Programmer's Guide

Eclipse plugin

The Eclipse plug-in may help in visualizing the architecture of existing projects developed in the eclipse IDE. That gives you the option to load an entire project’s structure directly from eclipse, even remotely.



Mapping between other java types and XML

Xsd Generation

See here for Xsd Generation

XMI Generation

  • Export your .xmi from the Logical Model (in Logical View) and make sure you have the following settings:
  • Checked:
  1. Enable full EA Roundtrip
  2. Format XMI Output
  3. Write Log file.
  • Unchecked:
  1. Use DTD
  2. Generate Diagram Images
Personal tools