Description
The MDG_Merge enables the Add-In to jointly handle changes to both the model branch and the code project that the model branch is connected to. This event should be called whenever the user has asked to merge their model branch with its connected code project, or whenever the user has established a new connection to a code project. The purpose of this event is to enable the Add-In to interact with the user to perform a merge between the model branch and the connected project.
Syntax
Function MDG_Merge(Repository As EA.Repository, PackageGuid As String, SynchObjects As Variant, SynchType As Variant, ExportObjects As Variant, ExportFiles As Variant, ImportFiles As Variant, IgnoreLocked As Variant, Language As String) As Long
The MDG_Merge function syntax contains the following elements:
Parameter |
Type |
Direction |
Description |
Repository |
EA.Repository |
IN |
An EA.Repository object representing the currently open Enterprise Architect model. Poll its members to retrieve model data and user interface status information. |
PackageGuid |
String |
IN |
The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In. |
SynchObjects |
Variant |
OUT |
A string array containing a list of objects (Object ID format) to be jointly synchronized between the model branch and the project. Refer below for the format of the Object IDs |
SynchType |
Variant |
OUT |
The integer value determining the user-selected type of synchronization to take place. Refer below for a list of valid values |
ExportObjects |
Variant |
OUT |
The string array containing the list of new model objects (in Object ID format) to be exported by Enterprise Architect to the code project. |
ExportFiles |
Variant |
OUT |
A string array containing the list of files for each model object chosen for export by the Add-In. Each entry in this array shall have a corresponding entry in the ExportObjects parameter at the same array index, so ExportFiles(2) shall contain the filename of the object by ExportObjects(2). |
ImportFiles |
Variant |
OUT |
A string array containing the list of code files made available to the code project to be newly imported to the model. Enterprise Architect imports each file listed in this array for import into the connected model branch. |
IgnoreLocked |
Variant |
OUT |
A Boolean value containing the user-selected option to ignore any files locked by the code project. |
Language |
String |
OUT |
The string value containing the name of the code language supported by the code project connected to the model branch. |
Return Value
Return a non-zero if the Merge operation completed successfully and a zero value when the operation has been unsuccessful.
Merge
A merge consists of three major operations:
· | Export: Where newly created model objects are exported into code and made available to the code project. |
· | Import: Where newly created code objects, classes and such things are imported into the model. |
· | Synchronize: Where objects available both to the model and in code are jointly updated to reflect changes made in either the model, code project or both. |
Synchronize Type
The Synchronize operation can take place in one of four different ways, each of these ways corresponds to a value returned by SynchType:
· | None: (SynchType = 0) No synchronization is to be performed. |
· | Forward: (SynchType = 1) Forward synchronization, between the model branch and the code project is to occur. |
· | Reverse: (SynchType = 2) Reverse synchronization, between the code project and the model branch is to occur. |
· | Both: (SynchType = 3) Reverse, then Forward synchronization's are to occur. |
Object ID Format
Each of the Object IDs listed in the string arrays described above should be composed in the following format:
(@namespace)*(#class)*($attribute|%operation|:property)*
See Also