Réserver une Démo
Pré. Proc.

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

Notes

  • The Project methods listed here all require input GUIDs in XML format; use GUIDtoXML to change the Enterprise Architect GUID to an XML GUID

Learn more

Project Methods

Method

Remarks

See also

BuildExecutableStatemachine (string ElementGUID, string ExtraOptions)

Boolean

Notes: Builds Executable StateMachine code for an <<executable statemachine>> Artifact element.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element to generate
  • ExtraOptions: String - enables extra options to be given to the command (currently unused)

CancelValidation ()

Void

Notes: Cancels a validation process.

Model Validation

CanValidate ()

Boolean

Notes: Returns a value to indicate that the Model Validation component is loaded.

CreateBaseline (string PackageGUID, string Version, string Notes)

Boolean

Notes: Creates a Baseline of a specified Package.

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the Package to Baseline
  • Version: String - the version of the Baseline
  • Notes: String - any notes concerning the Baseline

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:

  • PackageGUID: String - the GUID (in XML format) of the Package to be Baselined
  • Version: String - the version of the Baseline
  • Notes: String - any notes concerning the Baseline
  • Flags: EA.CreateBaselineFlag - whether or not to exclude the Package contents below the first level
Creating Baselines 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:

  • CategoryId: String - should be passed the return value from the DefineRuleCategory method
  • ErrorType: EA.EnumMVErrorType - depending on the severity of the error being validated, can be:
         -  mvErrorCritical
         -  mvError
         -  mvWarning, or
         -  mvInformation
  • ErrorMessage: String - can contain a default error string, although this is probably overridden by the PublishResult call
EA_OnInitializeUserRules Model Validation Example Project Class

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:

  • CategoryName: String - a text string that is visible in the 'Model Validation Configuration' dialog
EA_OnInitializeUserRules Project Class Model Validation Example

DeleteBaseline (string BaselineGUID)

Boolean

Notes: Deletes a Baseline, identified by the BaselineGUID, from the repository.

If the repository is configured to store Baselines in a Reusable Asset Service Registry, then it is not possible to delete the Baseline and a False value is returned.

Parameters:

  • BaselineGUID: String - the GUID (in XML format) of the Baseline to delete

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:

  • PackageGUID: String - the GUID (in XML format) of the Package to run the comparison on
  • Baseline: String - the GUID (in XML format) of the Baseline to run the comparison on
  • ConnectString: String - not currently used
Project Class

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:

  • PackageGUID: String - the GUID (in XML format) of the Package to merge the Baseline into
  • Baseline: String - the GUID of the Baseline (in XML format) to merge into the Package
  • MergeInstructions: String - the file containing the GUID of each differenced item from the XML difference log returned by DoBaselineCompare()
  • ConnectString: String - not currently used
Project Class

EnumDiagramElements (string DiagramGUID)

protected abstract: String

Notes: Gets an XML list of all elements in a diagram.

Parameters:

  • DiagramGUID: String - the GUID (in XML format) of the diagram to get elements for

EnumDiagrams (string PackageGUID)

protected abstract: String

Notes: Gets an XML list of all diagrams in a specified Package.

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the Package to list diagrams for

EnumElements (string PackageGUID)

protected abstract: String

Notes: Gets an XML list of elements in a specified Package.

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the Package to get a list of elements for

EnumLinks (string ElementGUID)

protected abstract: String

Notes: Gets an XML list of connectors for a specified element.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element to get all associated connectors for

EnumPackages (string PackageGUID)

protected abstract: String

Notes: Gets an XML list of child Packages inside a parent Package.

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the parent Package

EnumProjects ()

protected abstract: String

Notes: Gets a list of projects in the current file; corresponds to Models in Repository.

Repository Class

EnumViewEx (string ProjectGUID)

protected abstract: String

Notes: Gets a list of Views in the current project.

Parameters:

  • ProjectGUID: String - the GUID (in XML format) of the project to get views for

EnumViews ()

protected abstract: String

