Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
MDG_Merge
Topics
Topic |
Detail |
See also |
---|---|---|
Details |
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 String, ExportObjects As Variant, ExportFiles As Variant, ImportFiles As Variant, IgnoreLocked As String, Language As String) As Long
The MDG_Merge function syntax contains the following elements:
Parameter |
Type |
Direction |
Description |
---|---|---|---|
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 must have a corresponding entry in the ExportObjects parameter at the same array index, so ExportFiles(2) must contain the filename of the object by ExportObjects(2).
|
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.
|
IgnoreLocked |
String |
OUT |
A value indicating whether to ignore any files locked by the code project (that is, "TRUE" or "FALSE").
|
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.
|
Language |
String |
OUT |
The string value containing the name of the code language supported by the code project connected to the model branch.
|
PackageGuid |
String |
IN |
The GUID identifying the Enterprise Architect package sub-tree that is controlled by the Add-In.
|
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.
|
|
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. See below for the format of the Object IDs.
|
SynchType |
String |
OUT |
The value determining the user-selected type of synchronization to take place. See below for a list of valid values.
|
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 |
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 |
Each of the Object IDs listed in the string arrays described above should be composed in the following format:
(@namespace)*(#class)*($attribute|%operation|:property)*