Writing Transformations - Intermediary Language
All transformations in EA work by generating a text form of the model that you wish to generate.
Any element is represented in this language by the type of element (eg. Class, Action, Method, Generalization or Tag) followed by the properties of the element and the elements that it is made from. The grammar for this looks like the following.
<element> ::= <elementName> "{" (<elementProperty> | <element>)* "}";
<elementProperty> ::= <propertyName> "=" "\"" <*stringEscape> "\"";
- <elementName> is any one of the set of element types that EA supports.
- <propertyName> is any one of the set properties that elements can have in EA.
A simple class can be created as follows.
It is then easy to add to this. The following example sets the language to C++, adds a tagged value and an attribute.
|
name = "defaultCollectionClass"
|
Elements may also contain an XRef. This acts as a unique reference that is used for synchronisation and for creating connectors. Each XRef should contain:
- A Namespace. This is what transformation the class was generated from.
- A Name. This is a unique name within the transformation specified by the namespace.
- A Source. This is the GUID of the original element that this element was created from.
A file may contain packages and any elements that a package can contain. Packages man contain the following element types:
- Action
- ActionPin
- Activity
- ActivityParameter
- ActivityPartition
- ActivityRegion
- Actor
- Association
- Change
- Class
- Collaboration
- CollaborationOccurence
- Component
- DeploymentSpecification
- DiagramFrame
- Decision
- EntryPoint
- Event
- ExitPoint
- ExceptionHandler
- ExpansionNode
- ExpansionRegion
- ExposedInterface
- GUIElement
- InteractionFragment
- InteractionOccurence
- InteractionState
- Interface
- InterruptibleActivityRegion
- Issue
- Iteration
- Object
- ObjectNode
- MessageEndpoint
- Node
- Parameter
- Part
- Port
- ProvidedInterface
- RequiredInterface
- Requirement
- Sequence
- State
- StateNode
- Synchronization
- TimeLine
- UMLDiagram
- UseCase