Notes: Enumerates the Views for a project. Returned as an XML document.

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:

  • PackageGUID: String - the GUID (in XML format) of the Package to be exported
  • XMIType: EnumXMIType - specifies the XMI type and version information; see XMIType Enum for accepted values
  • DiagramXML: Long - True if XML for diagrams is required; accepted values:
         0 = Do not export diagrams
         1 = Export diagrams
         2 = Export diagrams along with alternative images
  • DiagramImage: Long - the format for diagram images to be created at the same time; accepted values:
         -1 = NONE
          0 = EMF
          1 = BMP
          2 = GIF
          3 = PNG
          4 = JPG
  • FormatXML: Long - True if XML output should be formatted prior to saving
  • UseDTD: Long - True if a DTD should be used
  • FileName: String - the filename to output to
XMIType

ExportPackageXMIEx (string PackageGUID, enumXMIType XMIType, long DiagramXML, long DiagramImage,
long FormatXML, long UseDTD, string FileName, ea.ExportPackageXMIFlag Flags)

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:

  • PackageGUID: String - the GUID (in XML format) of the Package to be exported
  • XMIType: EnumXMIType - specifies the XMI type and version information; see XMIType Enum for accepted values
  • DiagramXML: Long - true if XML for diagrams is required; accepted values:
         0 = Do not export diagrams
         1 = Export diagrams
         2 = Export diagrams along with alternative images
  • DiagramImage: Long - the format for diagram images to be created at the same time; accepted values:
         -1 =NONE
         0 =EMF
         1 =BMP
         2 =GIF
         3 =PNG
         4 =JPG
  • FormatXML: Long - True if XML output should be formatted prior to saving
  • UseDTD: Long - True if a DTD should be used.
  • FileName: String - the filename to output to
  • Flags: ea.ExportPackageXMIFlag - specify whether or not to include Package content below the first level (currently supported for xmiEADefault), whether or not to exclude tool-specific information from export
Configure Packages XMIType ExportPackageXMIFlag

ExportProjectXML (string DirectoryPath)

Boolean

Notes: Exports the entire current project to Native XML files in the specified directory. The contents of the directory will be deleted prior to exporting the project data

Parameters:

  • DirectoryPath: String - directory path to save the exported Native XML files

ExportReferenceData (string FileName, string Tables)

Boolean

Notes: Exports Reference Data.

Parameters:

  • FileName: String - the name of the file to output the reference data to
  • Tables: String - the list of reference data tables to be output; the data table delimeter is ";"
    If the string is empty, Enterprise Architect will prompt with a dialog to select the tables to output

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:

  • ElementGUID: String - the GUID (in XML format) of the element to generate
  • ExtraOptions: String - enables extra options to be given to the command (currently unused)

GenerateClass (string ElementGUID, string ExtraOptions)

Boolean

Notes: Generates the code for a single Class.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element to generate
  • ExtraOptions: String - enables extra options to be given to the command; currently unused

GenerateDiagramFromScenario (string ElementGUID, EnumScenarioDiagramType DiagramType, long OverwriteExistingDiagram)

Boolean

Notes: Generates various diagrams from the scenario specification of an element.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element containing the scenario specification
  • DiagramType: EnumScenarioDiagramType - the type of diagram to generate; see ScenarioDiagramType Enum for accepted values
  • OverwriteExistingDiagram: Long - determines whether to overwrite the existing diagram or synchronize the existing elements with the scenario steps
         0 = Delete the existing diagram and elements, and create a new diagram and elements
         1 = Synchronize existing elements with the scenario steps and preserve the diagram layout
         2 = Synchronize existing elements with the scenario steps and re-cast the diagram layout
         3 = Do not generate a diagram if one already exists
ScenarioDiagramType

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:

  • ElementGUID: String - the GUID (in XML format) of the element to generate
  • ExtraOptions: String - enables extra options to be given to the command (currently unused, pass an empty string to ensure current behavior in future versions)

GeneratePackage (string PackageGUID,
string ExtraOptions)

Boolean

Notes: Generates the code for all Classes within a Package.

For example:

     recurse=1;overwrite=1;dir=C:\

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the Package to generate code for
  • ExtraOptions: String - enables extra options to be given to the command; currently enables:
         -  Generation of all sub-Packages (recurse)
         -  Force overwrite of all files (overwrite) and
         -  Specification to auto generate all paths (dir)

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 scenario specification of an element.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element containing the scenario specification
  • TestType: EnumScenarioTestType - the type of test to generate; see ScenarioTestType Enum for accepted values
Generate Test Cases ScenarioTestType

GenerateWSDL(string WSDLComponentGUID, string Filename, string Encoding, string ExtraOptions)

Boolean

