Creating connectors in a transformation can be complex, but the process has the same form as creating elements. The difference is that you must also specify each end.
The different connectors that can be created are as follows.
There are two different types of Class that you can use as a connector end: one created by a transformation, and one for which you already know the GUID.
Connect to a Class Created by a Transformation
The most common connection is to connect to a Class created by a transformation. To do this you must have three items of information:
- The original Class GUID
- The name of the transformation
- The name of the transformed Class.
This type of connector is created using the TRANSFORM_REFERENCE function macro. When the element is in the current transformation, it can be safely omitted from the transformation. The simplest example of this is when you have created multiple Classes from a single Class in a transformation and want a connector between them. Consider this example from the EJB Entity transformation:
There are three uses of the TRANSFORM_REFERENCE macro: one to identify this connector for synchronization purposes and the other two to identify the ends. All three use the same source GUID, because they all come from the one original Class. None of the three have to specify the transformation because the two references are referencing something in the current transformation. Each of them then only has to identify the transform name.
Of course it is also possible to create a connector from another connector.
You can create a connector template and list over all connectors connected to a Class from the Class level templates. You don't have to worry about only generating it once, because if you have created a TRANSFORM_REFERENCE for the connector then Enterprise Architect automatically synchronizes them. The following copies the source connector.
Connecting to a Class For Which You Know the GUID
The second type of Class that you can use as a connector end is one for which you know the current GUID. To do this, specify the GUID of the target Class in either the source or target end. The following example creates a dependency from a Class created in a transformation, to the Class it was transformed from.