Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Repository Class
The Repository is the main container of all structures such as models, packages and elements. You can iteratively begin accessing the model using the Models collection. It also has some convenient methods to directly access the structures without having to locate them in the hierarchy first.
Associated table in .EAP file <none>
Repository Attributes
Attribute |
Type |
Notes |
See also |
Authors |
Read only This is the system Authors collection. This contains 0 or more Author objects, each of which can be associated with, for example, elements or diagrams as the item author or owner. Use AddNew (), Delete () and GetAt () to manage Authors.
|
|
|
BatchAppend |
Boolean |
Read/Write Set this property to true when your automation client has to rapidly insert many elements, operations, attributes and/or operation parameters. Set to false when work is complete. This can result in 10- to 20-fold improvement in adding new elements in bulk.
|
|
Clients |
Read only A list of Clients associated with the project. You can modify, delete and add new Client objects using this collection.
|
|
|
ConnectionString |
String |
Read only The filename/connection string of the current Repository. For a connection string, the DBMS repository type is identified by "DBType=n;" where n is a number corresponding to the DBMS type, as follows: 0 - MYSQL
|
|
Datatypes |
Read only The Datatypes collection. This contains a list of Datatype objects, each representing a data type definition for either data modeling or code generation purposes.
|
|
|
EAEdition |
Read only Returns the current level of core licensed functionality available. This property returns Corporate when the edition is Business and Software Engineering, Systems Engineering or Ultimate. Use EAEditionEx to identify which of these extended editions is available.
|
|
|
EAEditionEx |
Read only Returns the current level of extended licensed functionality available.
|
|
|
EnableCache |
Boolean |
Read/Write An optimization for pre-loading package objects when dealing with large sets of automation objects.
|
|
EnableUIUpdates |
Boolean |
Read/Write Set this property to false to improve the performance of changes to the model; for example, bulk addition of elements to a package. To reveal changes to the user, call Repository.RefreshModelView ().
|
|
FlagUpdate |
Boolean |
Read/Write Instructs Enterprise Architect to update the Repository with the LastUpdate value.
|
|
InstanceGUID |
String |
Read only The identifier string identifying the Enterprise Architect runtime session.
|
|
IsSecurityEnabled |
Boolean |
Read only Checks whether User Security is enabled for the current repository.
|
|
Issues |
Read only The System Issues list. Contains ProjectIssues objects, each detailing a particular issue as it relates to the project as a whole.
|
|
|
LastUpdate |
String |
Read only The identifier string identifying the Enterprise Architect runtime session and the timestamp for when it was set.
|
|
LibraryVersion |
Long |
Read only The build number of the Enterprise Architect runtime.
|
|
Collection of type Package |
Read only Models are of type package and belong to a collection of packages. This is the top level entry point to an Enterprise Architect project file. Each model is a root node in the Project Browser and can contain items such as Views and packages. A model is a special form of a package; it has a ParentID of 0. By iterating through all models, you can access all the elements within the project hierarchy. You can also use the AddNew () function to create a new model. A model can be deleted, but remember that everything contained in the model is deleted as well.
|
|
|
ObjectType |
Read only Distinguishes objects referenced through the Dispatch interface.
|
|
|
ProjectGUID |
String |
Read only Returns a unique ID for the project.
|
|
ProjectRoles |
Read only The system Roles collection. Contains 0 or more Role objects, each of which can be associated with, for example, elements or diagrams as the item author or owner. Use AddNew (), Delete () and GetAt () to manage Roles.
|
|
|
PropertyTypes |
Read only Collection of Property Types available to the Repository.
|
||
Resources |
Read only Contains available ProjectResource objects to assign to work items within the project. Use the add new, modify and delete functions to manage resources.
|
|
|
Stereotypes |
Read only The Stereotype collection. A list of Stereotype objects that contain information on a stereotype and which elements it can be applied to.
|
||
SuppressEADialogs |
Boolean |
Read/Write Set this property in the EA_OnPostNewElement broadcast event to control whether Enterprise Architect should suppress showing the default Properties dialog to the user when an element is created.
|
|
SuppressSecurityDialog |
Boolean |
Read/Write Suppress the login prompt dialog that appears by default when username and password parameters passed to OpenFile2 are invalid. For use by external automation clients only.
|
|
Tasks |
Read only A list of system tasks (to do list). Each entry is a Task Item; you can modify, delete and add new tasks.
|
||
Terms |
Read only The project Glossary. Each Term object is an entry in the Glossary. Add, modify and delete Terms to maintain the Glossary.
|
Repository Methods
Method |
Type |
Notes |
See also |
||||||||||||||||||
ActivateDiagram ( |
|
Activates an already open diagram (that is, makes it the active tab) in the main Enterprise Architect user interface. Parameters:
|
|
||||||||||||||||||
ActivatePerspective (
|
Boolean |
Deprecated - no longer in use. |
|
||||||||||||||||||
ActivateTab ( |
|
Activates an open Enterprise Architect tabbed view. Parameters:
|
|
||||||||||||||||||
ActivateTechnology ( |
|
Activates an enabled MDG Technology. Parameters:
|
|||||||||||||||||||
ActivateToolbox ( |
Boolean |
Activates a Toolbox page in the GUI. The returned value is reserved for future use. Parameters:
|
|
||||||||||||||||||
AddDefinedSearches ( |
|
Enables you to enter a set of defined searches that last in Enterprise Architect for the life of the application; when Enterprise Architect loads again they must be inserted again by your Add-In. Parameters:
|
|||||||||||||||||||
AddDocumentationPath(
|
|
Provides an Add-In with the ability to insert a book path into the Enterprise Architect installation directory, to display Learning Center pages on user-authored subjects (such as use of the Add-In). Parameters:
|
|
||||||||||||||||||
AddPerspective (
|
Boolean |
Deprecated - no longer in use. |
|
||||||||||||||||||
activeX custom control |
Adds an ActiveX custom control as a tabbed window. Enterprise Architect creates a control and, if successful, returns its Unknown pointer, which can be used by the caller to manipulate the control. Parameters:
|
|
|||||||||||||||||||
activeX custom control |
Adds an ActiveX custom control as a window to the Add-Ins docked window. Enterprise Architect creates a control and, if successful, returns its Unknown pointer, which can be used by the caller to manipulate the control. Parameters:
|
|
|||||||||||||||||||
AdviseConnectorChange ( |
|
Provides an Add-In or automation client with the ability to advise the Enterprise Architect user interface that a particular connector has changed and, if it is visible in any open diagram, to reload and refresh that connector for the user. Parameters:
|
|
||||||||||||||||||
AdviseElementChange ( |
|
Provides an Add-In or automation client with the ability to advise the Enterprise Architect user interface that a particular element has changed and, if it is visible in any open diagram, to reload and refresh that element for the user. Parameters:
|
|
||||||||||||||||||
ChangeLoginUser ( |
Boolean |
Sets the currently logged on user to be that specified by a name and password; this logs the user into the repository when security is enabled. If security is not enabled an exception (Security not enabled) is thrown. Parameters:
|
|
||||||||||||||||||
ClearAuditLogs ( |
Boolean |
Clears all Audit Logs from the model. If StartDateTime and EndDateTime are not null then only log items that fall into this period are cleared. Returns true for success, false for failure.
Parameters:
|
|
||||||||||||||||||
|
Removes all the text from a tab in the Output window. Parameters:
|
||||||||||||||||||||
CloseAddins () |
|
Called by automation controllers to ensure that Add-Ins created in .NET do not linger after all controller references to Enterprise Architect have been cleared.
|
|
||||||||||||||||||
CloseDiagram ( |
|
Closes a diagram in the current list of diagrams that Enterprise Architect has open. Parameters:
|
|
||||||||||||||||||
CloseFile () |
|
Closes any open file.
|
|
||||||||||||||||||
CreateDocumentGenerator() |
|
Returns a pointer to the EA.DocumentGenerator interface. |
|
||||||||||||||||||
CreateModel ( |
Boolean |
Creates a new .eap model file based on the standard Enterprise Architect Base model, or a shortcut .eap based on a provided SQL connection. Returns true when the new file is created, otherwise returns false. Parameters:
|
|||||||||||||||||||
|
Creates a tab in the Output window. Parameters:
|
|
|||||||||||||||||||
DeletePerspective (
|
Boolean |
Deprecated - no longer in use. |
|
||||||||||||||||||
DeleteTechnology ( |
Boolean |
Removes a specified MDG Technology resource from the repository. Returns true, if the technology is successfully removed from the model. Returns false otherwise.
Parameters:
|
|||||||||||||||||||
|
Ensures that a specified tab in the Output window is visible to the user. The Output window is made visible if it is hidden. Parameters:
|
||||||||||||||||||||
ExecutePackageBuildScript ( |
|
Enables you to run the active package build script based on your current selection in the Project Browser. You can also run a script by passing in the package GUID. Parameters:
1 = Build 2 = Test 3 = Run 4 = Create Workbench Instance 5 = Debug
|
|
||||||||||||||||||
Exit |
|
Shuts down Enterprise Architect immediately. Used by .NET programmers where the garbage collector does not immediately release all referenced COM objects. |
|
||||||||||||||||||
GetActivePerspective () |
String |
Deprecated - no longer in use.
|
|
||||||||||||||||||
GetAttributeByGuid ( |
Returns a pointer to an attribute in the repository, located by its GUID.This is usually found using the AttributeGUID property of an attribute. Parameters:
|
|
|||||||||||||||||||
GetAttributeByID ( |
Returns a pointer to an attribute in the repository, located by its ID. This is usually found using the AttributeID property of an attribute. Parameters:
|
|
|||||||||||||||||||
GetConnectorByGuid ( |
Returns a pointer to a connector in the repository, located by its GUID. This is usually found using the ConnectorGUID property of a connector. Parameters:
|
|
|||||||||||||||||||
GetConnectorByID ( |
Searches the repository for a connector with a specific ID. Parameters:
|
|
|||||||||||||||||||
GetContextItem ( |
Sets a pointer to an item in context within Enterprise Architect. Also returns the corresponding ObjectType. For additional information about ContextItems and the supported ObjectTypes see the GetContextItemType method (below). Parameters:
|
|
|||||||||||||||||||
GetContextItemType () |
Returns the ObjectType of an item in context within Enterprise Architect. A ContextItem is defined as an item selected anywhere within the Enterprise Architect GUI including:
The supported ObjectTypes can be any one of the following values:
|
|
|||||||||||||||||||
GetContextObject () |
Object |
Returns the current context Object.
|
|
||||||||||||||||||
GetCounts () |
String |
Returns a set of counts from a number of tables within the base Enterprise Architect repository. These can be used to determine whether records have been added or deleted from the tables for which information is retrieved.
|
|
||||||||||||||||||
GetCurrentDiagram () |
Returns a selected diagram.
|
|
|||||||||||||||||||
GetCurrentLoginUser ( |
String |
If security is not enabled in the repository, an error is generated. If GetGuid is True, a GUID generated by Enterprise Architect representing the user is returned; otherwise the text as entered in System Users/User Details/Login is returned.
|
|
||||||||||||||||||
GetDiagramByGuid ( |
Returns a pointer to a diagram using the global reference ID (global ID). This is usually found using the diagram GUID property of an element, and stored for later use to open an diagram without using the collection GetAt() function. Parameters:
|
|
|||||||||||||||||||
GetDiagramByID ( |
Gets a pointer to a diagram using an absolute reference number (local ID). This is usually found using the DiagramID property of an element, and stored for later use to open a diagram without using the collection GetAt() function. Parameters:
|
|
|||||||||||||||||||
GetElementByGuid ( |
Returns a pointer to an element in the repository, using the element's GUID reference number (global ID). This is usually found using the ElementGUID property of an element, and stored for later use to open an element without using the collection GetAt () function. Parameters:
|
|
|||||||||||||||||||
GetElementByID ( |
Gets a pointer to an element using an absolute reference number (local ID). This is usually found using the ElementID property of an element, and stored for later use to open an element without using the collection GetAt () function. Parameters:
|
|
|||||||||||||||||||
GetElementsByQuery ( |
Collection (of type Element) |
Enables the user to run a search in Enterprise Architect, returning the result as a collection. For example GetElementsByQuery('Simple','Class1'), where results contain elements with Class1 in the Name and Notes fields. Parameters:
|
|
||||||||||||||||||
GetElementSet ( |
Collection |
Returns a set of elements as a collection based on a comma-separated list of ElementID values. By default, if no values are provided in the IDList parameter, all objects for the entire project are returned. Parameters
|
|
||||||||||||||||||
GetFieldFromFormat ( |
String |
Converts a field from your preferred format to Enterprise Architect's internal format; returns the field in that format. Parameters:
|
|
||||||||||||||||||
GetFormatFromField ( |
String |
After accessing a field that contains formatting, use this method to convert it to your preferred format; returns the field in the format specified. Parameters:
|
|
||||||||||||||||||
GetGapAnalysisMatrix () |
String |
Read Only. Returns all Gap Analyses as an XML document.
|
|||||||||||||||||||
GetLastError () |
String |
Returns a string value describing the most recent error that occurred in relation to this object.
|
|
||||||||||||||||||
GetMailInterface() |
MailInterface |
Returns an instance of the EA.MailIinterface; use this interface to automate the process of creating and sending model mail messages.
|
|||||||||||||||||||
GetMethodByGuid ( |
Returns a pointer to a method in the repository; this is usually found using the MethodGUID property of a method. Parameters:
|
|
|||||||||||||||||||
GetMethodById ( |
Returns a pointer to a method in the repository; this is usually found using the MethodID property of a method. Parameters:
|
|
|||||||||||||||||||
GetPackageByGuid ( |
Returns a pointer to a package in the repository using the package's GUID reference number (global ID). This is usually found using the PackageGUID property of the package. Each package in the model also has an associated element with the same GUID, so if you have an element with Type="Package" then you can load the package by calling: GetPackageByGuid(Element.ElementGUID) Parameters:
|
|
|||||||||||||||||||
GetPackageByID ( |
Get a pointer to a package using an absolute reference number (local ID). This is usually found using the PackageID property of an package, and stored for later use to open a package without using the collection GetAt () function. Parameters:
|
|
|||||||||||||||||||
GetProjectInterface () |
Return a pointer to the EA.Project interface (the XML-based automation server for Enterprise Architect). Use this interface to work with Enterprise Architect using XML, and also to access utility functions for loading diagrams, running reports and so on.
|
||||||||||||||||||||
GetReferenceList ( |
Uses the list type to get a pointer to a Reference List object. Parameters:
|
|
|||||||||||||||||||
GetRelationshipMatrix() |
String |
Returns all Relationship Matrices as an XML document.
|
|||||||||||||||||||
GetTechnologyVersion ( |
String |
Returns the version of a specified MDG Technology resource. Parameters:
|
|
||||||||||||||||||
GetTreeSelectedElements() |
Returns the set of elements currently selected in the Project Browser as a collection.
|
|
|||||||||||||||||||
Gets an object variable and type corresponding to the currently selected item in the tree view. To use this function, create a generic object variable and pass this as the parameter. Depending on the return type, cast it to a more specific type. The object passed back through the parameter can be a package, element, diagram, attribute or operation object. Parameters:
|
|
||||||||||||||||||||
GetTreeSelectedItemType () |
Returns the type of the object currently selected in the tree. One of:
|
|
|||||||||||||||||||
GetTreeSelectedObject () |
Object |
The related method GetTreeSelectedItem () has an output parameter that is inaccessible by some scripting languages. As an alternative, this method provides the selected item through the return value.
|
|||||||||||||||||||
GetTreeSelectedPackage () |
Returns the package in which the currently selected tree view object is contained.
|
|
|||||||||||||||||||
HasPerspective (
|
String |
Deprecated - no longer in use. |
|
||||||||||||||||||
|
Hides the docked Add-In window.
|
|
|||||||||||||||||||
ImportPackageBuildScripts ( |
|
Imports build scripts into a package in Enterprise Architect. Parameters:
|
|
||||||||||||||||||
ImportTechnology ( |
Boolean |
Installs a given MDG Technology resource into the repository. Returns True, if the technology is successfully loaded into the model. Otherwise returns False. This applies to technologies imported into pre-7.0 versions of Enterprise Architect (imported technologies), not to technologies referenced in version 7.0 and later (referenced technologies). Parameters:
|
|||||||||||||||||||
InvokeConstructPicker ( |
String |
Invokes the Select <Item> dialog with filters on the object type and, optionally, stereotype. Returns the ElementID of the selected object, or 0 if no object was selected when the dialog was closed. For example: elementid=Repository.InvokeConstructPicker( "IncludedTypes=Class,Component;StereoType=foo,bar" ) In this example, the Select <item> dialog will allow the user to select any Class or Component element in the model that has a stereotype of foo or bar. Parameters: |
|||||||||||||||||||
InvokeFileDialog (
|
String |
Opens a standard Open File Dialog and returns a string containing the full path to the selected file on success. Returns an empty string if the dialog was canceled. Parameters:
|
|||||||||||||||||||
IsTabOpen ( |
String |
Checks whether a named Enterprise Architect tabbed view is open and active. This includes open diagram windows or custom controls added using Repository.AddTab (). Returns:
Parameters:
|
|||||||||||||||||||
IsTechnologyEnabled ( |
Boolean |
Checks whether a specified technology is enabled in Enterprise Architect. Returns True if the MDG Technology resource is enabled. Otherwise returns False. Parameters:
|
|
||||||||||||||||||
IsTechnologyLoaded ( |
Boolean |
Checks whether a specified technology is loaded into the repository. Returns True if the MDG Technology resource is loaded into the repository. Otherwise returns False. Parameters:
|
|
||||||||||||||||||
LoadAddins () |
|
Loads all Add-Ins from a repository.
|
|
||||||||||||||||||
OpenDiagram ( |
|
Provides a method for an automation client or Add-In to open a diagram. The diagram is added to the tabbed list of open diagrams in the main Enterprise Architect view. Parameters:
|
|
||||||||||||||||||
OpenFile ( |
Boolean |
This is the main point for opening an Enterprise Architect project file from an automation client, and working with the contained objects. If the required project is a DBMS repository, and you have created a shortcut .EAP file containing the database connection string, you can call this shortcut file to access the DBMS repository. You can also connect to a SQL database by passing in the connection string itself instead of a filename. A valid connection string can be obtained from the Open Project dialog by selecting a recently opened SQL repository. Parameters:
|
|||||||||||||||||||
OpenFile2 ( |
Boolean |
As for OpenFile () except this enables the specification of a password. Parameters:
|
|
||||||||||||||||||
RefreshModelView ( |
|
Reloads a package or the entire model, updating the user interface. Parameters:
|
|
||||||||||||||||||
RefreshOpenDiagrams ( |
|
Reloads the diagram contents for all open diagrams from the repository. Parameters:
|
|
||||||||||||||||||
ReloadDiagram ( |
|
Reloads a specified diagram. This would commonly be used to refresh a visible diagram after code import/export or other batch process where the diagram requires complete refreshing.
Parameters:
|
|||||||||||||||||||
RemoveOutputTab ( |
|
Removes a specified tab from the Output window. Parameters:
|
|
||||||||||||||||||
Boolean |
Removes an Add-In window that matches the specified WindowName. Parameters:
|
|
|||||||||||||||||||
RepositoryType () |
String |
Returns the currently open database/repository type. May return one of the following values:
|
|
||||||||||||||||||
RunModelSearch ( |
|
Runs a search, displaying the results in Enterprise Architect's Model Search window. Parameters:
|
Project Class |
||||||||||||||||||
SaveAllDiagrams () |
|
Saves all open diagrams.
|
|
||||||||||||||||||
SaveAuditLogs ( |
Boolean |
Saves the Audit Logs contained within a model to a specified file. If StartDateTime and EndDateTime are not null then only log items that fall into this period are saved. Returns true for success, false for failure.
Parameters:
|
|
||||||||||||||||||
SaveDiagram ( |
|
Saves an open diagram; assumes the diagram is open in the main user interface Tab list. Parameters:
|
|
||||||||||||||||||
ScanXMIAndReconcile () |
|
Scans the package XMI files associated with each of the project's controlled packages and restores any diagram objects or cross-references that are detected as missing from the project. This function is useful in team environments where each user maintains their own private copy of the model database (i.e. multiple private EAP files) and model updates are propagated through the use of controlled packages; it provides no benefit when the model is hosted in a single shared database that is accessed by all team members. Each controlled package is compared with its associated XMI file and, if the cross-reference information in the model does not match the XMI, Enterprise Architect updates the model with the information from the XMI and records the update in the Output window. You can roll back such updates by right-clicking on the entry in the Output window and selecting the context menu option Rollback Update (or Rollback Selected Updates if multiple entries are selected). Closing the model clears the entries in the Output window; an entry in the Output window is also cleared as and when you roll-back the update for it. This functionality is invoked automatically as part of the Get All Latest operation. When working in an environment that uses a Private Model deployment and your model contains a significant number of cross-package references, it is recommended that you invoke this function from time to time, following the re-importation of controlled packages - for example, after using Get Latest to update a number of packages, or after performing a number of package check-outs.
|
|
||||||||||||||||||
Boolean |
Shows the docked Add-In window on the specified page. Returns true if a tab of the specified name is now displayed. Parameters
|
|
|||||||||||||||||||
ShowDynamicHelp ( |
|
Shows a help topic as a view. Parameters:
|
|
||||||||||||||||||
ShowInProjectView ( |
|
Selects a specified object in the Project Browser. Accepted object types are Package, Element, Diagram, Attribute, and Method; an exception is thrown if the object is of an invalid type. Parameters:
|
|
||||||||||||||||||
ShowWindow ( |
|
Shows or hides Enterprise Architect. Parameters:
|
|
||||||||||||||||||
SQLQuery ( |
String |
Enables execution of a SQL select statement against the current repository. Returns an XML formatted string value of the resulting recordset. Parameters:
|
|
||||||||||||||||||
SynchProfile ( |
Boolean |
Synchronizes Tagged Values and constraints of a UML Profile item using the Synch Profiled Elements dialog. Parameters:
|
|||||||||||||||||||
VersionControl- |
|
Synchronizes the version control status of each version controlled package within the current model with the status reported by your version control provider. Parameters:
|
|||||||||||||||||||
|
Writes text to a specified tab in the Output window, and associates the text with an ID. Parameters:
|
|