Notes: Generates WSDL for the specified WSDL stereotyped Component.

Parameters:

  • WSDLComponentGUID: String - the GUID (in XML format) of the WSDL stereotyped Component
  • Filename: String - the target file path
  • Encoding: String - the XML encoding for the code page instruction
  • ExtraOptions: String - enables extra options to be given to the command; currently unused
WSDL

GenerateXSD (string PackageGUID,
string FileName,
string Encoding,
string Options)

Boolean

Notes: Creates an XML schema for a Package, specified by its GUID. Returns True on success.

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the Package
  • FileName: String - the target filepath
  • Encoding: String - the XML encoding for the code page instruction
  • Options: String - enables extra options to be given to the command, in a comma-separated string; currently enables:
         -  GenGlobalElement - turn the generation of global elements for
            all global ComplexTypes On or Off; for example:
            GenGlobalElement=1
         -  UseRelativePath - turns on or off the option to use a relative
            path in the XSD import or XSD include statement when
            referencing external Package, provided the schemaLocation tag
            is empty on the referenced Packages; for example:
            UseRelativePath=1

GetAllDiagramImagesAndMap (string Directory)

Boolean

Notes : Saves the image and image-map for every diagram in the model, in the specified directory location.

The image files will be saved in PNG format and each will have the diagram GUID as the image name. The image-map files will be saved as .txt files and each will have the diagram GUID as the image map name.

The 'Auto Create Diagram Image and Image Map' option must be selected in the model options for this function to save the images and image-maps.

Parameters:

  • Directory – the location of the directory into which the images and image-maps are to be saved
Cloud Page

GetBaselines (string PackageGUID, string ConnectString)

String

Notes: Returns a list (in XML format) of Baselines associated with the supplied Package GUID.

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the Package to get Baselines for
  • ConnectString: String - not currently used

GetDiagram (string DiagramGUID)

protected abstract: String

Notes: Gets the diagram details, in XML format.

Parameters:

  • DiagramGUID: String - the GUID (in XML format) of the diagram to get details for

GetDiagramImageAndMap (string DiagramGUID, string Directory)

Boolean

Notes: Saves the image and image-map for the diagram with the specified GUID, in the specified directory location.

The image will be saved in PNG format and will have the DiagramGUID as the image name. The image-map will be saved as a .txt file and will have the DiagramGUID as the image-map name.

The 'Auto Create Diagram Image and Image Map' option must be selected in the model-specific options for this function to save the image and image-map.

Parameters:

  • DiagramGUID – the GUID of the diagram for which the image and image-map are to be saved
  • Directory – the directory into which the image and image-map are to be saved
Cloud Page

GetElement (string ElementGUID)

protected abstract: String

Notes: Gets XML for the specified element.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element to retrieve XML for

GetElementConstraints (string ElementGUID)

protected abstract: String

Notes: Gets constraints for an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetElementEffort (string ElementGUID)

protected abstract: String

Notes: Gets efforts for an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetElementFiles (string ElementGUID)

protected abstract: String

Notes: Gets metrics for an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetElementMetrics (string ElementGUID)

protected abstract: String

Notes: Gets files for an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetElementProblems (string ElementGUID)

protected abstract: String

Notes: Gets a list of issues (problems) associated with an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetElementProperties (string ElementGUID)

protected abstract: String

Notes: Gets Tagged Values for an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetElementRequirements (string ElementGUID)

protected abstract: String

Notes: Gets a list of requirements for an element, in XML format.

Parameters:

  • ElementGUID: String -the GUID (in XML format) of the element

GetElementResources (string ElementGUID)

protected abstract: String

Notes: Gets a list of resources for an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetElementRisks (string ElementGUID)

protected abstract: String

Notes: Gets a list of risks associated with an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetElementScenarios (string ElementGUID)

protected abstract: String

Notes: Gets a list of scenarios for an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetElementTests (string ElementGUID)

protected abstract: String

Notes: Gets a list of tests for an element, in XML format.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element

GetFileNameDialog (string Filename, string FilterString, long FilterIndex, long Flags, string InitialDirectory,
long OpenOrSave)

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:

  • Filename: String - default filename specified in the dialog
  • FilterString: String - delimited list of available file type filters
  • Filterindex: Long - one-based index of the filter to be used by default
  • Flags: Long - additional bit flags used to initialize the file dialog; see the OPENFILENAME structure in MSDN documentation for accepted values
  • InitialDirectory: String - directory path to open this dialog
  • OpenOrSave: Long - show dialog as an 'Open' or 'Save As' style dialog; accepted values: 0 = Open, 1 = Save As

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:

  • LinkGUID: String - the GUID (in XML format) of the connector to get details of

