An Add-In uses MDG_Connect to handle a user driven request to connect a model branch to an external application. The function is called when the user attempts to connect a particular Enterprise Architect Package to an as yet unspecified external project. The Add-In calls the event to interact with the user to specify such a project.
The Add-In is responsible for retaining the connection details, which should be stored on a per-user or per-workstation basis. That is, users who share a common Enterprise Architect model over a network should be able to connect and disconnect to external projects independently of one another.
The Add-In should therefore not store connection details in an Enterprise Architect repository. A suitable place to store such details would be:
The PackageGuid parameter is the same identifier as is required for most events relating to the MDG Add-In. Therefore it is recommended that the connection details be indexed using the PackageGuid value.
The PackageID parameter is provided to aid fast retrieval of Package details from Enterprise Architect, should this be required.
Function MDG_Connect (Repository As EA.Repository, PackageID as Long, PackageGuid As String) As Long
The MDG_Connect function syntax contains these parameters.
Description: The unique ID identifying the project provided by the Add-In when a connection to a project branch of an Enterprise Architect model was first established.
Direction: IN Description: The PackageID of the Enterprise Architect Package the user has requested to have connected to an external project.
Description: The PackageID of the Enterprise Architect Package the user has requested to have connected to an external project.
Description: An EA.Repository object representing the currently open Enterprise Architect model. Poll its members to retrieve model data and user interface status information.
Returns a non-zero to indicate that a connection has been made; a zero indicates that the user has not nominated a project and connection should not proceed.