Prev | Next |
Project Class
The Project interface can be accessed from the Repository using GetProjectInterface(). The returned interface provides access to the XML-based Enterprise Architect Automation Interface. Use this interface to get XML for the various internal elements and to run some utility functions to perform tasks such as load diagrams or run reports.
Project Attributes
Attribute |
Remarks |
See also |
---|---|---|
ObjectType |
ObjectType Notes: Read only Distinguishes objects referenced through a Dispatch interface. |
ObjectType |
Project Methods
Method |
Remarks |
See also |
---|---|---|
BuildExecutableStatemachine (string ElementGUID, string ExtraOptions) |
Boolean Notes: Builds Executable StateMachine code for an <<executable statemachine>> Artifact element. Parameters:
|
|
CancelValidation () |
Void Notes: Cancels a validation process. |
Model Validation |
CanValidate () |
Boolean Notes: Returns a value to indicate that the Model Validation component is loaded. |
|
ExportReferenceData (string FileName, string Tables) |
Boolean Notes: Exports Reference Data. Parameters:
|
|
ImportReferenceData (string FileName, string DataSets) |
Boolean Notes: Imports Reference Data Parameters:
|
|
GenerateBuildRunExecutableStateMachine (string ElementGUID, string ExtraOptions) |
Boolean Notes: Generates, builds and runs Executable StateMachine code for an <<executable statemachine>> Artifact element, which will start simulation of the StateMachine. Parameters:
|
|
CreateBaseline (string PackageGUID, string Version, string Notes) |
Boolean Notes: Creates a Baseline of a specified Package. Parameters:
|
|
CreateBaselineEx (string PackageGUID, string Version, string Notes, EA.CreateBaselineFlag Flags) |
Boolean Notes: Creates a Baseline of a specified Package, with a flag to exclude Package contents below the first level. Parameters:
|
Create Baselines EA.CreateBaselineFlag |
DefineRule (string CategoryID, EA.EnumMVErrorType ErrorType, string ErrorMessage) |
String Notes: Defines the individual rules that can be performed during model validation. It must be called once for each rule from the EA_OnInitializeUserRules broadcast handler. The return value is a RuleId, which can be used for reference purposes when an individual rule is executed by Enterprise Architect during model validation. See the Model Validation Example for a detailed example of the use of this method. Parameters:
|
EA_OnInitializeUserRules Model Validation Example DefineRuleCategory PublishResult |
DefineRuleCategory (string CategoryName) |
String Notes: Defines a category of rules that can be performed during model validation (there is typically one category per Add-In). It must be called once from the EA_OnInitializeUserRules broadcast handler. The return value is a CategoryId that must to be passed to the DefineRule method. See the Model Validation Example for a detailed example of the use of this method. Parameters:
|
EA_OnInitializeUserRules DefineRule Model Validation Example |
RunExecutableStatemachine (string ElementGUID, string ExtraOptions) |
Boolean Notes: Runs Executable StateMachine code for an <<executable statemachine>> Artifact element, which will start simulation of the StateMachine Parameters:
|
|
DeleteBaseline (string BaselineGUID) |
Boolean Notes: Deletes a Baseline, identified by the BaselineGUID, from the repository. Parameters:
|
|
DoBaselineCompare (string PackageGUID, string Baseline, string ConnectString) |
String Notes: Performs a Baseline comparison using the supplied Package GUID and Baseline GUID (obtained in the result list from GetBaselines). Optionally you can include the connection string required to find the Baseline if it exists in a different model file. This method returns a log file of the status of all elements found and compared in the difference procedure. You can use this log information as input to DoBaselineMerge - automatically merging information from the Baseline. Parameters:
|
GetBaselines DoBaselineMerge |
DoBaselineMerge (string PackageGUID, string Baseline, string MergeInstructions, string ConnectString) |
String Notes: Performs a batch merge based on instructions contained in an XML file (MergeInstructions). You can supply an optional connection string if the Baseline is located in another model. In the MergeInstructions file, each MergeItem node supplies the GUID of a differenced item from the XML difference log. As the merge is uni-directional and actioned in only one possible way, no additional arguments are required. Enterprise Architect chooses the correct procedure based on the 'Difference' results. <Merge> <MergeItem guid="{XXXXXX}" /> <MergeItem guid="{XXXXXX}" /> </Merge> Alternatively, you can supply a single Mergeitem with a GUID of RestoreAll. In this case, Enterprise Architect batch-processes ALL differences. <Merge> <MergeItem guid="RestoreAll" changed="true" baselineOnly="true" modelOnly="true" moved="true" fullRestore="false" /> </Merge> Parameters:
|
DoBaselineCompare() |
EnumDiagramElements (string DiagramGUID) |
protected abstract: String Notes: Gets an XML list of all elements in a diagram. Parameters:
|
|
EnumDiagrams (string PackageGUID) |
protected abstract: String Notes: Gets an XML list of all diagrams in a specified Package. Parameters:
|
|
EnumElements (string PackageGUID) |
protected abstract: String Notes: Gets an XML list of elements in a specified Package. Parameters:
|
|
EnumLinks (string ElementGUID) |
protected abstract: String Notes: Gets an XML list of connectors for a specified element. Parameters:
|
|
EnumPackages (string PackageGUID) |
protected abstract: String Notes: Gets an XML list of child Packages inside a parent Package. Parameters:
|
|
EnumProjects () |
protected abstract: String Notes: Gets a list of projects in the current file; corresponds to Models in Repository. |
Models |
EnumViews () |
protected abstract: String Notes: Enumerates the Views for a project. Returned as an XML document. |
|
EnumViewEx (string ProjectGUID) |
protected abstract: String Notes: Gets a list of Views in the current project. Parameters:
|
|
Exit () |
protected abstract: String Notes: Exits the current instance of Enterprise Architect; this function is maintained for backward compatibility and should never be called. Enterprise Architect automatically exits when you are no longer using any of the provided objects. |
|
ExportPackageXMI (string PackageGUID, enumXMIType XMIType, long DiagramXML, long DiagramImage, long FormatXML, long UseDTD, string FileName) |
protected abstract: String Notes: Exports XMI for a specified Package. Parameters:
|
XMIType Enum |
ExportPackageXMIEx (string PackageGUID, enumXMIType XMIType, long DiagramXML, long DiagramImage,
|
protected abstract: String Notes: Exports XMI for a specified Package, with a flag to determine whether the export includes Package content below the first level. Parameters:
|
Package Content XMIType Enum ExportPackageXMIFlag |
GenerateClass (string ElementGUID, string ExtraOptions) |
Boolean Notes: Generates the code for a single Class. Parameters:
|
|
GenerateDiagramFromScenario (string ElementGUID, EnumScenarioDiagramType DiagramType, long OverwriteExistingDiagram) |
Boolean Notes: Generates various diagrams from the Structured Specification of an element. Parameters:
|
ScenarioDiagramType Enum |
GenerateElementDDL (string ElementGUID, string FileName, string ExtraOptions) |
Boolean Notes: Generates DDL for an element using the options that are currently set on the Generate DDL screen. |
|
GenerateExecutableStatemachine (string ElementGUID, string ExtraOptions) |
Boolean Notes: Generates Executable StateMachine code for an <<executable statemachine>> Artifact element. Parameters:
|
|
GeneratePackage (string PackageGUID,
|
Boolean Notes: Generates the code for all Classes within a Package. For example: recurse=1;overwrite=1;dir=C:\ Parameters:
|
|
GeneratePackageDDL (string PackageGUID, string FileName, string ExtraOptions) |
Boolean Notes: Generates DDL for all elements in a Package using the options that are currently set on the Generate DDL screen. |
|
GenerateTestFromScenario (string ElementGUID, EnumScenarioTestType TestType) |
Boolean Notes: Generates a Vertical Test Suite, a Horizontal Test Suite, an Internal test or an External test from the Structured Specification of an element. Parameters:
|
Generate Test Cases ScenarioTestType Enum |
GenerateWSDL(string WSDLComponentGUID, string Filename, string Encoding, string ExtraOptions) |
Boolean Notes: Generates WSDL for the specified WSDL stereotyped Component. Parameters:
|
Web Services - WSDL |
GenerateXSD (string PackageGUID,
|
Boolean Notes: Creates an XML schema for a Package, specified by its GUID. Returns True on success. Parameters:
|
|
GetBaselines (string PackageGUID, string ConnectString) |
String Notes: Returns a list (in XML format) of Baselines associated with the supplied Package GUID. Optionally, you can provide a connection string to get Baselines from the same Package, but located in a different model file (or DBMS). Parameters:
|
|
GetDiagram (string DiagramGUID) |
protected abstract: String Notes: Gets the diagram details, in XML format. Parameters:
|
|
GetElement (string ElementGUID) |
protected abstract: String Notes: Gets XML for the specified element. Parameters:
|
|
GetElementConstraints (string ElementGUID) |
protected abstract: String Notes: Gets constraints for an element, in XML format. Parameters:
|
|
GetElementEffort (string ElementGUID) |
protected abstract: String Notes: Gets efforts for an element, in XML format. Parameters:
|
|
GetElementFiles (string ElementGUID) |
protected abstract: String Notes: Gets metrics for an element, in XML format. Parameters:
|
|
GetElementMetrics (string ElementGUID) |
protected abstract: String Notes: Gets files for an element, in XML format. Parameters:
|
|
GetElementProblems (string ElementGUID) |
protected abstract: String Notes: Gets a list of issues (problems) associated with an element, in XML format. Parameters:
|
|
GetElementProperties (string ElementGUID) |
protected abstract: String Notes: Gets Tagged Values for an element, in XML format. Parameters:
|
|
GetElementRequirements (string ElementGUID) |
protected abstract: String Notes: Gets a list of requirements for an element, in XML format. Parameters:
|
|
GetElementResources (string ElementGUID) |
protected abstract: String Notes: Gets a list of resources for an element, in XML format. Parameters:
|
|
GetElementRisks (string ElementGUID) |
protected abstract: String Notes: Gets a list of risks associated with an element, in XML format. Parameters:
|
|
GetElementScenarios (string ElementGUID) |
protected abstract: String Notes: Gets a list of scenarios for an element, in XML format. Parameters:
|
|
GetElementTests (string ElementGUID) |
protected abstract: String Notes: Gets a list of tests for an element, in XML format. Parameters:
|
|
GetFileNameDialog (string Filename, string FilterString, long FilterIndex, long Flags, string InitialDirectory,
|
String Notes: Opens a standard 'File Open' or 'Save As' dialog and returns a string containing the full path to the selected file on success. Returns an empty string if the dialog was canceled. For example: Filename = "" FilterString = "CSV Files (*.csv)|*.csv|All Files (*.*)|*.*||" Filterindex = 1 Flags = &H2 'OFN_OVERWRITEPROMPT InitialDirectory = "" OpenOrSave = 1 filepath = Project.GetFileNameDialog (Filename, FilterString, Filterindex, Flags, InitialDirectory, OpenOrSave) In this example, the 'Save As' dialog will prompt for a CSV file. Parameters:
|
|
GetLastError () |
protected abstract: String Notes: Returns a string value describing the most recent error that occurred in relation to this object. |
|
GetLink (string LinkGUID) |
protected abstract: String Notes: Gets connector details, in XML format. Parameters:
|
|
GUIDtoXML (string GUID) |
String Notes: Changes an internal GUID to the form used in XML. Parameters:
|
|
ImportDirectory (string PackageGUID, string Language, string DirectoryPath, string ExtraOptions) |
Boolean Notes: Imports a source code directory into the model. Parameters:
|
|
ImportFile (string PackageGUID, string Language, string FileName, string ExtraOptions) |
Boolean Notes: Imports an individual file or binary module into the model, in a Package per namespace style import. Parameters:
|
|
ImportPackageXMI (string PackageGUID, string Filename, long ImportDiagrams, long StripGUID) |
String Notes: Imports an XMI file at a point in the tree. Returns an empty string if successful, or returns an error message on failure. Parameters:
|
|
LayoutDiagram (string DiagramGUID, long LayoutStyle) |
Boolean Notes: Deprecated. it is recommended that LayoutDiagramEx is used instead. Calls the function to automatically layout a diagram in hierarchical fashion. It is only recommended for Class and Object diagrams. Parameters:
|
|
LayoutDiagramEx (string DiagramGUID, long LayoutStyle, long Iterations, long LayerSpacing, long ColumnSpacing, boolean SaveToDiagram) |
Boolean Notes: Calls the function to automatically layout a diagram in hierarchical fashion. It is only recommended for Class and Object diagrams. LayoutStyle accepts these options
- lsDiagramDefault - lsProgramDefault
- lsCycleRemoveGreedy - lsCycleRemoveDFS
- lsLayeringLongestPathSink - lsLayeringLongestPathSource - lsLayeringOptimalLinkLength
- IsInitializeNaive - IsInitializeDFSOut - IsInitializeDFSIn
- lsCrossReduceAggressive
- lsLayoutDirectionUp - lsLayoutDirectionDown - lsLayoutDirectionLeft - lsLayoutDirectionRight Parameters:
|
ConstLayoutStyles Enum |
LoadControlledPackage (string PackageGUID) |
String Notes: Loads a Package that has been marked and configured as controlled. The filename details are stored in the Package control data. Parameters:
|
|
LoadDiagram (string DiagramGUID) |
protected abstract: Boolean Notes: Loads a diagram by its GUID. Parameter:
|
GUIDtoXML |
LoadProject (string FileName) |
protected abstract: Boolean Notes: Loads an Enterprise Architect project file. Do not use this method if you have accessed the Project interface from the Repository, which has already loaded a file. Parameters:
|
|
Migrate (string GUID, string SourceType, string DestinationType) |
Void Notes: Migrates a model (or part of a model) from one BPMN, ArchiMate, UPDM or SysML format to an upgraded format. Parameters:
|
|
MigrateToBPMN11 (string GUID,
|
Void Notes: Migrates every BPMN 1.0 construct in a Package or an element (including elements, attributes, diagrams and connectors) to BPMN 1.1. Parameters
Migrating to BPEL is possible in the Ultimate or Unified editions of Enterprise Architect. |
|
ProjectTransfer (string SourceFilePath,
|
Boolean Notes: Transfers the project from a .eap file or DBMS to a .eap file. Parameters:
In automation, the target file does not have to exist; the file path is enough. Enterprise Architect creates a new, empty Base.eap file and transfers the source project into it. |
|
PublishResult (string CategoryID,
|
String Notes: Returns the results of each rule that can be performed during model validation. It must be called once for each rule from the EA_OnInitializeUserRules broadcast handler. The return value is a RuleId, which can be used for reference purposes when an individual rule is executed by Enterprise Architect during model validation. See the Model Validation Example for a detailed example of the use of this method. Parameters:
|
EA_OnInitializeUserRules Model Validation Example DefineRuleCategory |
PutDiagramImageOnClipboard (string DiagramGUID,
|
protected abstract: Boolean Notes: Copies an image of the specified diagram to the clipboard. Parameters:
|
|
PutDiagramImageToFile (string Diagram GUID,
|
protected abstract: Boolean Notes: Saves an image of the specified diagram to file. Parameters:
|
|
ReloadProject () |
protected abstract: Boolean Notes: Reloads the current project. This is a convenient method to refresh the current loaded project (in case of outside changes to the .eap file). |
|
RunModelSearch (string Search, string SearchTerm, bool ShowInEA) |
Void Notes: Invokes the Model Search component. Parameters:
|
Model Search Repository Class |
RunReport (string PackageGUID,
|
protected abstract: Void Notes: Runs a named document report. Parameters:
|
Document Generator Interface Package Generate Documentation Virtual Documents |
RunHTMLReport (string PackageGUID,
|
String Notes: Runs an HTML report (as for 'Documentation | HTML Documentation' when you right-click on a Package in the Project Browser). Parameters:
|
Create an HTML Report Master Documents and Model Documents |
SaveControlledPackage (string PackageGUID) |
String Notes: Saves a Package that has been configured as a controlled Package, to XMI. Only the Package GUID is required, Enterprise Architect picks the rest up from the Package control information. Parameter:
|
|
SaveDiagramImageToFile (string Filename) |
protected abstract: String Notes: Saves a diagram image of the current diagram to file. Parameters:
|
|
ShowWindow (long Show) |
protected abstract: Void Notes: Shows or hides the Enterprise Architect User Interface. Parameters:
|
|
SynchronizeClass (string ElementGUID,
|
Boolean Notes: Synchronizes a Class with the latest source code. Parameters:
|
|
SynchronizePackage (string PackageGUID,
|
Boolean Notes: Synchronizes each Class in a Package with the latest source code. Parameters:
|
|
TransformElement (string TransformName,
|
Boolean Notes: Transforms an element into a Package. Parameters:
|
|
TransformPackage (string TransformName,
|
Boolean Notes: Runs a transformation on the contents of a Package. Parameters:
|
|
ValidateDiagram (string DiagramGUID) |
Boolean Notes: Invokes the Enterprise Architect Model Validation component, then validates the diagram (for correctness) and the elements and connectors within the diagram. Output can be viewed through 'Start > Explore > Browse > System Output > Model Validation'. Returns a boolean value to indicate the success or failure of the process, regardless of the results of the validation. Parameters:
|
Model Validation |
ValidateElement (string ElementGUID) |
Boolean Notes: Invokes the Enterprise Architect Model Validation component, then validates the element and all child elements, diagrams, connectors, attributes and operations. Output can be viewed through 'Start > Explore > Browse > System Output > Model Validation'. Returns a boolean value to indicate the success or failure of the process, regardless of the results of the validation. Parameters:
|
|
ValidatePackage (string PackageGUID) |
Boolean Notes: Invokes the Enterprise Architect Model Validation component, then validates the Package and all sub-Packages, elements, connectors and diagrams within it. Output can be viewed through 'Start > Explore > Browse > System Output > Model Validation'. Returns a boolean value to indicate the success or failure of the process, regardless of the results of the validation. Parameters:
|
|
XMLtoGUID (string GUID) |
String Notes: Changes a GUID in XML format to the form used inside Enterprise Architect. Parameters:
|
Notes
Learn more