GUIDtoXML (string GUID)

String

Notes: Changes an internal GUID to the form used in XML.

Parameters:

  • GUID: String - the Enterprise Architect style GUID to convert to XML format

ImportDirectory (string PackageGUID, string Language, string DirectoryPath, string ExtraOptions)

Boolean

Notes: Imports a source code directory into the model.

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the Package to reverse engineer code into
  • Language: String - specifies the language of the code to be imported
  • DirectoryPath: String - specifies the path where the code is found on the computer
  • ExtraOptions: String - enables extra options to be given to the command; currently enables import of source from all child directories (recurse) - for example: recurse=1

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:

  • PackageGUID: String - the GUID (in XML format) of the Package to reverse engineer code into; this is expected to be a namespace root Package
  • Language: String - specifies the language of the code to be imported
    Use the value 'DNPE' to import a binary module; this imports a .NET assembly or Java .class file, but not a .jar file
  • Filename: String - specifies the path where the code or module is found on the computer
  • ExtraOptions: String - enables extra options to be given to the command; currently unused

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:

  • PackageGUID: String - the GUID (in XML format) of the target Package to import the XMI file into (or overwrite with the XMI file)
  • Filename or XMLText: String - the name of the XMI file; if the String is of type filename it is interpreted as a source file, otherwise the String is imported as XML text
  • ImportDiagrams: Long - 1 for importing diagrams and 0 to skip importing diagrams
  • StripGUID: Long
         -  1 to replace the element UniqueIDs on import; if stripped, then
            a copy of the Package could be imported into the same Enterprise
            Architect model as two different versions
         -  0 to retain the element UniqueIDs on import; a duplicate copy of
            the Package cannot be created in the same model of Enterprise
            Architect

ImportReferenceData (string FileName, string DataSets)

Boolean

Notes: Imports Reference Data.

Parameters:

  • FileName: String - the name of the reference data file to import from
  • DataSets: String - the list of reference data sets to import from; the data set delimeter is ";"
    If the string is empty, Enterprise Architect displays a dialog prompt to select the data sets to import

ImportVisualStudioSolution (string PackageGUID, string SolutionPath)

Boolean

Notes: Imports a Visual Studio Solution into the model.

Parameters:

  • PackageGUID: string - the GUID (in XML format) of the Package to reverse engineer the solution into
  • SolutionPath: string - specifies the path of the Visual Studio Solution file on the computer

LayoutDiagram (string DiagramGUID, long LayoutStyle)

Boolean

Notes: Deprecated. Use LayoutDiagramEx.

Calls the function to automatically layout a diagram in hierarchical fashion. It is only recommended for Class and Object diagrams.

Parameters:

  • DiagramGUID: String - the GUID (in XML format) of the diagram to lay out
  • LayoutStyle: Long - always ignored

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

  • Default Options:

        -  lsDiagramDefault

        -  lsProgramDefault

  • Cycle Removal Options:

        -  lsCycleRemoveGreedy

        -  lsCycleRemoveDFS

  • Layering Options:

        -  lsLayeringLongestPathSink

        -  lsLayeringLongestPathSource

        -  lsLayeringOptimalLinkLength

  • Initialize Options:

        -  IsInitializeNaive

        -  IsInitializeDFSOut

        -  IsInitializeDFSIn

  • Crossing Reduction Option:

        -  lsCrossReduceAggressive

  • Layout Options - Direction

        -  lsLayoutDirectionUp

        -  lsLayoutDirectionDown

        -  lsLayoutDirectionLeft

        -  lsLayoutDirectionRight

Parameters:

  • DiagramGUID: String - the GUID (in XML format) of the diagram to lay out
  • LayoutStyle: Long - the layout style
  • Iterations: Long - the number of layout iterations the Layout process should take to perform cross reduction (Default value = 4)
  • LayerSpacing: Long - the per-element layer spacing the Layout process should use (Default value = 20)
  • ColumnSpacing: Long - the per-element column spacing the Layout process should use (Default value = 20)
  • SaveToDiagram: Boolean - specifies whether or not Enterprise Architect should save the supplied layout options as default to the diagram in question
ConstLayoutStyles

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:

  • PackageGUID: String - the GUID (in XML format) of the Package to load

LoadDiagram (string DiagramGUID)

protected abstract: Boolean

Notes: Loads a diagram by its GUID.

Parameter:

  • DiagramGUID: String - the GUID (in XML format) of the diagram to load; if you retrieve the GUID using the Diagram interface, use the GUIDtoXML function to convert it to XML format
Project Class

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:

  • FileName: String - the name of the project file to load

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:

  • GUID: String - the GUID of the Package or element for which the contents are to be migrated
  • SourceType: String - the type of model to be upgraded; accepted values:
         -  BPMN
         -  BPMN1.1
         -  UPDM
         -  SysML1.1
         -  SysML1.2
         -  SysML1.3
         -  ArchiMate
         -  ArchiMate2
         -  UPDM2
  • DestinationType: String - the type of model to upgrade to; accepted values:
         -  BPMN1.1
         -  BPMN1.1::BPEL
         -  BPMN2.0
         -  UPDM2
         -  SysML1.2
         -  SysML1.3
         -  SysML1.4
         -  ArchiMate2
         -  ArchiMate3
         -  UAF

MigrateToBPMN11 (string GUID,
string Type)

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

  • GUID: String - the GUID of the Package or element for which the contents are to be migrated to BPMN 1.1
  • Type: String - the type of upgrade, either just to BPMN 1.1 or to BPMN 1.1 and BPEL. Accepted values are:
    -    BPMN = migrate to BPMN 1.1
    -    BPEL = migrate to BPMN 1.1 and update:
          -  any diagram with stereotype BPMN to BPEL
          -  any element with stereotype BusinessProcess to BPELProcess

Migrating to BPEL is possible in the Ultimate and Unified Editions of Enterprise Architect.

ProjectTransfer (string SourceFilePath,
string TargetFilePath,
string LogFilePath)

Boolean

Notes: Transfers the project from a source .eap file or DBMS to a target .eap file, .eapx file, .feap file, .qea file or .qeax file.

Parameters:

  • SourceFilePath: String - the path of the source file to transfer
  • TargetFilePath: String - the path of the target file, including the file type extension; Enterprise Architect creates a new Base project in this location (using the TargetFilePath as its name) and then transfers the content of the source project into that file
  • LogFilePath: String - the path of the log file where the status of the transfer process is updated

In automation, the target file must not previously exist. Enterprise Architect creates a new, empty Base.* file using the specified target name and extension, and transfers the source project into it.

PublishResult (string CategoryID,
EA.EnumMVErrorType ErrorType,
string ErrorMessage)

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:

  • CategoryId: String - should be passed the return value from the DefineRuleCategory method
  • ErrorType: EA.EnumMVErrorType - depending on the severity of the error being validated, can be:
         -  mvErrorCritical
         -  mvError
         -  mvWarning, or
         -  mvInformation
  • ErrorMessage: String - contains an error string
EA_OnInitializeUserRules Model Validation Example Project Class

PutDiagramImageOnClipboard (string DiagramGUID,
long Type)

protected abstract: Boolean

Notes: Copies an image of the specified diagram to the clipboard.

Parameters:

  • DiagramGUID: String - the GUID (in XML format) of the diagram to copy
  • Type: Long - the file type
         -  If Type = 0 then it is a metafile
         -  If Type = 1 then it is a Device Independent Bitmap

PutDiagramImageToFile (string Diagram GUID,
string FileName,
long Type)

protected abstract: Boolean

Notes: Saves an image of the specified diagram to file.

Parameters:

  • DiagramGUID: String - the GUID (in XML format) of the diagram to save
  • FileName: String - the name of the file to save the diagram into
  • Type: Long - the file type
         -  If type = 0 then it is a metafile
         -  If type = 1 then it uses the file type from the name extension
            (that is, .bmp, .jpg, .gif, .png, .tga)

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).

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:

  • ElementGUID: String - the GUID (in XML format) of the element to generate
  • ExtraOptions: String - enables extra options to be given to the command (currently unused)

RunModelSearch (string Search, string SearchTerm, bool ShowInEA)

Void

Notes: Invokes the Model Search component.

Parameters:

  • Search: String - the name of an Enterprise Architect defined search
  • SearchTerm: String - the term to search for in the project
  • ShowInEA: Boolean - execute the search and output in the Model Search window
Model Search Repository Class

RunReport (string PackageGUID,
string TemplateName,
string Filename)

protected abstract: Void

Notes: Runs a named document report.

Parameters:

  • PackageGUID: String - the GUID of the Package or master document to run the report on
  • TemplateName: String - the document report template to use; if the PackageGUID has a stereotype of MasterDocument, the template is not required
  • FileName: String - the file name and path to store the generated report; the file extension specified will determine the format of the generated document - for example, RTF, PDF
Document Generator Interface Package Generate Documentation Virtual Documents

RunHTMLReport (string PackageGUID,
string ExportPath,
string ImageFormat,
string Style,
string Extension)

String

Notes: Runs an HTML report (as for 'Documentation | Publish as HTML' when you click on a Package in the Browser window and on the Hamburger arrow. icon).

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the Package or master document to run the report on
  • ExportPath: String - the directory path to store the generated report files
  • ImageFormat: String - file format in which to store images - .png or .gif
  • Style: String - name of the web style template to apply; use <default> for the standard, system-provided template
  • Extension: String - file extension for generated HTML files (example: .htm)
Create an HTML Report Model Documents and Report Packages

SaveControlledPackage (string PackageGUID)

String

Notes: Saves a Package that has been configured as a controlled Package, to Native/XMI format. Only the Package GUID is required, Enterprise Architect picks the rest up from the Package control information.

Parameter:

  • PackageGUID: String - the GUID (in XML format) of the Package to save

SaveDiagramImageToFile (string Filename)

protected abstract: String

Notes: Saves a diagram image of the current diagram to file.

Parameters:

  • FileName: String - the filename of the image to save

ShowWindow (long Show)

protected abstract: Void

Notes: Shows or hides the Enterprise Architect User Interface.

Parameters:

  • Show: Long

SynchronizeClass (string ElementGUID,
string ExtraOptions)

Boolean

Notes: Synchronizes a Class with the latest source code.

Parameters:

  • ElementGUID: String - the GUID (in XML format) of the element to update from code
  • ExtraOptions: String - enables extra options to be given to the command; currently unused

SynchronizePackage (string PackageGUID,
string ExtraOptions)

Boolean

Notes: Synchronizes each Class in a Package with the latest source code.

Parameters:

  • PackageGUID: String - the GUID (in XML format) of the Package containing the elements to update from code
  • ExtraOptions: String - enables extra options to be given to the command; currently enables synchronization of all child Packages (children) - for example: children=1

TransformElement (string TransformName,
string ElementGUID,
string TargetPackage,
string ExtraOptions)

Boolean

Notes: Transforms an element into a Package.

Parameters:

  • TransformName: String - specifies the transformation that should be executed
  • ElementGUID: String - the GUID (in XML format) of the element to transform
  • TargetPackageGUID: String - the GUID (in XML format) of the Package to transform into
  • ExtraOptions: String - enables extra options to be given to the command:
         -  GenCode=True / False - articulate code generation from the
            transformed elements; this option supercedes the current
            model setting

TransformPackage (string TransformName,
string SourcePackage,
string TargetPackage,
string ExtraOptions)

Boolean

Notes: Runs a transformation on the contents of a Package.

Parameters:

  • TransformName: String - specifies the transformation that should be executed
  • SourcePackageGUID: String - the GUID (in XML format) of the Package to transform
  • TargetPackageGUID: String - the GUID (in XML format) of the Package to transform into
  • ExtraOptions: String - enables extra options to be given to the command:
         -  GenCode=True/False - articulate code generation from the transformed elements;
            this option supercedes the current model setting
         -  SubPackages=True/False - specify if the child Packages are to be included whilst
            transforming a Package

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 > Application > Design > 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:

  • DiagramGUID: String - the GUID of the Diagram Class object
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 > Application > Design > 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:

  • ElementGUID: String - the GUID of the Element Class object

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 > Application > Design > 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:

  • PackageGUID: String - the GUID of the Package Class object

XMLtoGUID (string GUID)

String

Notes: Changes a GUID in XML format to the form used inside Enterprise Architect.

Parameters:

  • GUID: String - the XML style GUID to convert to Enterprise Architect internal format