Home
SDK for Enterprise Architect
Contents
1. 2 For each required user defined report template available in the current model select the checkbox next to the template name 3 Click on the Next button to proceed 2 1 12 Add Linked Document Templates When creating an MDG Technology file you can include Linked Document templates To use the Linked Document templates section of the MDG Technology Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 307 topic up to and including Step 6 33 where you select the Linked Document Templates checkbox The MDG Technology Wizard Linked Document Templates dialog displays 1998 2010 Sparx Systems Pty Ltd 46 MDG Technologies in SDK Create MDG Technologies MDG Technology Wizard Linked Document Templates Select the linked document templates to be included in this technology Code Engineering 2 For each required document template available in the current model select the checkbox next to the template name 3 Click on the Next button to proceed 2 2 Working with MTS Files An MDG Technology Selection MTS file stores the selected options that you define when creating an MDG Technology File using the MDG Technology Wizard If you use a MTS file you can edit it to change the features selected when you generated the file and to add or remove the advanced features described in this topic Create a MTS File To crea
2. CTC CET CTN Po mm data and user interface status information Return Value See Details above 6 7 1 6 MDGMerge 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 Also look at MDG _Connectl17h MDG PreMergel17h and MDG PostMerge 76 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 CC CN 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 ExportObject Variant OUT The string array containing the list of new model objects in s Object ID format to be exported by Enterprise Archit
3. public void RunDiagramRule EA Repository Repository string sRulelD long IDiagramID EA Diagram Diagram Repository GetDiagramByID int lDiagramID if Diagram null switch LookupMapEx sRulelD case cRule03 TODO perform rule 3 check break TODO add more cases public void RunElementRule EA Repository Repository string sRulelD EA Element Element if Element null switch LookupMapEx sRulelD case cRule01 DoRule01 Repository Element break TODO add more cases private void DoRule01 EA Repository Repository EA Element Element if Element Stereotype myStereotype return TODO validation logic here report validation errors EA Project Project Repository GetProjectintertace Project PublishResult LookupMap cRule01 EA EnumMVErrorType mvError GetRuleStr cRule01 6 5 16 EA_OnRetrieveModelTemplate Details EA_OnRetrieveModelTemplate requests that an Add In pass a model template to Enterprise Architect Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 169 This event occurs when a user executes the Add a New Model Using Wizard command to add a model that has been defined by an MDG Technology See the Incorporate Model Templates in a Technology 59 topic for details of how to define such model templates Syntax Function EA_OnRetrieveModelTemplate Reposito
4. ChangeEvent ChangeExpression The change expression of the ChangeEvent Classifier HasBehaviors A check on whether the Classifier has behavioral models Activity and Interaction The Classifier s language StateMachine The State Machine of the Classifier Condition Construct Edge The ID of the node from which the Edge arises The ID of the node at which the Edge is targeted EventObject EventKind The event kind of the Event Object Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 115 Instance The classifier of the Instance The value of the Instance Parameter Primitive CC ATT PropertyObject O 1998 2010 Sparx Systems Pty Ltd 116 Code Template Framework in SDK Code Template Syntax SignalEvent The signal of the SignalEvent State StateMachine TimeEvent The when property of the TimeEvent Transition HasEffect A check on whether the transition has a valid effect A check on whether the transition is a derived transition A check on whether the transition transcends from one State Machine Submachine state to another Trigger AsynchDestinationState The asynchronous destination state of the Trigger if it is an asynchronous trigger DependentProperty The ID of the property associated with the Trigger Enterprise Architect Software De
5. ENTERPRISE ARCHITECT Software Developers Kit Enterprise Architect is an intuitive flexible and powerful UML analysis and design tool for building robust and maintainable software This booklet describes the facilities of the Software Developers Kit which enables you to customize and extend the facilities of Enterprise Architect SP MX SYSTEMS Copyright O 1998 2010 Sparx Systems Pty Ltd Enterprise Architect Software Developers Kit O 1998 2010 Sparx Systems Pty Ltd All rights reserved No parts of this work may be reproduced in any form or by any means graphic electronic or mechanical including photocopying recording taping or information storage and retrieval systems without the written permission of the publisher Products that are referred to in this document may be either trademarks and or registered trademarks of the respective owners The publisher and the author make no claim to these trademarks While every precaution has been taken in the preparation of this document the publisher and the author assume no responsibility for errors or omissions or for damages resulting from the use of information contained in this document or from the use of programs and source code that may accompany it In no event shall the publisher and the author be liable for any loss of profit or any other commercial damage caused or alleged to have been caused directly or indirectly by this document Printed May 2010 S
6. An MTS file stores the selected options that you define during the creation of an MDG Technology File If you use an MTS file you can later modify it to add or remove specific items in the MDG Technology File This is the recommended process 1998 2010 Sparx Systems Pty Ltd 32 MDG Technologies in SDK Create MDG Technologies 3 Select the appropriate MTS file option Click on the Next button If you selected an MTS file the MDG Technology Wizard prompts you to save the changes in the existing MTS file or into a new MTS file This enables you to create a modification based on the existing MTS file while preserving the original file MDG Technology Wizard Save MTS file You can save your changes in the MTS file that you opened or enterthe name and path of a new MTS file Name and path of MTS to save Dev Roy MY_MTS mts 4 If necessary type in or browse for the required file path and name Click on the Next button The MDG Technology Wizard Create screen displays MDG Technology Wizard Create Please specify the technology to be created Technology MDG Technology For Workflows 2oy UML Profiles WKFL MDG Technology For Workflows xml WKFL Version 0 1 Y Dev Help Source EA Next Help_Graphics uml_profiles bn YADev Help Source EA Next Help_Graphics Banner1 BMP ama Support pine to generate and collate project development workflows Enterprise Architect Software Developers Ki
7. Parameters e ElementGUID String the GUID in XML format of the element Gets a list of resources for an element in XML format Parameters e ElementGUID String the GUID in XML format of the element Gets a list of risks associated with an element in XML format Parameters e ElementGUID String the GUID in XML format of the element Gets a list of scenarios for an element in XML format Parameters e ElementGUID String the GUID in XML format of the element Gets a list of tests for an element in XML format Parameters e ElementGUID String the GUID in XML format of the element Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Gets connector details in XML format Parameters e LinkGUID String the GUID in XML format of the connector to get details of Changes an internal GUID to the form used in XML Parameters e GUID String the Enterprise Architect style GUID to convert to XML format Imports a source code directory into the model Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 279 PackageGUID string Language string DirectoryPath string ExtraOptions ImportFile string PackageGUID string Language string FileName string ExtraOptions ImportPackageXMI strin
8. Iterate Through Automation Interface Code Example 284 EASL Behavioral Model Templates 109 Code Generation Macros Behavioral Model 109 Enterprise Architect Simulation Library 109 EASL Collections Action 111 Behavior 111 Classifier 111 Construct 111 Node 111 State 111 State Machine 111 Transition 111 Trigger 111 Vertex 111 EASL Properties Action 113 Argument 113 Behavior 113 Call Event 113 ChangeEvent 113 Classifier 113 Condition 113 Construct 113 Edge 113 EventObject 113 Instance 113 Parameter 113 Primitive 113 PropertyObject 113 SignalEvent 113 State 113 StateMachine 113 TimeEvent 113 Transition 113 Trigger 113 Vertex 113 EASL_GET Code Generation Macro Behavioral Model 109 EASLList Code Generation Macro Behavioral Model 109 Effort Attributes 227 Automation Interface Element Package 227 Methods 227 Element Add And Manage Automation Interface Code Example 286 Add To Profile 6 Automation Interface Element Package 228 Icon Project Browser User Defined 19 Shape Script Properties 72 Use Extras Automation Interface Code Example 288 Element Package Automation Interface Constraint 227 Diagram 225 Effort 227 Element 228 File 235 Issue 235 Metric 236 Requirement 237 Resource 238 Risk 239 Scenario 239 ScenarioExtension 240 ScenarioStep 241 TaggedValue 242 Test 243 Element Templates And Profiles 3 ElementFeatures Package Automation Interface Attribute 244
9. ShapeScript ShapeDeclaration ShapeType ShapeName ReservedShapeName lt lnitialisationAttributeAssignment gt lt DrawingStatement gt lt SubShape gt ShapeBody InitialisationAttributeAssign lt Attribute gt lt Value gt ment See Shape Attributes 66 for full listing of attribute names lt IfElseSection gt lt Method gt if lt QueryExpression gt lt TrueSection gt lt ElseSection gt QueryName See Query Methods 724 for a full listing of Query names TrueSection gt lt DrawingStatement gt ElseSection im else lt DrawingStatement gt Metodo ja lt MethodName gt lt ParameterList gt MethodName fi See Drawing Methods 68 for a full listing of method names 3 3 2 Shape Attributes syntax attribute value DrawingStatement IfElseSection QueryExpression example shape main Mnitialisation attributes must be before drawing commands noshadow true h_align center drawing commands rectangle 0 0 100 100 printin foo bar bottomAnchorOffse int int When creating a Shape Script for an embedded element such as a Port use this attribute to offset the shape from the bottom edge of its parent For example bottomAnchorOffset 0 10 move embedded element up 10 pixels from the bottom edge Enterprise Architect Software Developers Kit Shape Scripts Write Scripts 6
10. _instanceType Used for defining behavior on creating an instance _lineStyle Sets the line style of a connector The value of the attribute can be one of _metatype Used for defining stereotypes as metatypes 217 direct auto custom bezier treeH horizontal treeV vertical treeLH lateral horizontal treeLV lateral vertical O 1998 2010 Sparx Systems Pty Ltd 20 Developing Profiles Create Profiles Initial height of the element in pixels at 100 zoom Initial width of the element in pixels at 100 zoom _strictness Used for restricting application of multiple stereotypes Pat Supported Metatype Attributes in UML Profiles The following attributes can be applied to metatype Classes in UML Profiles and refer to the stereotypes that extend them Atina If set to 1 switches on the Inherited Features Show Attributes setting _AUPkg If set to 1 switches on the Attribute Visibility Package setting If set to 1 switches on the Attribute Visibility Private setting If set to 1 switches on the Attribute Visibility Protected setting If set to 1 switches on the Attribute Visibility Public setting _Coninh If set to 1 switches on the Show Element Compartments Inherited Constraints _Constraint If set to 1 switches on the Show Element Compartments Constraints setting U oO 5 o _DefaultDiagramType Used for defining child diagram types 23 _HideStype If set
11. A merge consists of three major operations e Export Where newly created model objects are exported into code and made available to the code project e Import Where newly created code objects Classes and such things are imported into the model e 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 Synchronize Type The Synchronize operation can take place in one of four different ways Each of these ways corresponds to a value returned by SynchType e None SynchType 0 No synchronization is to be performed e Forward SynchType 1 Forward synchronization between the model branch and the code project is to occur e Reverse SynchType 2 Reverse synchronization between the code project and the model branch is to occur e Both SynchType 3 Reverse then Forward synchronization s are to occur Object ID Format Each of the Object IDs listed in the string arrays described above should be composed in the following format namespace class attribute operation property 6 7 1 7 MDGNewClass Details MDG_NewClass enables the Add In to alter details of a Class before it is created This method is called when Enterprise Architect generates a new Class and requires information relating to assigning the language and file path The file path should be passed back as a return value and the language should be passed b
12. Details MDG_PostMerge is called after a merge process has been completed This function is called by Enterprise Architect after the merge process has been completed Enterprise Architect Software Developers Kit Enterprise Architect Add In Model MDG Add Ins 177 Note File save checking should not be performed with this function but should be handled by MDG_PreGenerate 17A MDG PostGeneratel176 and MDG_PreReversel17 Also look at MDG_PreMergel17 and MDG Mergel17 4 Syntax Function MDG_PostMerge Repository As EA Repository PackageGuid As String As Long The MDG_PostMerge function syntax contains the following elements pme e CC Repository EA An EA Repository object representing the currently open Bgpository Enterprise Architect model Poll its members to retrieve model data and user interface status information ean String The GUID identifying the Enterprise Architect package sub tree that is controlled by the Add In Return Value Return a zero value if the post merge process has failed a non zero return indicates that the post merge has been successful Enterprise Architect assumes a non zero return if this method is not implemented 6 7 1 10 MDGPreGenerate Details MDG_PreGenerate enables the Add In to deal with unsaved changes This function is called immediately before Enterprise Architect attempts to generate files from the model A possible use of this function would be to prompt
13. End Sub 1998 2010 Sparx Systems Pty Ltd 288 Enterprise Architect Object Model Reference 7 2 10 7 Add and Delete Features public Object Dim element as object Dim idx as integer Dim attribute as object Dim method as object just load an element by ID you must substitute a valid ID from your model element m_Repository GetElementByID 246 create a new method method element Methods AddNew newMethod int method Update element Methods Refresh now loop through methods for Element and delete our addition For idx 0 to element Methods Count 1 method element Methods GetAt idx Console Writeline method Name If method Name newMethod Then element Methods Delete idx End if Next create an attribute attribute element attributes AddNew NewAttribute int attribute Update element attributes Refresh loop through and delete our new attribute For idx 0 to element attributes Count 1 attribute element attributes GetAt idx Console Writeline attribute Name If attribute Name NewAttribute Then element attributes Delete idx End If Next 7 2 10 8 Element Extras public Object Examples of how to access and use element extras such as scenarios constraints and requirements Sub ElementExtras Dim element as object Dim o as object Dim idx as Integer Dim bDel as boolean bDel true try element m_Repository GetElementByID
14. Function macros can take parameters which can be passed to the macros as e String literals enclosed within double quotation marks e Direct substitution macros without the enclosing percent signs e Variable references e Numeric literals Multiple parameters are passed using a comma separated list The available function macros are described below Parameters are denoted by angle brackets as in FUNCTION_NAME lt param gt Note Function macros are named according to the All Caps style as in CONVERT_SCOPE opScope 1998 2010 Sparx Systems Pty Ltd 104 Code Template Framework in SDK Code Template Syntax CONVERT_SCOPE lt umlScope gt For use with supported languages Converts lt um Scope gt to the appropriate scope keyword for the language being generated The following table shows the conversion of lt um Scope gt with respect to the given language Cee CCOO CT CC CT ECON IESO ECU STC EA COLLECTION_CLASS lt language gt Gives the appropriate collection Class for the language specified for the current linked attribute CSTYLE_COMMENT lt wrap_length gt Converts the notes for the element currently in scope to plain C style comments using and DELPHI_PROPERTIES lt scope gt lt separator gt lt indent gt Generates a Delphi property DELPHI_COMMENT lt wrap_lengih gt Converts the notes for the element currently in scope to Delphi comments EXEC_ADD_IN lt addin_name
15. GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Updates the current Author object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 4 3 Client public Class A Client represents one or more people or organizations related to the project Accessed using the Repository Clients collection Associated table in EAP file t_clients Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 211 Client Attributes Atribute Type motes OOOO CON CN ETT CON CN TT CON CN CTC CEI Read Write Notes about client ObjectType ObjectType Read only Distinguishes objects referenced through the Dispatch ms interface prona CI ETT poe erme EN Client Methods ees fo ke OOOO O Ol GetLastError String Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs information Update Boolean Updates the current Client object after modification or appending a new item If false is returned check the GetLastError function for more 7 2 4 4 Collection public Class This is the main collection Class used by all elemen
16. Read Write The position of the Step in the Scenario Step list Results String Read Write Any results that are given from this step String Read Write A description of the state the system enters when this Step is executed stepGuID string Read Write A unique GUID for this Step StepType ScenarioStepT Read Write Identifies whether this step is being performed by a user or ype 195 the system uses sing Read Write Input and requirements that are relevant to this step ScenarioStep Methods GetLastError Returns a string value describing the most recent error that occurred in 0 relation to this object This function is rarely used as an exception is thrown when an error occurs O 1998 2010 Sparx Systems Pty Ltd 242 Enterprise Architect Object Model Reference memos ire oes Update Boolean Update the current ScenarioStep object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 5 13 TaggedValue public Class A TaggedValue is a named property and value associated with an element It is accessed through the Tagged Values collection Associated table in EAP file t_objectproperties TaggedValue Attributes Atributo Type Notes ElementiD Long Read Write The local ID of the associated element Name String Read Write Name of the tag String Read Write Further descriptive notes about this tag I
17. button in the Code Options column for that module This enables you to select an XML document that provides additional settings for the language that are not covered by the data types or code templates The root node of the XML document should be CodeOptions The child nodes should be called CodeOption and should contain a name attribute The supported code options are as follows ConstructorName The name of a function used as a constructor Used by the classHasConstructor 90 code template macro CopyConstructorName The name of a function used as a copy constructor Used by the classHasCopyConstructor 9 code template macro DefaultExtension The default extension when generating code DefaultSourceDirectory The default path to which Enterprise Architect generates new files DestructorName The name of a function used as a destructor Used by the classHasDestructor 90 code template macro The external editor used for editing source of this language ImplementationExtensio The extension used by Enterprise Architect to generate an implementation O 1998 2010 Sparx Systems Pty Ltd 42 MDG Technologies in SDK Create MDG Technologies COM CN ImplementationPath The relative path from the source file to generate the implementation file PackagePathSeparator The delimiter used to separate package names when using the packagePath macro from the code templates An example of a valid code options file is shown b
18. lt wrap_length gt must still be passed as a string even though WRAP_COMMENT treats this parameter as an integer WRAP_LINES lt text gt lt wrap_length gt lt start_string gt lt end_string Wraps lt text gt as designated to be lt wrap_length gt adding lt start_string gt to the beginning of every line and lt end_string gt to the end of the line if it is specified XML_COMMENT lt wrap_lengih gt Converts the notes for the element currently in scope to XML style comments 5 1 2 5 Control Macros Control macros are used to control the processing and formatting of the templates The basic types of control macro include e The list macro for generating multiple element features such as attributes and operations e The branching macros which form if then else constructs to conditionally execute parts of a template e The PI macro which takes effect from the next non empty line e API function macro 1037 that enables setting Pl to a variable and adds the ability to set the PI that is generated before the next line e The Pl macro for formatting new lines in the output e The synchronization macros In general control macros are named according to Camel casing List The list macro is used to generate multiple elements The basic structure is list lt TemplateName gt separator lt string gt indent lt string gt lt conditions gt where lt string gt is a double quoted literal string and lt TemplateName gt can
19. to be performed on each connector in the selection being validated If you don t want to perform the rule defined by RulelD on the given connector then simply return without performing any action On performing any validation if a validation error is found use the Repository ProjectInterface PublishResult method to notify Enterprise Architect Syntax Sub EA_OnRunConnectorRule Repository As EA Repository RulelD As String ConnectorID As Long The EA_OnRunConnectorRule function syntax contains the following elements CC o U oO e Long The ID of the connector to potentially perform validation on Use the Repository GetConnectorByID method to retrieve the connector object Repository EA An EA Repository object representing the currently open Repository Enterprise Architect model Poll its members to retrieve model data and user interface status information a O The ID that was passed into the Project DefineRule command 6 5 15 8 EA_OnRunAttributeRule Details This event is triggered once for each rule defined in EA_OniInitializeUserRules 16h to be performed on each attribute in the selection being validated If you don t want to perform the rule defined by RulelD on the given attribute then simply return without performing any action On performing any validation if a validation error is found use the Repository ProjectInterface PublishResult method to notify Enterprise Architect Syntax Sub EA_OnRunAttributeRule Reposi
20. 19 Read Write The risk type associated with this element Weight Long Read Write A weighting for estimation or metric purposes Risk Methods Returns a string value describing the most recent error that occurred in 0 relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Risk object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 5 10 Scenario public Class A Scenario corresponds to a Collaboration or Use Case instance Each Scenario is a path of execution through the logic of a Use Case Scenarios can be added to using the Element Scenarios collection Associated table in EAP file t_objectscenarios Scenario Attributes Atribute Type motes Name Sting Read Write The Scenario name String Read Write Description of the Scenario Usually contains the steps to execute the scenario ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface ScenarioGUID String Read Write A unique ID for the Scenario Used to identify the Scenario unambiguously within a model Collection of Read only A collection of step objects for this Scenario Use the AddNew ScenarioStep 214 and Delete functions to manage steps AddNew passes the step O 1998 2010 Sparx Systems Pty Ltd 240 Enterprise Architect Object Model
21. AA Pape tote O T GetTreeSelectedltem object ObjectTyp Selectedltem GetTreeSelectedltemType ObjectTyp e 19 1 GetTreeSelectedObject 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 e Selectedltem Object the object to get the variable and type for Returns the type of the object currently selected in the tree One of otDiagram otElement otPackage otAttribute otMethod The related method GetTreeSelectedlitem 206 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 Package Returns the package in which the currently selected tree 2157 view object is contained HasPerspective string String Deprecated no longer in use Perspective ImportPackageBuildScripts string PackageGuid string BuildScriptXML ImportTechnology string Boolean Technology IsTabOpen string TabName Imports build scripts into a package in Enterprise Architect Parameters e PackageGuid String the GUID of the package into which to import the build scripts BuildScriptXM
22. NE E SE S SW W NW CENTER int yOffset xOffset and yOffset are in pixels not percentage values and can be negative setpen Sets the pen to the defined color and optionally sets the pen width int red int green Note int blue int penwidth This method is only for line drawing commands It does not affect any text commands setpencolor Sets the pen color int red int green int blue You can specify the required color by defining RGB values or using a color value returned by any of the Color Queries 727 for example GetUserFillColor setpencolor E Color newColor Note This method is only for line drawing commands It does not affect any text commands setpenwidth Sets the width of the pen Pen width should be between 1 and 5 int penwidth Note This method is only for line drawing commands It does not affect any text commands showlabel Reveals the hidden label specified by labelname string labelname startcloudpath Similar to StartPath except that it draws the path with cloud like curved puffWidth segments puffs puffHeight Parameters noise arameters 1998 2010 Sparx Systems Pty Ltd 72 Shape Scripts Write Scripts e float puffWidth default 30 the horizontal distance between puffs e float puffHeight default 15 the vertical distance between puffs e float noise default 1 0 the randomization of the puffs positions startpath Starts th
23. Reference jatribute tye motes O ee a name and 1 as the type for an actor step Read Write The scenario type for example Basic Path Long Read Write Currently used to position scenarios in the scenario list that is List Position XMLConient String Read Write A structured field that can contain scenario details in XML format It is recommended that you use the Steps 23 collection to read or modify this field Scenario Methods Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Scenario object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 5 11 ScenarioExtension ScenarioExtension Attributes jatribute type notes O ExtensionGUI Read Write A unique GUID for this Extension D Join String Read Write The GUID of the step where this Extension rejoins the Scenario JoiningStep ScenarioSte Read only The actual step where this Extension rejoins the Scenario if 24h any Level String Read only The number of this Extension as shown in the scenario editor This is derived from the value of Pos for this object and the owning step String Read Write The Extension name Note This should match the name of the linked scenario ObjectType ObjectType Read only Disti
24. This event occurs after a user has dragged a new element from the Enterprise Architect UML Toolbox or Resources window onto a diagram The notification is provided immediately after the element is added to the model Set Repository SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs Also look at EA _OnPreNewElement 14h Syntax Function EA_OnPostNewElement Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPostNewElement function syntax contains the following elements CC CC Contains the following EventProperty objects for the new ventProperties element 21 e ElementID A long value corresponding to Element ElementID Repository EA Repository 1971 An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True if the element has been updated during this notification Return False otherwise 6 5 9 2 EA_OnPostNewConnector Details EA_OnPostNewConnector notifies Add Ins that a new connector has been created on a diagram lt enables Add Ins to modify the connector upon creation This event occurs after a user has dragged a new connector from the Enterprise Architect UML Toolbox or Resources window onto a diagram The notification is provided immediately after the connector is added to the model Set Repository SuppressEADialogs to
25. and locate the required emf or wmf file 5 Enter optional Notes and select Default Colors for this stereotype 6 Click on the Save button to save the stereotype The table below describes the functionality of the Stereotypes tab Stereotype Specify the name of the stereotype Group name Enable grouping of stereotype features by a plural name for attributes and operations which is shown on diagrams in the attribute and operations compartments Base Class Enable the stereotyped element to inherit the base characteristics from a pre existing element type me Type any notes concerning the stereotype not the elements to which the stereotype is to be applied Overa None emne me deta olmo amean Meiate Ename an image fie to be usod for the appearance ole siereoype Shape Script Specify custom shapes for the stereotype using the Enterprise Architect Shape Enterprise Architect Software Developers Kit Developing Profiles Custom Stereotypes 5 Po Scripting language For more information see the Shape Scriptingl 61 topic Assign Add the associated metafile or Shape Script from the stereotyped element Remove the associated metafile or Shape Script from the stereotyped element Bawo OOS yyy CO UT CO secovpotom SSCS Reset Reset he appearance oo element the dela lemon appearance Note You can transport these custom stereotype definitions between models using the Export Reference Data a
26. rsGeneralizeStart List of elements that the current element generalizes List of all parent elements of the current element Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 193 rsRealizeEnd List of elements that are realized by the current element rsRealizeStart List of elements that the current element realizes 7 2 3 6 ExportPackageXMIFlag Enum The ExportPackageXMIFlag enumeration is used in package control when exporting to XMI epSaveToStub Export this package with only immediate children Child packages are included as stubs only 7 2 3 7 MDGMenus Enum Use this enumeration when providing the HiddenMenus property to MDG_GetProperty These options are exclusive of one another and can be read or added to hide more than one menu See the MDG_GetProperty 173 topic for an example of use mgBuildProject Hide Build Project menu option Hide Merge menu option Hide Run menu option 7 2 3 8 ObjectType Enum The ObjectType enumeration identifies Enterprise Architect object types even when referenced through a Dispatch interface For example Object ob Repository GetElementByID 13 if ob ObjectType otElement else if ob ObjectType otAuthor All of the following are valid enumeration values otNone otClient otProject otAuthor otRepository otDatatype otCollection otStereotype otElement otTaskotTerm otPackage otProjectlssues otM
27. sReturn second End If If m_ThirdCompartmentVisible True Then sReturn sReturn third End If If Len sReturn gt 0 Then sReturn Left sReturn Len sReturn 1 End If EA_QueryAvailableCompartments sReturn Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 159 End Function 6 5 14 2 EA_GetCompartmentData Details This event occurs when Enterprise Architect is instructed to redraw an element It requests that the Add In provide the data to populate the element s compartment Syntax Function EA_GetCompartmentData Repository As EA Repository sCompartment As String sGUID As String oType As EA ObjectType As Variant The EA_QueryAvailableCompartments function syntax contains the following elements Ponce te presionaron O i ObjectType The type of the element for which data is being requested Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information sCompartment String IN The name of the compartment for which data is being requested sun sing wm The GUID of the element for which data is being requested Return Value Variant containing a formatted string See the example below to understand the format Example Function EA_GetCompartmentData Repository As EA Repository sSCompartment As St
28. you do not have to subscribe to a type library Note From Enterprise Architect release 7 0 Add Ins created before 2004 are no longer supported If an Add In subscribes to the Addn_Tmpl tib interface 2003 style it will fail on load In this event contact the vendor or author of the Add In and request an upgrade e Add Ins do not have to implement methods that they never use e Add Ins prompt users via context menus in the tree view and the diagram e Menu check and disable states can be controlled by the Add In Add Ins enhance the existing functionality of Enterprise Architect through a variety of mechanisms such as Scripts see Using Enterprise Architect UML Modeling Tool UML Profiles 3 and the Automation Interface lish Once an Add In is registered see Getting Started With Enterprise Architect it can be managed using the Add In Manager 128 Create and Use Add ins This topic covers the following information on Add Ins e Add In Tasks 124 e Add In Events 128 e Broadcast Events 13 e Custom Views 163 e MDG Add Ins 170 1998 2010 Sparx Systems Pty Ltd 124 Enterprise Architect Add In Model Add In Tasks 6 1 Add In Tasks This topic provides instructions on how to create test deploy and manage Add Ins 1 Create an Add In 12A e Define Menu Items 124 e Respond to Menu Events 132 e Handle Add In Events 1251 2 Deploy your Add In 125 e Potential Pitfalls 1261 3 Manage Add In
29. 5 2 Define Tasks Pane Contexts Named Contexts To create a context sensitive set of Tasks Panes you must define a set of named contexts that can be used in the definition A named context is a stereotype Class which extends a metaclass named ToolboxContext These elements must be owned by the same profile package that owns the Task Pane toolbox definitions 55 The context Class has one of the following attributes e contextDiagramType this should have an Initial Value set to a valid diagram type e contextltemType this should have an Initial Value set to a valid element type e contextKey Example Context Profile ClassElement contextitemType UML Class extends PackageElement contextitemType UML Packsge extends extends contextDisgramType UML Class Next Step The next step is to allocate Tasks Pane contexts to Tasks Pane toolboxes 57 gt 2 5 3 Allocate Tasks Pane Contexts Once you have defined your Tasks Pane toolboxes 557 and Tasks Pane contexts 571 you can allocate your toolboxes to as many contexts as apply and any number of toolboxes can be allocated to a single context This is done by creating a taggedValue connector from the toolbox element to the context element The Association end at the context end must be named The following diagram shows how this might appear 1998 2010 Sparx Systems Pty Ltd 58 MDG Technologies in SDK Cre
30. 81 Predefined Reference Data 84 Predefined Structured 81 TaggedValue Automation Interface Element Package 242 Task Automation Interface Repository 223 Task Panel Add To MDG Technology 38 Tasks Pane Allocate Toolbox To Contexts 57 Commands Built In 55 Contexts Define 57 Named Contexts 57 Profiles Create 54 Run Add In Functions From 56 Save Profile 58 Toolboxes Define 55 Technology Event EA _OnlnitializeTechnologies 152 Technology Events Add In Model 152 EA OnDeleteTechnology 154 EA OnlmportTechnology 155 EA _OnPostActivateTechnology 153 EA _OnPreActivateTechnology 152 EA _OnPreDeleteTechnology 153 Template Behavioral Model 109 EditorIn SDK 118 Model Incorporate In Technology 59 Term Automation Interface Repository 224 Test Automation Interface Element Package 243 Toolbox Add To MDG Technology 37 Connectors For Extending In Profile 51 Customize 47 Default Override In Profile 49 Elements For Extending 50 Override Default In Toolbox Profile 49 Page Attributes 48 Profile Create For MDG Technology 47 Profiles 47 Tasks Pane Define 55 Toolbox Profile Connectors For Extending 51 Create Hidden Submenu In 48 Items Assign Icons For 49 Pages That Can be Overridden 50 Transitions Collection Automation Interface ElementFeatures Package 255 Tricks and Traps Create Add In 126 U UML Profile And Element Templates 3 Create 5 Export 17 Import From XML 3 Save Fr
31. AS a aat Call from Enterprise Architect a a aa NACI OTE ENCE iii eiii Interface Overview ENUMEFATIONS citrico eb ConstLayoutStyles EU Mv ae ae eh ct hee ee A CreateBaselineFlag Enum eececeessecceseeeseseceeeceeesseceaeceesaeeeaeseeesseeeaecseeeaeeaesseeeaeeeaesneesaeeeaeeaeees CreateModelT ype Enum ivi daa EAEditionTypes Enumm cccceseeceeseeceeeeeeeeeeeeseeeaeceeesaeeeaeeeesaeesaesaeeeaeeeeseeeaeeneesaeeeaeseeteeeeeaeeneeeaeeeas EnumRelationSetType Enum cecsscesccssccsseceeceeesseceaeeseeeaeeaecaeesaeeeeesaeesaeesaecaeeeaesaseaeseaseeeseateeas ExportPackageXMIFlag Enum MDGMenuS Elio tee a season Object ype EMU a E Ae EASA AE EAE EEE EESE A S AA EE EA Propl ype ENUT susi a aa ae eee ete eta Si tl ReloadT ype ENUM seee adain ki da ScenarioDiagramType Enum ScenarioSt pType ENUM de cecceseedesernceohaesesesstautdoccenstedisdensddeenddeseesdshaesdedueduersadeedenseroneduednenteteenstvenehs sc narioTestT ype Enum ueis inana Siete Adenia iin eta A O A OS Enterprise Architect Software Developers Kit Contents Vv BEO A E EEEE CETTE E ETE SO OOTES SO OEEESSSOOOIOSSSCOTOSSOOOOOSOOOOOSESSOOOIOSSOOOIOSSOOOOOOSSOOOOOSOCOOOOSSOOOIOSSSOOTOOSOOOOO Repository AUthOr E Abi Siena diet id Had Red agen HN ene ae ee ee Clin AAA AAA AAA Eat Collin AA AAA AA EA A AE ES Dataty PO iii ii EventProperties EV ntProperty irenstean ieia da ceeds ModelWatch erica aid ain ak anata nian aaa Aas Pac
32. Action and an Activity have different advanced properties Currently only editable from the user interface Diagrams Collectionl214 Read only Returns a collection of sub diagrams child diagrams attached to this element as seen in the tree view Difficulty String Read Write A difficulty level associated with this element for estimation metrics only useable for Requirement Change and Issue element types otherwise ignored Valid values are Low Medium High Efforts Collection 21h Read only Collection of Effort 227 objects String Read only A globally unique ID for this element that is unique across all model files If you have to set this value manually you should only do so when the element is first created and make sure you format the GUID exactly as Enterprise Architect expects ElementiD Long Read only The local ID of the Element Valid for this file only Collectionl21H Read only Returns a collection of child elements sub elements attached to this element as seen in the tree view EmbeddedElements Collection 21 Read only List of elements that are embedded into this element such as Ports Parts Pins and Parameter Sets String Read Write A structure to hold a variety of flags to do with signals or events ExtensionPoints String Read Write Optional extension points for a Use Case as a comma separated list Collection Read only Collection of File 235 objects Read Write The file associated w
33. Architect is about to shutdown Also look at EA_FileOpen 138 and EA_FileNew 136 Syntax Sub EA_FileClose Repository As EA Repository The EA_FileClose function syntax contains the following elements COS ooo Repository EA An EA Repository object representing the Enterprise Architect Repositor model about to be closed Poll its members to retrieve model data mi and user interface status information Return Value None 6 5 3 EA_FileNew Details The EA_FileNew event enables the Add In to respond to a File New event When Enterprise Architect creates a new model file this event is raised and passed to all Add Ins implementing this method The event occurs when the model being viewed by the Enterprise Architect user changes for whatever reason through user interaction or Add In activity Also look at EA FileCloseli361and EA FileOpenl135 Syntax Sub EA FileNew Repository As EA Repository The EA_FileNew function syntax contains the following elements pane ie prin stos EEEE Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 137 Return Value None 6 5 4 EA_OnPostCloseDiagram Details EA_OnPostCloseDiagram notifies Add Ins that a diagra
34. As String LineText As String ID As Long The EA_OnOutputltemClicked function syntax has the following elements peme preste ossepien S pie fi Pi ID value specified in the original call to Repository WriteOutput LineText String The text that had been supplied as the String parameter in the original call to Repository WriteOutput Repository EA An EA Repository object representing the currently open Enterprise Repository Architect model Poll its members to retrieve model data and user interface status information TabName String The name of the tab that the click occurred in Usually this would have been created through Repository AddTab Return Value None 6 4 7 EA_OnOutputltemDoubleClicked Details EA_OnOutputltemDoubleClicked events informs Add Ins that the user has used the mouse to double click on O 1998 2010 Sparx Systems Pty Ltd 134 Enterprise Architect Add In Model Add In Events a list entry in one of the user defined output tabs Usually an Add In responds to this event in order to capture activity on an output tab they had previously created through a call to Repository AddTab Note that every loaded Add In receives this event for every double click on an output tab in Enterprise Architect irrespective of whether the Add In created that tab Add Ins should therefore check the TabName parameter supplied by this event to ensure that they are not responding to other Add Ins ev
35. Create Tasks Pane Proviles vsti cceccscstevsccessosesaaversdesssendecceescutenteghcsescasssussessusvansceustrenaeerstevsuceesseresstversendedserss 54 Define Tasks Pane TOOIDOXES ccccccccccssssssneeeeceeecseseeneeeeeeeeccecseensaeeeeeeeeesceesesaeeeeeeeeseseeeaaeeeeeeeeeeeeeenaaees 55 Built In Tasks Pane Commands la DD R n Add IM Functions nenied AAA AAA agate 56 Define Tasks Pane OO OA Sa e e coaest cadepcahd c4 aueSessccacacedsnodesancdebaadachaaueaataaedchesedentsctedcehcetdaaceVesaecece 57 Allocate Tasks Pane Contexts socii aaa aaa eaa eaa EE EEEo aeiaai 57 Save a Tasks Pane oN e EE E EEEE dd 58 Define Validation Configuration 58 Incorporate Model Templates ooconiconnccnnnonininininnnacnnnarnnn nn 59 Deploy An MDG Technology siinses a eere aeae rda roa pacecurreceuiveceuduededuendcadesuateneedccencdctersevenevneedteystencee 59 Shape Seri pS aiian notandann sodnar naiaren ada ideaa i 61 Getting Started With Shape Scripts ccsecceseceseeeeeeeeseeeeseeeesneeneeeenseeeseneesaeeesaeeeseeeeseesseaeeneeeeneeneneeeees 61 Shape Editor daea A ee nt a E Ea BS ote eR ect 64 Write SCripots ccc sce COR ancegdee Fc ceech T A E A EEE seduce scusucustueeedessecrdestaneeeets 65 Syntax GrAMMal sscccccsccsccssccssecsseseecsecssecseceseesseeeessecneececesecssseseessesseecsueseecsesesessseseecsesneessesesesssseseenaeeges 65 Shape AttriDutes ccccccccsccsecseesecsscssecssccseesseceecseeneecsecssecsseeseesseeseeeseceecseseses
36. Developers Kit Index 307 Quick Linker Connector Names 29 Default Settings Hide 28 Definition Format 25 ElementNames 29 Example 27 Introduction 25 R Re entrancy In Add Ins 126 Reference Automation Interface 186 Automation Interface Repository 222 Reference Data Tagged Value Type 84 Reference Data Tagged Values Create 85 ReloadType Enumeration Automation Interface 194 Repository Attributes 197 Author Collection 210 Automation Interface 197 Client Collection 210 Collection Class 211 Datatype 213 EventProperties 214 EventProperty 214 Methods 197 ModelWatcher 214 Open Automation Interface Code Example 284 Package 215 Package Automation Interface 196 Projectlssues 219 ProjectResource 220 PropertyType 221 Reference 222 Stereotype 223 Task 223 Term 224 Use Extras Automation Interface Code Example 290 Requirement Automation Interface Element Package 237 Reserved Names In Shape Scripts Connectors 76 In Shape Scripts Elements 76 Resource Automation Interface Element Package 238 Risk Automation Interface Element Package 239 RoleTag Automation Interface Connector Package 263 RTF Report Template Add To MDG Technology 44 Ss Save Profile From Diagram Context 18 Profile From Package Context 18 Tasks Pane Profile 58 Scenario Automation Interface Element Package 239 ScenarioDiagramType Enum Automation Interface 194 ScenarioExtension Automation Interface E
37. EAAddins 5 Add a new key under this key with the project name O 1998 2010 Sparx Systems Pty Ltd 126 Enterprise Architect Add In Model Add In Tasks EA E Temp oe H RaQuest Expand t S E Trellian New Key X VB and VBAPr Find S E WinCvs Mei 32 WinZip Compu Delete Binary Value Yahoo Rename DWORD Value n SD Zicom Systems Export Multi String ene 53 UNICODE Program a Expandable String Value Permissions 3 Volatile Environme A 53 Windows 3 1 Migr Copy Key Name HKEY LOCAL MACH Note ProjectName is not necessarily the name of your DLL but the name of the Project In Visual Basic this is the value for the property Name corresponding to the project file Specify the default value by modifying the default value of the key Name Type Data ab Default nec oF value not set Modify Binary Data Delete Rename Enter the value of the key by typing in the project name class name for example EaRequirements Requirements where EaRequirements is the project name as shown in the example below Value name eee Value data E aRequirements Requirements N 6 1 1 3 Tricks and Traps Visual Basic 5 6 Users Note Visual Basic 5 6 users should note that the version number of the Enterprise Architect interface is stored in the VBP project file in a form similar to the following Reference G 64FB2BF4 9EFA 1 1D2 8
38. Element Package 227 Element Package Diagram 225 Element Package File 235 Element Element Package 228 ElementFeatures Package Diagram 243 EmbeddedElements Collection ElementFeatures Package 248 Enumerations 191 EnumRelationSetType Enum 192 Examples 181 Examples and Tips 184 ExportPackageXMIFlag Enum 193 Introduction 181 Issue Element Package 235 MDGMenus Enum 193 Method ElementFeatures Package 249 MethodConstraint ElementFeatures Package 251 MethodTag ElementFeatures Package 252 Metric Element Package 236 Model 187 ObjectType Enum 193 Package 187 Parameter ElementFeatures Package 252 Partitions Collection ElementFeatures Package 253 Project Interface 271 Project Project Interface 271 Properties ElementFeatures Package 254 Property ElementFeatures Package 254 PropType Enum 194 Reference 186 ReloadType Enum 194 Repository 197 Repository Package 196 215 Repository Author Collection 210 Repository Client Collection 210 Repository Collection Class 211 Repository Datatype 213 Repository EventProperties 214 Repository EventProperty 214 Repository ModelWatcher 214 Repository Projectlssues 219 Repository ProjectResource 220 Repository PropertyType 221 Repository Reference 222 Repository Stereotype 223 Repository Task 223 Repository Term 224 Requirement Element Package 237 Resource Element Package 238 Risk Element Package 239 RoleTag Connector Package 263 Scenario Elemen
39. Event have the following reserved names for parts of the shape A AAA The main shape is the whole shape shape label The shape label gives the shape a detached label decoration Decoration gives the shape a decoration as defined by the lt identifier gt name in lt identifier gt Connectors Connectors such as Association Dependency or Generalization have the following reserved names for parts of the shape Name peseron The main shape is the whole shape shape source The source shape is an extra shape at the source end of the connector shape target The target shape is an extra shape at the target end of the connector shape lt labellD gt The lt labellD gt gives the connector a detached label where lt labellD gt is one of the following LeftTopLabel MiddleTopLabel RightTopLabel LeftBottomLabel MiddleBottomLabel RightBottomLabel 3 3 10 Miscellaneous Return Command Execution of the script can be terminated by using the return command Please see Example Scripts 774 for an example Looping The Shape Script feature does not support looping constructs Comments C style comments are supported For example C Style Single Line comment Multi Line comment supported String Manipulation Not Supported Enterprise Architect Software Developers Kit Shape Scripts Write Scripts 77 Arithmetical Operations Not Supported Variables Declaration Not Support
40. ID of the diagram to which the element is being added An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True to enable addition of the new element to the model Return False to disable addition of the new element 6 5 7 2 EA_OnPreNewConnector Details EA_OnPreNewConnector notifies Add Ins that a new connector is about to be created on a diagram It enables Add Ins to permit or deny creation of a new connector This event occurs when a user drags a new connector from the Enterprise Architect UML Toolbox or Resources window onto a diagram The notification is provided immediately before the connector is created so that the Add In can disable addition of the connector Also look at EA _OnPostNewConnector 142 Syntax Function EA_OnPreNewConnector Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreNewConnector function syntax contains the following elements Peano nme evens o Contains the following EventProperty Objects for the connector Se iis to be created 21 Type A string value corresponding to Connector Type Subtype A string value corresponding to Connector Subtype Stereotype A string value corresponding to Connector Stereotype ClientID A long value corresponding to Connector ClientID SupplierID A long value corresponding to Connector Supp
41. MenuClick 132 e EA GetMenuStateli3h e EA ShowHelpli34 e EA OnOutputltemClicked 133 e EA OnOutputltemDoubleClicked 133 6 4 1 EA_Connect Details EA_Connect events enable Add Ins to identify their type and to respond to Enterprise Architect start up This event occurs when Enterprise Architect first loads your Add In Enterprise Architect itself is loading at this time so that while a Repository object is supplied there is limited information that you can extract from it The chief uses for EA_Connect are in initializing global Add In data and for identifying the Add In as an MDG Add In 170 Also look at EA _Disconnectl13 Syntax Function EA_Connect Repository As EA Repository As String The EA_Connect function syntax has the following elements CC CEC model data and user interface status information Repository EA Repositor An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve Return Value String identifying a specialized type of Add In Pie eee mpc MDG Add Ins receive MDG Events 170i and extra menu options j None specialized Add In 6 4 2 EA_Disconnect Details The EA_Disconnect event enables the Add In to respond to user requests to disconnect the model branch from an external project This function is called when the Enterprise Architect closes If you have stored references to Enterprise Architect objects not particularly rec
42. O nothing m_Repository lssues Refresh For idx 0 to m_Repository Issues Count 1 Console Writeline m_Repository ssues GetAt idx Name If m_Repository Issues GetAt idx Name Problem then m_Repository Issues DeleteAt idx false Console WriteLine Delete Issues End if Next tasks o m_Repository Tasks AddNew Task 1 Task type If 0 Update false Then Console WriteLine error 0 GetLastError End if O nothing m_Repository Tasks Refresh For idx 0 to m_Repository Tasks Count 1 COnsole Writeline m_Repository Tasks GetAt idx Name If m_Repository Tasks GetAt idx Name Task 1 then m_Repository Tasks DeleteAt idx false Console WriteLine Delete Tasks End if Next glossary o m_Repository Terms AddNew Term 1 business If 0 Update false Then Console WriteLine error 0 GetLastError End if O nothing m_Repository Terms Refresh For idx 0 to m_Repository Terms Count 1 COnsole Writeline m_Repository Terms GetAt idx Term If m_Repository Terms GetAt idx Term Term 1 then m_Repository Terms DeleteAt idx false Console WriteLine Delete Terms End if Next authors o m_Repository Authors AddNew Joe B Writer If 0 Update false Then Console WriteLine o GetLastError End if O nothing m_Repository Authors Refresh For idx 0 to m_Repository authors Count 1 COnsole Writeline m_Repository Authors GetAt idx Name If m_Repository authors GetAt idx Name J
43. Profile can have one or more associated Tagged Values When creating a UML Profile you define these Tagged Values as attributes of the stereotyped Class You can also e Define Stereotype Tags with Predefined Tag Types 9 e Define Stereotype Tags with Supported Attributes 10 e Use the Tagged Value Connector 115 To define Tagged Values for a stereotype follow the steps below 1 Open the Attributes dialog for the stereotyped element Enterprise Architect Software Developers Kit Developing Profiles Create Profiles 9 Name Initial Value EL Handicap 40 4 myTag Yellow Click on the New button to create a new attribute In the Name field type the name of the stereotype tag In the Type field click on the drop down arrow and select the attribute type In the Initial field type the initial value of the tag See Add Enumerations to UML Profiles 14 for the steps for creating enumerated types for Tagged Values aro nN D In the Notes field type a description of the tag 7 Click on the Save button and Close button 1 2 3 1 With Predefined Tag Types Define Predefined Tag Types To define a stereotype tag with a predefined Tagged Value Type you must first create the predefined Tagged Value Type For full instructions on how to do this see the Create Structured Tagged Values 83 topic Assign Predefined Tag Types to Stereotypes To assign a predefined tag
44. Properties Element 72 Define Behavior On Creating Instance 22 Query Methods 72 Define Child Diagram Types 23 Reserved Names Connectors 76 Metatype In UML Profiles 19 Reserved Names Elements 76 Of Stereotype Tags 10 Return Statement 77 Stereotype In UML Profiles 19 Shape Attributes 66 Supported Stereotype Attribute Tags 10 Shape Editor 64 SwimlaneDef Single Condition 77 Automation Interface Diagram Package 269 Stereotypes 61 Swimlanes String Manipulation 76 Automation Interface Diagram Package 270 Subshape 77 271 i Subshape Layout 75 Synchronization Syntax Grammar 65 Macros Code Template Syntax 106 Terminate Execution 76 Syntax Grammar Variable Declarations 76 Shape Scripts 65 Without Stereotypes 76 Writing Scripts 65 a T Software Development Kit Enterprise Architect 2 Tag Stereotype Profile 8 Add Shape Script In Profile 15 Tag Type Add To Profile 6 Predefined Assign To Stereotype 9 Add Automation Interface Code Example 292 Tagged Value Automation Interface Repository 223 Connector Use 11 Custom 3 Custom Create 86 Define As Metatype 21 Element Package Automation Interface 242 Dialog 3 Macros Code Template Syntax 102 Multiple Restrict Application Of 21 Predefined Tag Types 9 Profile 24 Masked Create 86 Reference Data Create Structured Create 83 Tagged Value Type 85 Enterprise Architect Software Developers Kit Index 309 Tagged Value Type Add To MDG Technology 39 Filters 81 Introduction
45. Samples 284 7 2 1 Interface Overview public Package This package provides an overview of the main elements within the Automation Interface These are e The Repository 19 which represents the model as a whole and provides entry to model packages and collections e Elements 225 which are the basic structural unit such as Class Use Case and Object e Element Features 243 which are attributes and operations defined on an element e Diagram Package 2631 the visible drawings contained in the model e Connectors 255 relationships between elements The following diagram illustrates the main interface elements and their associated contents Each element in this document is creatable by Automation and can be accessed through the various collections that exist or in some cases directly 1998 2010 Sparx Systems Pty Ltd 188 Enterprise Architect Object Model Reference E Author i q E Attribute Ral Kang E AttributeConstraint 7 Datatype Issue mana a gt A E Metric MethodConstraint ProjectResource a Requirement MethodTag a Reference Resource Parameter Repository Risk 8 Stereotype Scenario a Task TaggedValue Term e Test E Element Project Interface ConnectorConstraint 8 Project J ConnectorEnd ConnectorTag RoleTsg Connector The main packages in the Automation Interface The following diagram pr
46. Sparx Systems Pty Ltd 214 Enterprise Architect Object Model Reference Metod type notes O ae If false is returned check the GetLastError function for more information 7 2 4 6 EventProperties An EventProperties object is passed to BroadcastFunctions to facilitate parameter passing EventProperties Attributes Atribute tye motes O Read only Number of parameters being passed to this broadcast event ObjectType ObjectType w31 Read only Distinguishes objects referenced through a Dispatch interface EventProperties Methods Get object EventProperty Read only Returns an EventProperty in the list raising an error if Index Index 214 is out of range Parameters e Index Variant can either be a number representing a zero based index into the array or a string representing the name of the EventProperty For example Props Get 3 or Props Get ObjectID 7 2 4 7 EventProperty EventProperty objects are always part of an EventProperties 214 collection and are passed to Add In methods responding to broadcast events 1351 EventProperty Attributes Atribute Tyre motes O O Explanation of what this property represents Name Sting A string distinguishing this property from others in the list ObjectType ObjectType Distinguishes objects referenced through a Dispatch interface A string number or object reference representing the property value 7 2 4 8 ModelWatcher public Class
47. The ModelWatcher object enables an automation client to track changes in a particular model Note After your model has been loaded you only create the ModelWatcher once If you reload the model or load another model the created ModelWatcher is still valid Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 215 ModelWatcher Attributes eow Po keo AA ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch 1937 interface ModelWatcher Methods GetReloadltem ReloadType The object that must be reloaded in order to see all changes is returned object Item ta through the tem parameter If there are no changes or the entire model must be reloaded this value is returned as null C or Nothing VB Calling this method clears the records so that the next time it is called the return values refer only to new changes Returns a value from the ReloadType enumeration that specifies which type of change if any has occurred Parameters e Item Object PeekReloaditem oe This method behaves identically to GetReloadltem but does not clear the change record 7 2 4 9 Package public Class A Package object corresponds to a Package element in the Enterprise Architect Project Browser It is accessed either through the Repository Models collection a Model is a special form of Package or through the Package Packages collection Note tha
48. ToolboxProfile xml zii 2 In the Directory field navigate to the directory containing the required diagram profiles The profiles in the directory are automatically listed in the Available Files panel 3 To select each required diagram profile individually highlight the file name in the Available Files list and click on the gt button The file name displays in the Selected Files list Alternatively to select all available profiles assuming they are all diagram profiles click on the gt gt button 4 Click on the Next button to proceed 2 1 4 Add a Toolbox Profile When creating an MDG Technology file you can include Enterprise Architect Toolbox page definitions that you have created 47 To use the Toolboxes section of the MDG Technology Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 30 topic up to and including Step 6 33 where you select the Toolboxes checkbox The MDG Technology Wizard Toolboxes dialog displays O 1998 2010 Sparx Systems Pty Ltd 38 MDG Technologies in SDK Create MDG Technologies MDG Technology Wizard Toolboxes Select the files to be included as Toolbox definitions in this technology Directory Y Dev Builds Addins BPMN BPMN 1 1 Available Files Selected Files BPMN Stereotypes xml Diagram Profile xml ToolboxProfile xml gt 2 Inthe Directory field navig
49. Write Ordering for this connector end OwnedByClassifie Boolean Read Write Indicates this Association end corresponds to an r attribute on the opposite end of the Association Qualifier String Read Write A qualifier that can apply to connector end Role String Read Write The connector end role RoleNote Read Write Notes associated with the role of this connector end RoleType Read Write The role type applied to this end of the connector Stereotype Read Write Sets or gets the stereotype for this connector end StereotypeEx String Read Write All the applied stereotypes of the connector end in a comma separated list TaggedValues Read only Collection of RoleTaq 265 objects Visibility String Read Write Scope associated with this connector end Valid types are Public Private Protected and Package ConnectorEnd Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Update the current ConnectorEnd object after modification or 1998 2010 Sparx Systems Pty Ltd 262 Enterprise Architect Object Model Reference A appending a new item If false is returned check the GetLastError function for more information 7 2 7 4 ConnectorTag public Class A ConnectorTag is a Tagged Value for a connector and is accessed through the Connecto
50. Write Type of containment Can be Not Specified By Reference or By Value Constraints Collection Read only A collection of AttributeConstraint objects Used to access and 21h manage constraints associated with this attribute Defaut string Read Write Initial value assigned to this attribute IsCollection Boolean Read Write Indicates if the current feature is a collection or not If the attribute represents a database column this when set represents a Foreign Key Read Write Flag indicating if the attribute is Const or not Read Write Indicates if the attribute is derived that is a calculated value IsOrdered Boolean Read Write Indicates if a collection is ordered or not If the attribute represents a database column this when set represents a Primary Key Boolean Read Write Indicates if the current attribute is a static feature or not If the attribute represents a database column this when set represents the Unique option Length Read Write The attribute length where applicable Read Write A value for the collection lower bound Name String Read Write The attribute name Notes Sting Read Write Further notes about this attribute ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 19 part of pos Jo reso pose amo ao e ds anota presion Sty pesonas Pesona O sa fom pesan seas O StereotypeEx String Read Write All the applied stereotypes of the attribute i
51. access and use resources pertaining to a specific technology in Enterprise Architect There are various options for an administrator or individual user to bring MDG Technologies into use with Enterprise Architect as described in Extending UML With Enterprise Architect You should read the MDG Technology topics to understand how MDG Technologies are accessed and used within Enterprise Architect especially the Manage MDG Technologies topic A further option is that Technology Developers can develop new MDG Technologies and deploy them to the project team as appropriate this is described in the following topics e Create MDG Technologies 307 e Working With MTS Files 46 e Customize Toolbox Profiles 474 e Create Diagram Profiles 524 e Create Tasks Pane Profiles 541 e Define Validation Configuration 584 e Incorporate Model Templates 5 e Deploy an MDG Technology 5 A An example of creating an MDG Technology for an Enterprise Architecture framework is provided in the white paper Enterprise Architecture Framework Design with Sparx Systems Enterprise Architect 2 1 Create MDG Technologies Using the MDG Technology Wizard you can create MDG Technology files that can include UML Profiles code modules Patterns images Tagged Value Types RTF report templates linked document templates Toolbox pages and Task Pane pages To create an MDG Technology file follow the steps below 1 Select the Tools Generate MDG Technology F
52. accessing a field that contains formatting use this method to convert it to your preferred format Returns the field in the format specified Parameters e Format String The format to convert the field to Valid formats are e HTML Full HTML e RTF Rich Text Format e TXT Plain text Text String The field to be converted Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Returns a pointer to a method in the repository This is usually found using the MethodGUID property of a method Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 205 memod O notes O Parameters e Guid String the GUID of the method to look for Method 24 Package 2151 Package 21 GetMethodByld string Id GetPackageByGuid string Guid GetPackageByID long PackagelD GetProjectinterface Projectle7t GetReferenceList string Type Reference GetTechnologyVersion string String GetTreeSelectedElements Collection 214 Returns a pointer to a method in the repository This is usually found using the Method D property of a method Parameters Id String the ID of the method to look for Returns a pointer to a package in the repository using the package s GUID reference number global ID This is usually found usin
53. be one of the following template names e Attribute e Class e ClassBase e Classimpl e Classinterface e Constraint e Custom Template custom templates enable you to define your own templates for more information see Custom Templates 115 e Effort e InnerClass e InnerClassimpl Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 107 e LinkedFile e Metric e Namespace e Operation e OperationImpl e Parameter e Problem e Requirement e Resource e Risk e Scenario e Test lt conditions gt is optional and appears the same as the conditions for if and elself statements Example list Attribute separator n indent _ The separator attribute denoted above by separator specifies the space that should be used between the list items This excludes the last item in the list The indent attribute denoted by indent specifies the space by which each line in the generated output should be indented The above example would output the result of processing the Attribute template for each attribute element of the Class in scope The resultant list would separate its items with a single new line and indent them two spaces respectively If the Class in scope had any stereotyped attributes they would be generated using the appropriately specialized template There are some special cases to consider when using the ist macro e lf the Attribute template
54. button against the Tagged Value in the Tagged Value window RefGUIDList Type RefGUIDList Enables the Tagged Value to reference a list of Values Type1 Type2 elements from the model by specifying each element s Stereotypes Stereotype GU D where Type1 and Type2 specify one or more 1 allowed diagram objects such as Class or Component and Stereotypel1 represents an allowed stereotype Set the classifier see UML Modeling With Enterprise Architect UML Modeling Too attribute or operation see the UML Dictionary for a Tagged Value of this type by clicking on the button against the Tagged Value in the Tagged Value window Spin Type Spin Enables creation of a spin control with the value of LowerBound x LowerBound being the lowest value and UpperBound UpperBound x being the highest value a You can also set a default within that range String Type String Enables entry of a string value up to 255 characters in Default Val length and a default text string For longer texts use Type Memol 8 Tag Filters The following table details filters that can be used to restrict where a Tagged Value can be applied Enterprise Architect Software Developers Kit Tagged Value Types Predefined Structured Types 83 CC CN AppliesTo AppliesTo Type1 Restricts the element types this filter can be applied to Type2 where Type1 and Type2 are the valid types Possible values are all element types all con
55. color hidelabel Hides the label specified by labelname string labelname image Draws the image that has the name imageld in the Image Manager string imageld 1998 2010 Sparx Systems Pty Ltd 70 Shape Scripts Write Scripts Method Name int left int top int right int bottom lineto moveto intx int y polygon int centerx int centery int numberofsides int radius float rotation string text printifdefined string propertyname string truepari string falsepart printin string text printwrapped string text rectangle int left int top int right int bottom roundrect int left int top int right int bottom int abs_cornerwidth int Note The image must exist within the model in which the stereotype is used If it does not already exist in the model you must import it as reference data see UML Model Management Draws a line from the current cursor position to a point specified by x and y and then updates the pen cursor to that position Moves the pen cursor to the point specified by x and y Draws a regular polygon with center at the point centerx centery and numberofsides number of sides Prints the specified text string Note You cannot change the font size type or color of this text Prints the truepart if the given property exists and has a non empty value otherwise prints the optional falsepart Note You
56. constraints for a stereotype follow the steps below 1 Open the Class Properties dialog of the stereotype element in a diagram 2 Click on the Constraints tab and click on the New button to create a new constraint Enterprise Architect Software Developers Kit Developing Profiles Create Profiles NO oO RB O Defined Constraints Constraint t isRegistered false Pre condition Approved In the Constraint field type the value of the constraint In the Type field click on the drop down arrow and select the appropriate type In the Status field click on the drop down arrow and select the appropriate status In the Notes field type any additional information required Click on the Save button and on the OK button to close the dialog 13 1998 2010 Sparx Systems Pty Ltd 14 Developing Profiles Create Profiles 1 2 5 Add Enumeration Elements Enumerations can be used to restrict the values available to stereotype tags metacisss Class enumeration Color Yellow Red Green extends myStereotype gt Handicap int 40 myTsg color Yellow Note Enumerations defined under a Profile Package do not appear as elements in the profile when imported To add an Enumeration element follow the steps below 1 Open your Profile Package child Class diagram 2 Inthe Enterprise Architect UML Toolbox select More tools Profile T
57. data and user interface status information Return Value Return True to enable addition of the new diagram to the model Return False to disable addition of the new diagram 6 5 7 4 EA_OnPreNewDiagramObject Details EA_OnPreNewDiagramObject notifies Add Ins that a new diagram object is about to be dropped on a diagram It enables Add Ins to permit or deny creation of the new object This event occurs when a user drags an object from the Enterprise Architect Project Browser or Resources window onto a diagram The notification is provided immediately before the object is created so that the Add In can disable addition of the object Also look at EA_OnPostNewDiagramObject 148 1998 2010 Sparx Systems Pty Ltd 144 Enterprise Architect Add In Model Broadcast Events Syntax Function EA_OnPreNewDiagramObject Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreNewDiagramObject function syntax contains the following elements CC CN Contains the following EventProperty Objects for the object to a aes be created Type A string value corresponding to Object Type Stereotype A string value corresponding to Object Stereotype ParentID A long value corresponding to Object Parent D DiagramID A long value corresponding to the ID of the diagram to which the object is being added An EA Repository object representing the currently open Enterprise Architect model Poll its membe
58. displaying the results in Enterprise Architect s Model Search window Parameters e sQueryName String the name of the search to run for example Simple sSearchTerm String the term to search for sSearchOptions String currently not being used sSearchData String enables you to supply a list of results in the form of XML which is appended onto the result list in Enterprise Architect See XML Format 12 this parameter is not mandatory so pass in an empty string to run the search as per normal 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 Note This might fail if the user logged into the model does not have the correct access permission Parameters e FilePath String the file to save the Audit Logs to e StartDateTime Variant DateTime the earliest date and time of log entries to save Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 209 memos pe motes e EndDateTime Variant DateTime the latest date and time of log entries to save SaveDiagram long DiagramID ShowDynamicHelp string Topic ShowinProjectView object Item ShowProfileToolbox string Technology string Profile boolean Show ShowWindow long Show SQLQuery string SQL VersionC
59. e Datastore e Profile e Decision e Providedinterface Expose Interface e DeploymentSpecification Deployment e ReceiveEvent Receive Specification e Requirement Device e RobustBoundary Boundary e DiagramLegend Diagram Legend RobustContrel Contral DiagramNotes Diagram Notes E 9 ag e RobustEntity Entity e DocumentArtifact Document Artifact or Document e Screen e Entity Information Sendevent Sand e EntityObject Entity e EntryState Entry e SequenceBoundary Boundary e SequenceControl Control Enumeration i e SequenceEntity Entity e ExceptionHandler Exception Signal e ExecutionEnvironment Execution Environment e ExitState Exit e State e StateMachine State Machine Feature e StateTimeLine State Lifeline e FinalState Final e Stereotype e FlowFinalNode Flow Final e ForkJoinH Fork Join Horizontal e ForkJoinV Fork Join Vertical e StructuredActivity Structured Activity e SynchState Synch e Table e Gate Diagram Gate e GUIElement UI Control e Terminate e TestCase Test Case e HistoryState History Tet e Hyperlink YP e UseCase Use Case e Informationltem Information Item UM Boundary Eonia e e InitialState Initial e ValueTimeLine Value Lifeline e InteractionFragment Fragment 2 3 7 Connectors Used In Toolboxes The following connectors all preceded with the namespace UML can be extended or redefined in Enterpris
60. e Name String e Type String up to 30 characters long Delete short index Deletes the item at the selected reference Parameters e index Short DeleteAt short index Deletes the item at the selected index The second parameter is boolean Refresh currently unused Parameters e index Short e Refresh Boolean GetAt short index Retrieves the array object using a numerical index If the index is out of bounds an error occurs Parameters e index Short GetByName siring Gets an item in the current collection by Name Name If the collection does not contain any items the method returns a null value If the collection contains items but it was unable to find an object with the specified name the method raises an exception Only supported for the following collections Models Packages 213 Elements 2251 Diagrams 26 and element TaggedValues A Parameters e Name String GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Refresh Refreshes the collection by re querying the model and reloading the collection Should be called after adding a new item or after deleting an item Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 213 7 2 4 5 Datatype public Class A Datatype is a named type that can be a
61. element StateTransitions Collectionl215 Read only List of State Transitions that an element can support Applies in particular to Timing elements String Read Write Sets or gets the status such as Proposed or Approved Stereotype String Read Write The primary element stereotype This is the first of the list of stereotypes you can access using the StereotypeEx 1998 2010 Sparx Systems Pty Ltd 232 Enterprise Architect Object Model Reference AE O Notes StereotypeEx String Read Write All the applied stereotypes of the element in a comma separated list StyleEx String Read Write Advanced style settings Reserved for the use of Sparx Systems Subtype Long Read Write A numeric subtype that qualifies the Type 232 of the main element For example e For Event 0 Receiver 1 Sender e For Class 1 Parameterised 2 Instantiated 3 Both 0 Neither 17 Association Class Note If 17 because an Association Class has been created through the user interface MiscData 3 will contain the ID of the related Association As MiscData is read only you cannot create an Association Class through the Automation Interface For Note 1 Note linked to connector 2 Constraint linked to connector For StateNode 100 ActivityIntitial 101 ActivityFinal For Activity 0 Activity 8 composite Activity also set to 8 for other composite elements such as Use Cases For Synchronization 0 Horizo
62. following EventProperty objects for the new pcia diagram 214 e DiagramID A long value corresponding to Diagram PackagelD Repository 4 Repositor An EA Repository object representing the currently open 19 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True if the diagram has been updated during this notification Return False otherwise 6 5 9 4 EA_OnPostNewDiagramObject Details EA_OnPostNewDiagramObject notifies Add Ins that a new object has been created on a diagram It enables Add Ins to modify the object upon creation This event occurs after a user has dragged a new object from the Enterprise Architect Project Browser or Resources window onto a diagram The notification is provided immediately after the object is added to the diagram Set Repository SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs Also look at EA_OnPreNewDiagramObject 143 Syntax Function EA_OnPostNewDiagramObject Repository As EA Repository Info As EA EventProperties As Boolean Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 149 The EA_OnPostNewDiagramObject function syntax contains the following elements CA owe CC Contains the following EventProperty objects for the new cs dis element 21 e ObjectID A long value corresponding to
63. for parameters constraints and Tagged Values Associated table in EAP file t_operation Method Attributes atributo tye motes Abstract Boolean Read Write Flag indicating if the method is abstract 1 or not 0 Behavior String Read Write Some further explanatory behavior notes for example pseudocode Note In earlier releases of Enterprise Architect this attribute had the UK Australian spelling Behaviour this is still present for backwards compatibility but please now use the Behavior attribute for consistency ClassifierlD Read Write Classifier ID that applies to the ReturnType Code String Read Write Optional field to hold the method Code used for the Initial Code field Read Write Concurrency type of method Read Write Flag indicating the method is Const O 1998 2010 Sparx Systems Pty Ltd 250 Enterprise Architect Object Model Reference atributo tye motes Read Write Flag to indicate if the method is Leaf cannot be overridden IsPure Boolean Read Write Flag indicating the method is defined as Pure in C Read Write Flag to indicate if the method is a query that is does not alter Class variables CC CC Rea Feo raae ereraa OO ssi CN Fog woiekawasaionemes OOOO MethodGUID String Read Write A globally unique ID for the current method System generated MethodID Read only A local ID for the current method only valid within this EAP file Name Sti
64. frorn Complexity Must Be Embed Separator Separator _ Element Caption Link Element connector metatype Menu Group Level Parent element LEAF GROUP 2 Dependency to TRUE TRUE TRUE TRUE Component 0 3 Dependency from TRUE TRUE TRUE TRUE Component 0 TRUE 4 TRUE TRUE TRUE 0 TRUE TRUE TRUE 0 TRUE 6 TRUE TRUE TRUE 0 7 TRUE TRUE TRUE 0 TRUE 8 Dependency to TRUE TRUE TRUE TRUE Port 0 TRUE 9 Dependency from TRUE TRUE TRUE TRUE Port 0 TRUE TRUE This saves to the following CSV Class quick Component Dependency to Dependency to TRUE TRUE TRUE TRUE Component 0 Class quick Component Dependency from Dependency from TRUE TRUE TRUE TRUE Component 0 TRUE Class quick Component Dependency to Dependency to TRUE TRUE TRUE 0 Class quick Component Dependency from Dependency from TRUE TRUE TRUE 0 TRUE Class quick Port Dependency to Dependency to TRUE TRUE TRUE 0 Class quick Port Dependency from Dependency from TRUE TRUE TRUE O TRUE Class quick Component Port Dependency to Dependency to TRUE TRUE TRUE TRUE Port 0 TRUE Class quick Component Port Dependency from Dependency from TRUE TRUE TRUE TRUE Port 0 TRUE TRUE You can create the following profile and cut and paste the CSV data into the document artifact to test the effect QuickLink A extends 1 3 3 Hide Default Quick Linker Settings If you have a Quick Linker
65. generate and collate project development workflows Profile Files to be included Y Dev Builds Addins BPMN BPMN 1 1 BPMN Stereotypes xml Pattem Files to be included Tagged Value Types to be included Code Modules to be included 13 Save to MTS 9 If you have used an MTS file and want to update it select the Save to MTS checkbox 10 If you are satisfied with the selection of items click on the Finish button You can now edit the MTS filel 467 if required to add further items such as e Model Search definitions e Model Views e Model Validation configurations e Model Templates To make the MDG Technology File accessible to an Enterprise Architect model you must add the technology file path to the MDG Technologies Advanced dialog See the Access Remote MDG Technologies topic in Extending UML With Enterprise Architect Enterprise Architect Software Developers Kit MDG Technologies in SDK Create MDG Technologies 35 2 1 1 Add a Profile When creating an MDG Technology file you can include UML 2 1 compliant profiles that you have defined 55 To use the Profiles section of the MDG Technology Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 30 topic up to and including Step 6 33 where you select the Profiles checkbox The MDG Technology Wizard Profile files selection dialog displays MDG Technology Wizard Profile files selectio
66. idx Name Next End Sub 7 2 10 3 Add and Manage Packages public Object Example illustrating how to add a Model or a Package Sub TestPackageLifecycle Dim idx as integer Dim idx2 as integer Dim package as object Dim model as object Dim o as object first add a new Model model m_Repository Models AddNew AdvancedModel If not model Update Then Console WriteLine model GetLastError End If refresh the models collection m_Repository Models Refresh now work through models collection and add a package For idx 0 to m_Repository Models Count 1 o m_Repository Models GetAt idx Console WriteLine o Name If o Name AdvancedModel Then package o Packages Addnew Subpackage Nothing If not package Update Then Console WriteLine package GetLastError End If package Element Stereotype system package Update for testing purposes just delete the newly created Model and its contents m_Repository Models Delete idx End If Next 1998 2010 Sparx Systems Pty Ltd 286 Enterprise Architect Object Model Reference End Sub 7 2 10 4 Add and Manage Elements public Object Add and delete elements in a package Sub ElementLifecycle Dim package as Object Dim element as Object package m_Repository GetPackageByID 2 element package elements AddNew Login to Website UseCase element Stereotype testcase element Update package elements Re
67. if one already exists Generates the code for all Classes within a package For example recurse 1 overwrite 1 dir C Parameters e PackageGUID String the GUID in XML format of the package to generate ExtraOptions String enables extra options to be given to the command currently enables e Generation of all subpackages recurse e Force overwrite of all files overwrite and e Specification to auto generate all paths dir Generates either an Internal test or an External test from the Structured Specification of an element See the Scenarios section of UML Modeling With Enterprise Architect UML Modeling Tool Parameters e ElementGUID String the GUID in XML format of the element containing the Structured Specification e TestType EnumScenarioTestType the type of test to generate see ScenarioTestType Enum 195 Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 277 meros tome Me GenerateXSD string Boolean Creates an XML schema for this GenerateXSD PackageGUID string Returns true on success FileName string Encoding P ramieters string Options i PackageGUID String the GUID in XML format of the package FileName String target filepath Encoding String the XML encoding for the code page instruction Options String enables extra options to be given to the command currently enables e GenGlobalElement
68. in EAP file t_objectconstraints Constraint Attributes jatibute tye fotes Name Sting Read Write The name of the constraint that is the constraint Notes string Read Write Notes about the constraint ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 19 Se fero ETC pem fo ermeno Constraint Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Constraint object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 5 2 Effort public Class An Effort is a named item with a weighting that can be associated with an element for purposes of building metrics about the model Accessed through the Element Efforts collection Associated table in EAP file t_objecteffort Effort Attributes Attribute Type Name sing Read Write The name of the effort Notes Sting Read Write Notes about the effort ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 19 O 1998 2010 Sparx Systems Pty Ltd 228 Enterprise Architect Object Model Reference Attributo type Read Write The effort type weight Long Read Write A weighting factor weight
69. 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 currently unused 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 currently unused XMLtoGUID string GUID String Changes a GUID in XML format to the form used inside Enterprise Architect 1998 2010 Sparx Systems Pty Ltd 284 Enterprise Architect Object Model Reference e GUID String the XML style GUID to convert to Enterprise Architect internal format 7 2 10 Code Samples This topic contains various code examples indicating how to use the Automation Interface written in VB Net e Open the Repository 28A e lterate Through a EAP File 284 e Add and Manage Packages 2851 e Add and Manage Elements 286 e Add a Connector 286 e Add and Manage Diagrams 2871 e Add and Delete Features 288 e Element Extras 28 e Repository Extras 2907 e Stereotypes 2924 e Work with Attributes 2921 e Work with Methods 298 7 2 10 1 Open the Repository public Ob
70. in creating Diagram Profiles 52 2 4 2 Attribute Values stylex amp pdata When creating a diagram profile you can use the pdata and stylex attributes to define a range of characteristics of the diagrams created with the profile If the attribute is defining several characteristics at once put the values in a single string separated by semicolons For example 1998 2010 Sparx Systems Pty Ltd 54 MDG Technologies in SDK Create Diagram Profiles styleEx string HideQuals 0 AdvanceElementProps 1 ShowNotes 1 styleex string TConnectorNotation Option where Option is one of UML 2 1 IDEF1X or Information Engineering ShowAsList 1 to make the diagram open directly into the Element List see the View Options topic in Using Enterprise Architect UML Modeling Tool AdvanceElementProps 1 to show the element property string ShowTests 1 to show the element Testing compartment ShowMaint 1 to show the element Maintenance compartment ShowNotes 1 to show the element Notes compartment HideQuals 0 to show qualifiers and visibility indicators AdvancedFeatureProps 1 to show the feature property string ShowOphRetType 1 to show the operation return type SuppressBrackets 1 to suppress brackets on operations without parameters AttPkg 1 to show package visible class members VisibleAttributeDetail 1 to show attribute details on the diagram TExplicitNavigability 1 to show non navigable conn
71. in the current file is of the type of this Class F otherwise importFromDependency T if the Class has a Dependency connector to a Class in this file F otherwise importFromGeneralization T if the Class has a Generalization connector to a Class in this file F otherwise importFromMeth T if a method return type of a Class in the current file is the type of this Class Fotherwise importFromParam T if an method parameter of a Class in the current file is of the type of this Class Fotherwise importFromRealization T if the Class has a Realization connector to a Class in this file F otherwise importinFile T if the Class is in the current file F otherwise importPackagePath The package path with a separator of the Class being imported 1998 2010 Sparx Systems Pty Ltd 98 Code Template Framework in SDK Code Template Syntax Macro Name Description the file being generated linkAttQualName The Association target qualified by the namespace path if generating namespaces and the classifier path dot delimited linkGUID The unique GUID for the current connector linkParentName Generalization Properties dialog Target linkParentQualName The Generalization target qualified by the namespace path if generating namespaces and the classifier path dot delimited metricNotes Project Management dialog Metrics tab Notes field Enterprise Architect Software Developers Kit Code Template
72. is used as an argument to the list macro this also generates attributes derived from associations by executing the appropriate LinkedAttribute template e If the ClassBase template is used as an argument to the list macro this also generates Class bases derived from links in the model by executing the appropriate LinkedClassBase template e Ifthe Class nterface template is used as an argument to the list macro this also generates Class bases derived from links in the model by executing the appropriate LinkedClassInterface template e If InnerClass or InnerClassimp is used as an argument to the list macro these Classes are generated using the Class and ClassImpl templates respectively These arguments tell Enterprise Architect that it should process the templates based on the inner Classes of the Class in scope Branching if then else Constructs The CTF supports a limited form of branching through the following macros e if e elself e endif e endTemplate The basic structure of the if and elself macros is if lt test gt lt operator gt lt test gt where lt operator gt can be one of e eo l and lt test can be one of e a string literal enclosed within double quotation marks e adirect substitution macro without the enclosing percent signs e a variable reference Branches can be nested and multiple conditions can be specified using one of e and 1998 2010 Sparx Systems Pty Ltd 108 Code Template
73. menu option Click on the Stereotype field drop down arrow select the stereotype you created and click on the OK button The object s shape now reflects the Shape Script you created O 1998 2010 Sparx Systems Pty Ltd 64 Shape Scripts Getting Started With Shape Scripts Stereotype Author E Walter 3 2 Shape Editor The Shape Editor enables you to create Shape Scripts 61 It provides the facilities of the Common Code Editor including intellisense for shape script attributes and functions For more information on intellisense and the Common Code Editor see the Code Editors topic in Using Enterprise Architect UML Modeling Tool To access the Shape Editor follow the steps below 1 Select the Settings UML menu option the UML Types dialog displays defaulted to the Stereotypes tab Type a name in the Stereotype field or click on an the required stereotype in the list From the Override Appearance panel select the Shape Script radio button 4 Click on the Assign button The Shape Editor dialog displays Enterprise Architect Software Developers Kit Shape Scripts Shape Editor 65 EAShapeScript 1 0 Format y Import Export OK Cancel Help BASIC SHAPES shape main setfillcolor 255 0 0 rectangle 0 0 90 30 setfillcolor 0 255 0 ellipse 0 30 90 60 setfillcolor 0 0 255 rectang
74. model data and user interface status information Return Value Return True to enable deletion of the diagram from the model Return False to disable deletion of the diagram Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 141 6 5 6 6 EA_OnPreDeletePackage Details EA_OnPreDeletePackage notifies Add Ins that a package is to be deleted from the model It enables Add Ins to permit or deny deletion of the package This event occurs when a user attempts to permanently delete a package from the Project Browser The notification is provided immediately before the package is deleted so that the Add In can disable deletion of the package Syntax Function EA_OnPreDeletePackage Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreDeletePackage function syntax contains the following elements ieee ig a pa EA Contains the following EventProperty Objects for the connector to EventProperties be deleted 21 e PackagelD A long value corresponding to Package PackagelD Repositor EA Repository An EA Repository object representing the currently open y 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True to enable deletion of the package from the model Return False to disable deletion of the package 6 5 7 Pre New Events Enterprise Archi
75. occurred in relation 0 to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current File object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 5 5 Issue Maintenance public Class An Issue is either a Change or a Defect is associated with the containing element and is accessed through the Issues collection of an element Associated table in EAP file t_objectproblems Issue Attributes Atributo Type Notes DateReported Read Write Date issue reported DateResolved Read Write Date issue resolved ElementiD Long Read Write ID of element associated with this issue Name Sting Read Write The Issue name that is the Issue itself Notes String Read Write Issue description 1998 2010 Sparx Systems Pty Ltd 236 Enterprise Architect Object Model Reference CA E CO CT Version String Read Write Version associated with issue Note that this method is only available through a Dispatch interface For example Object ob Issue Print ob Version Issue Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Issue object after modification or appending a new ite
76. onto the diagram If the Properties dialog does not display double click on the element on the diagram In the Name field type a name for the stereotype Click on the OK button and if it displays Close the Generate Code dialog Click on the Extension relationship in the Toolbox and drag the connection from the stereotype element to the metaclass element Your diagram should now resemble the one below metaciass Class extends Handicap int 40 myTag color Yellow O 1998 2010 Sparx Systems Pty Ltd 8 Developing Profiles Create Profiles Note If you want to have a stereotype extending more than one metaclass do not create two stereotype Classes with the same name You cannot have two stereotypes with the same name in the same profile one is discarded when you save the profile Therefore create one stereotype Class with an Extension connector to each of several Metaclass elements as shown below metaclass Connector direction Direction Source gt Desti extends needline lt gt metaclass Association extends direction Direction Source gt Desti You can now add stereotype Tags 8 Constraints 127 Enumerations 14 and or Shape Scripts 15 to your Profile and define the default appearance 1 of the elements or connectors as required 1 2 3 Define Stereotype Tagged Values Stereotypes within a UML
77. 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 Collection 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 Datatypes Collection 21 Read only The Datatypes collection Contains a list of Datatype objects each representing a data type definition for either data modeling or code generation purposes EAEditionTyp Read only Returns the level of core licensed functionality available to the current repository Note 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 EAEditionTyp Read only Returns the level of extended licensed es 192 functionality available to the current repository EnableCache Boolean Read Write An optimization for pre loading package objects when dealing with large sets of automation objects EnableUlUpdates 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 the changes to the user call Repository RefreshModelView FlagUpdate Boolean Read Write Instructs Enterprise Archi
78. referenced through a Dispatch interface Packagel215 Organization resource associated with String Roles string The roles this resource can play in the current project ProjectResource Methods GetLastError String Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Resource object after modification or appending a new item lf false is returned check the GetLastError function for more information 7 2 4 12 PropertyType public Class A PropertyType object represents a defined property that can be applied to UML elements as a Tagged Value Accessed using the Repository Property Types collection Each PropertyType corresponds to one of the predefined Tagged Values for the model Associated table in EAP file t_propertytypes Author Attributes Antou type notes OO Read Write Short description for the property Detail string Read Write Configuration information for the property ObjectType ObjectType 1e31 Read only Distinguishes objects referenced through a Dispatch interface Read Write Name of the property Tag Name 1998 2010 Sparx Systems Pty Ltd 222 Enterprise Architect Object Model Reference Author Methods GetLastError Returns a string value describing the most recent error that occurred in relation to
79. see the GetContextltemType method below Parameters e Item Object the item to point to Returns the ObjectType of an item in context within Enterprise Architect A Contextltem is defined as an item selected anywhere within the Enterprise Architect GUI including Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 203 e An item selected in the Project Browser e An item selected in an open diagram e An item selected in certain dialogs such as the attribute Properties dialog The supported ObjectTypes can be any one of the following values otElement otPackage otDiagram otAttribute otMethod otConnector 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 gram Returns a selected diagram 26 GetCurrentLoginUser boolean String If security is not enabled in the repository an error is GetGuid false 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 string Diagram Returns a pointer to a diagram using the global reference ID Guid oh
80. single definition using the addition operator Examples Using a substitution macro foo opTag bar Using a literal string foo bar Using another variable foo bar Using a list macro ops list Operation separator n n indent t Using the addition assignment operator body list Operation separator n n indent t 1998 2010 Sparx Systems Pty Ltd 118 Code Template Framework in SDK Code Template Syntax The above definition is equivalent to the following body body list Operation separator n n indent t Using multiple terms templateArgs list ClassParameter separator template template lt templateArgs gt Variable References Variable values can be retrieved by using a reference of the form lt name gt where lt name gt can be a previously defined variable Variable references can be used in one of the following ways e As part of a macro such as the argument to a function macro e Asaterm ina variable definition e As a direct substitution of the variable value into the output Note It is legal to reference a variable before it is defined In this case the variable is assumed to contain an empty string value Example 1 Using variables as part of a macro The following is an excerpt from the default C ClassNotes template wrapLen genOptWrapComment style YgenOptCPPCommentStyle Define variables
81. string QueryName string SearchTerm GetElementSet string IDList Collection long Options 211 GetFieldFromFormat string Format string Text GetFormatFromField string Format string Text GetLastError GetMethodByGuid string Guid 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 e QueryName String the name of the search to run for example Simple e SearchTerm String the term to search for Returns a set of elements as a collection based ona comma separated list of Element D values By default if no values are provided in the IDList parameter all objects for the entire project are returned Parameters e IDList String a comma separated list of ElementID values Options Long modifies default behaviour of this method e 1 Returns empty collection when empty IDList parameter is given e 2 Use IDList string as an SQL query to populate this collection Converts a field from your preferred format to Enterprise Architect s internal format Returns the field in Enterprise Architect s internal format Parameters e Format String The format to convert the field from Valid formats are e HTML Full HTML e RTF Rich Text Format e TXT Plain text Text String The field to be converted After
82. text which appears at the top of the swimlane Can be the same as an existing swimlane title Width Long The width of the swimlane in pixels Items object Swimlane 27 Accesses an individual swimlane Index cougcHoN If the string matches more than one swimlane title the first matching swimlane is returned Parameter e Index Object Either a string representing the title text or an integer representing the zero based index of the swimlane to get Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 271 7 2 8 6 Swimlane A Swimlane object makes available attributes relating to a single row or column in a list of swimlanes 270 Atribute Type Noes BackColor Read Write The swimlane is filled with this RGB color ClassifiedGuid String Read Write The GUID of the classifier Class This can be obtained from the corresponding Element object via the ElementGUID property ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface Read Write Text at the head of the swimlane Width Read Write The width of the swimlane in pixels 7 2 9 Project Interface public Package The Enterprise Architect Project interface This is the XML based interface to Enterprise Architect elements it also includes some utility functions You can get a pointer to this interface using the Repository GetProjectInterface method This interf
83. the VBP project file in a form similar to the following O 1998 2010 Sparx Systems Pty Ltd 184 Enterprise Architect Object Model Using the Automation Interface Reference G 64FB2BF4 9EFA 1 1D2 8307 C45586000000 2 2 0 Program Files Sparx Systems EA EA TLB Enterprise Architect Object Model 2 02 If you experience problems moving from one version of Enterprise Architect to another open the VBP file in a text editor and remove this line Then open the project in Visual Basic and use Project References to create a new reference to the Enterprise Architect Object model Members of lt globals gt o E eS ActiveDocument A E Addin e ActivePrinter W Addins es ActiveWWindow W Adjustments es Addins W Application es AnswerWizard W AutoCaption E fS Application iv Library Word C Program Files Microsoft OfficeiOffice OWMSYYORD OLB El Microsoft Word 10 0 Object Library a Reference to objects in Enterprise Architect and Word should now be available in the Object Browser This can be accessed from the main menu by selecting View Object Browser or by pressing F2 The drop down list on the top left of the window should now include Enterprise Architect and Word If MS Project is installed this must also be set up 7 1 2 Examples and Tips Instructions for using the interface are provided through sample code There are several sets of examples e VB 6 and C examples are available in
84. the current attribute linked attribute linked parent operation or parameter Enables the specification of a separator other than and a default value for when some value is required RIGHT lt src gt lt count gt The last lt count gt characters of lt src gt TO_LOWER lt string gt Converts lt string gt to lower case TO_UPPER lt string gt Converts lt string gt to upper case TRIM lt string gt TRIM lt string gt lt trimChars gt Removes trailing and leading white spaces from lt string gt If lt trimChars gt is specified all leading and trailing characters in the set of lt trimChars gt are removed TRIM_LEFT lt string gt TRIM_LEFT lt string gt lt trimChars gt Removes the specified leading characters from lt string gt O 1998 2010 Sparx Systems Pty Ltd 106 Code Template Framework in SDK Code Template Syntax TRIM_RIGHT lt string gt TRIM_RIGHT lt string gt lt trimChars gt Removes the specified trailing characters from lt string gt VB_COMMENT lt wrap_length gt Converts the notes for the element currently in scope to Visual Basic style comments WRAP_COMMENT lt comment gt lt wrap_length gt lt indent gt lt start_string gt Wraps the text lt comment gt at width lt wrap_length gt putting lt indent gt and lt start_string gt at the beginning of each line For example behavior WRAP_COMMENT opBehavior 40 Note
85. the current method Accesses a of type list of MethodTag objects MethodTag Read Write Exception information Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 251 jasoute faye os Visibility Read Write The method scope Public Protected Private or Package Method Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current method object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 6 7 MethodConstraint public Class A MethodConstraint is a condition imposed on a method It is accessed through either the Method PreConditions or Method PostConditions collection Associated table in EAP file t_operationores and t_operationposts MethodConstraint Attributes Attribute te Notes Cd name sera rosie me ranerne corran O Pos ern TT ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch A es interface Read Write The constraint type MethodConstraint Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Upd
86. this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current PropertyType object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 4 13 Reference public Class This Interface provides access to the various lookup tables within Enterprise Architect Use the Repository GetReferenceList method to get a handle to a list Valid lists are e Diagram e Element e Constraint e Requirement e Connector e Status e Cardinality e Effort e Metric e Scenario e Status e Test Reference Attributes Atribute Type Notes Count of items in the list ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch 1937 interface The list type for example Diagram Types Reference Methods GetAt short Index GetLastError Get the tem at the specified index Parameters e Index Short The index of the item to retrieve from the list Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 223 A Refresh Refresh the current list and return the count of items 7 2 4 14 Stereotype public Class The Stereotype e
87. this user csDeleted The package file has been deleted from version control VersionControlPutLatest j Perform a checkin of the version controlled package whilst string CheckInComment keeping the package checked out Throws an exception if the operation fails Use GetLastError to retrieve error information When a package that was previously marked as Checked Out Offline is successfully Put checkedin to version control that package s flags are updated to clear the Checked Out Offline indicator Parameters e Comment String Log message added to the version controlled file s history where applicable VersionControlRemove j Removes version control from the package Throws an exception if the operation fails Use GetLastError to retrieve error information VersionControlResynchPk Synchronizes the version control status of the single object gStatus boolean package recorded in your current model with the package ClearSettings status reported by your version control provider See Version Control Within UML Models Using Enterprise Architect Parameters e ClearSettings Boolean used if the package file associated with the specified package is reported by the version control provider as uncontrolled If ClearSettings is e True the version control settings are cleared from the package e False the version control settings remain unchanged 7 2 4 10 Projectissues public Class A system leve
88. to Enterprise Architect s inbuilt diagram types e UML Behavioral Use Case e UML Behavioral Activity e UML Behavioral State Machine e UML Behavioral Communication e UML Behavioral Sequence e UML Behavioral Timing e UML Behavioral Interaction Overview e UML Structural Package e UML Structural Class e UML Structural Object e UML Structural Composite Structure e UML Structural Component e UML Structural Deployment e Extended Custom e Extended Requirements e Extended Maintenance e Extended Analysis e Extended User Interface e Extended Data Modeling e Extended ModelDocument 1 2 10 Stereotype Profiles In Enterprise Architect 6 an MDG Technology could consist of many UML Profiles each representing an Enterprise Architect UML Toolbox page Each profile could include stereotype definitions alongside redefinitions of standard UML elements This meant that to define a stereotype in a technology it had to appear in one of the Toolbox pages Releases from Enterprise Architect 7 take a different approach splitting the task of defining the stereotypes and the task of defining the Toolbox pages into separate profiles The MDG Technology s stereotypes are contained in one or more profiles The stereotypes within each profile use the profile name as the namespace Create one or more packages with the profile stereotype each package name being the namespace Within Enterprise Architect Software Develope
89. to be used when exporting XMI Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 217 CE O Notes O Read Write The version of the package XMLPath String Read Write The path to where the XML is saved when using controlled packages Package Methods ApplyGroupLock string Boolean aGroupName ApplyUserLock Boolean LDISPATCH FindObject string LPDISPATC DottedID H GetLastError ReleaseUserLock Update Boolean VersionControlAdd string Applies a group lock to the package object for the specified group on behalf of the current user Throws an exception if the operation fails Use GetLastError to retrieve error information Parameter e aGroupName String The name of the security group for which to apply the lock Applies a user lock to the package object for the current user Throws an exception if the operation fails Use GetLastError to retrieve error information Inserts a copy of the package into the same parent as the original package Returns the newly created package Returns a package element attribute or operation matching the parameter DottedID If the DottedID is not found an error is returned Can t find matching object Parameter e DottedID String Is in the form object object object where object is replaced by the name of a package element attribute or operation Examples include MyNamesp
90. to store the style and wrap length options if style XML NET XML_COMMENT wrapLen else CSTYLE_COMMENT wrapLen endlf Reference to style as part of a condition Reference to wrapLen as an argument to function macro Example 2 Using variable references as part of a variable definitions ee Ha Define our variables foobar now contains the value foobar foobar foo bar Example 3 Substituting variable values into the output bases classinherits Store the result of the ClassInherits template in bases Class className bases Now output the value of bases after the Class name 5 2 The Code Template Editor in SDK The Code Template Editor window is introduced in Code Engineering Using UML Models The following topics describe how you use it to create custom templates e Custom Templates 1131 e Override Default Templates 120 e Add New Stereotyped Templates 124 e Create Templates For Custom Languages 122 The Code Template Editor provides the facilities of the Common Code Editor including intellisense for the code generation template macros 89 For more information on intellisense and the Common Code Editor see the Code Editors topic in Using Enterprise Architect UML Modeling Tool Enterprise Architect Software Developers Kit Code Template Framework in SDK The Code Template Editor in SDK 119 5 2 1 Custom Templates Custom templates enable you to generate an
91. turn the generation of global elements for all global ComplexTypes On or Off for example GenGlobalElement 1 GetBaselines string Returns a list in XML format of Baselines associated PackageGUID string with the supplied package GUID Optionally you can ConnectString provide a connection string to get Baselines from the same package but located in a different model file or DBMS Parameters e PackageGUID String the GUID in XML format of the package to get Baselines for ConnectString String the location of the EAP file or DBMS to get the Baselines from if not in the same model as the package GetDiagram string protected Gets diagram details in XML format DiagramGUID abstract String Parameters e DiagramGUID String the GUID in XML format of the diagram to get details for GetElement string protected Gets XML for the specified element ElementGUID abstract String Parameters e ElementGUID String the GUID in XML format of the element to retrieve XML for GetElementConstraints string protected Gets constraints for an element in XML format ElementGUID abstract String Parameters e ElementGUID String the GUID in XML format of the element GetElementEffort string protected Gets efforts for an element in XML format ElementGUID abstract String Parameters e ElementGUID String the GUID in XML format of the element GetElementFiles string protected Gets metrics
92. user interface status information Return Value None 6 5 12 6 EA_OnlmportTechnology Deprecated refers to deleting a technology through the Resources window this process is no longer recommended See e EA OnPreActivate Technologyl15 e EA OnPostActivate Technologyl15 e EA OnlnitializeTechnologies 152 Details EA_OnlmportTechnology notifies Add Ins that you have imported an MDG Technology resource into the model This event occurs after you have imported an MDG Technology resource into the model Add Ins that require an MDG Technology resource to be loaded can catch this Add In to enable certain functionality Syntax Sub EA_OnlmportTechnology Repository As EA Repository Info As EA EventProperties The EA_OnImportTechnology function syntax contains the following elements ES CN Contains the following EventProperty objects EveniFroperties EventPro entes e TechnologyID A string value corresponding to the MDG ee Technology ID Repository EA Repository 197 An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value None 6 5 13 Context Item Events Enterprise Architect Add Ins can respond to the following events associated with changing context e EA OnContextitemChanged 155 e EA OnContextltemDoubleClickedl156 e EA OnNotifyContextltemModified 157 6 5 13 1 EA_OnContextltemChanged Det
93. v Pattems v MDA Transforms v Diagram Types Y Toolboxes Reports v Taskpages V RTF Templates v Tagged Value Types Y Linked Document Templates Other Y Images 7 Select the checkbox for each item to be included in the MDG Technology file Each selection runs specific dialogs to enable definition of the specific items to be included in the MDG Technology as O 1998 2010 Sparx Systems Pty Ltd 34 MDG Technologies in SDK Create MDG Technologies described in the following topics e Add a Profile 357 e Add a Pattern 354 e Add a Diagram Profile 367 e Add a Toolbox Profile 374 e Add Task Panel Pages 35 e Add Tagged Value Types 39 e Add Code Modules 40 e Add MDA Transformations 427 e RTF Report Templates 44 e Linked Document Templates 45 e Add Images 43 e Add Scripts 434 Corporate and Suite editions 8 Work through the dialogs displayed in response to your choices and when all are complete click on the Next button The MDG Technology Wizard Finish screen displays providing information on the items included in the MDG Technology File MDG Technology Wizard Finish Review the list of actions that are about to be performed click Finish to create the Technology file Summary information for MDG Technology MDG Technology For Workflows Version 0 1 ID WKFL Filename Y Dev Roy UML Profiles WKFL MDG Technology For Workflows xml Notes Technology to
94. 129 manage constraints for an element demonstrate addnew and delete o element Constraints AddNew Appended Type If not o Update Then Console WriteLine Constraint error o GetLastError End if element Constraints Refresh For idx 0 to element Constraints Count 1 O element Constraints GetAt idx Console WriteLine o Name If o Name Appended Then Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 289 If bDel Then element Constraints Delete idx End if Next efforts o element Efforts AddNew Appended Type If not o Update Then Console WriteLine Efforts error o GetLastError End if element Efforts Refresh For idx 0 to element Efforts Count 1 O element Efforts GetAt idx Console WriteLine o Name If o Name Appended Then If bDel Then element Efforts Delete idx End if Next Risks o element Risks AddNew Appended Type If not o Update Then Console WriteLine Risks error o GetLastError End if element Risks Refresh For idx 0 to element Risks Count 1 O element Risks GetAt idx Console WriteLine o Name If o Name Appended Then If bDel Then element Risks Delete idx End if Next Metrics o element Metrics AddNew Appended Change If not o Update Then Console WriteLine Metrics error o GetLastError End if element Metrics Refresh For idx 0 to element Metrics Count 1 O element
95. 165 poroto e ron Deepen ooo i MethodGUID String IN The GUID of the method that owns the given parameter Use the Repository GetMethodByGuid method to retrieve the method object ObjectID Long IN The ID of the object that owns the given parameter Use the Repository GetObjectByID method to retrieve the object Repository ParameterGUI String IN The GUID of the parameter to potentially perform validation D on Use it to retrieve the parameter by iterating through the Method Parameters collection IN EA An EA Repository object representing the currently open Repositor Enterprise Architect model Poll its members to retrieve model T data and user interface status information String IN The ID that was passed into the Project DefineRule command 6 5 15 11 Model Validation Example The following example code is written in C and provides a skeleton model validation implementation that you might like to use as a starting point in writing your own model validation rules Main cs using System namespace myAddin public class Main public Rules theRules public Main public string EA_Connect EA Repository Repository public void EA_Disconnect theRules new Rules return GC Collect GC WaitForPendingFinalizers private bool IsProjectOpen EA Repository Repository try EA Collection c Repository Models return true return false public object
96. 307 C45586000000 2 2 0 Program Files Sparx Systems EA EA TLB Enterprise Architect Object Model 2 02 If you experience problems moving from one version of Enterprise Architect to another open the VBP file in a text editor and remove this line Then open the project in Visual Basic and use Project References to create a new reference to the Enterprise Architect Object model Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Add In Tasks 127 Add In Fails to Load From Enterprise Architect release 7 0 Add Ins created before 2004 are no longer supported If an Add In subscribes to the Addn_Tmpl tlb interface 2003 style it will fail on load In this event contact the vendor or author of the Add In and request an upgrade Holding State Information It is possible for an Add In to hold state information meaning that data can be stored in member variables in response to one event and retrieved in another There are some dangers in doing this e Enterprise Architect Automation Objects do not update themselves in response to user activity to activity on other workstations or even to the actions of other objects in the same automation client Retaining handles to such objects between calls can result in the second event querying objects that have no relationship with the current state of Enterprise Architect e When you close Enterprise Architect all Add Ins are asked to shut
97. 7 dockable string Makes the shape default to dockable so that it can be aligned with and joined to other elements both other Shape Scripts and standard elements on a diagram You cannot reverse the dockable status with the Appearance menu option to change the status you must edit the Shape Script Valid values standard or off editableField string Defines a shape as an editable region of the element This field impacts element shapes only line glyphs are not supported Valid Values alias name note stereotype endPointY integer Only used for the reserved target and source shapes for connectors this endPointX point determines where the main connector line connects to the end shapes Default O and 0 fixedAspectRatio string Set to true to fix the aspect ratio Do not use if you do not want to fix the aspect ratio string Affects horizontal placement of printed text and subshapes depending on the layoutType attribute Valid values left center or right layoutType string Determines how subshapes are sized and positioned See Subshape Layout 75 for further details Valid values leftright topdown border leftAnchorOffset int int When creating a Shape Script for an embedded element such as a Port use this attribute to offset the shape from the left edge of its parent For example leftAnchorOffset 10 0 move embedded element right 10 pixels from the left edge noShadow string Set to true to sup
98. 70 MDG Events 170 MDG_BuildProject 171 MDG_Connect 171 MDG_Disconnect 172 MDG_GetConnectedPackages 173 MDG_GetProperty 173 MDG_Merge 174 MDG_NewClass 175 MDG_PostGenerate 176 MDG_PostMerge 176 MDG_PreGenerate 177 MDG_PreMerge 177 MDG _PreReverse 178 MDG_Run_Exe 179 MDG View 179 MDG Events Add In Model 170 MDG_BuildProject 171 MDG_Connect 171 MDG_Disconnect 172 MDG_GetConnectedPackages 173 MDG_GetProperty 173 MDG_Merge 174 MDG_NewClass 175 MDG_PostGenerate 176 MDG_PostMerge 176 MDG_PreGenerate 177 MDG_PreMerge 177 MDG _PreReverse 178 MDG _Run_ Exe 179 MDG View 179 MDG Technology Create 30 Create Toolbox Profile For 47 Define Tasks Pane Profile 54 Define Validation Configuration 58 Deploy From Add In 59 Deploy From File 59 Example Of Development 30 InSDK 30 Include Custom Diagram Types 52 Incorporate Model Template 59 MDG Technology Selection MTS File 46 MDG Technology Wizard Add Code Modules 40 Add Diagram Type To Technology 36 Add Images 43 Add Linked Document Template To Technology 45 Add MDA Transforms 42 Add Pattern To Technology 35 Add Profile To Technology 35 Add RTF Report Template To Technology 44 Add Scripts 43 Add Tagged Value Types 39 Add Task Panel To Technology 38 Add Toolbox To Technology 37 Create Technologies 30 MDG_BuildProject Add In Model 171 MDG_Connect Add In Model 171 MDG_Disconnect Add In Model 172 MDG_GetConnectedPackages Add In Model 173 MDG_GetProperty Add In Mod
99. A modal dialog e VB DoEvents NET Application DoEvents or the equivalent in other languages In such cases Enterprise Architect could initiate a second Add In method before the first returns re entrancy In release 7 0 and subsequent releases Enterprise Architect cannot make such concurrent calls If developing Add Ins ensure that the Add In users are running Enterprise Architect release 7 0 or a later release to avoid any risk of concurrent method calls 6 2 The Add In Manager You can use the Add In Manager to view what Add Ins are available and to disable those not to be used Access the Manage Add Ins dialog by selecting the Add Ins Manage Add Ins menu option Available Add Ins Status Load on Startup IDODAF MODAF Enabled M Zachman Framework Enabled M To enable an Add In for use select the Load on Startup check box To disable an Add In deselect the checkbox Note Enterprise Architect must be restarted for changes to take effect 6 3 Add In Search Enterprise Architect enables Add Ins to integrate with the Model Search see Using Enterprise Architect UML Modeling Tool Searches can be defined that execute a method within your Add In and display your results in an integrated way The method that runs the search must be structured in the following way variant lt method name gt Rep as Repository SearchText as String XMLResults as String Rep The currently open repository SearchText An optional
100. A_OnDeleteTechnology EA Repository Repository EA EventProperties Info public void EA_OnImportTechnology EA Repository Repository EA EventProperties Info private void DoTest EA Repository Rep theRules RunDiagramRule Repository RulelD IDiagramID theRules RunConnectorRule Repository RulelD IConnectorlD IObjectID return return return TODO insert test code here Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 167 Rules cs using System using System namespace m Collections yAddin public class Rules Rules private string m_sCategorylD private System Collections ArrayList m_RulelDs private System Collections ArrayList m_RulelDEx private const string cRule01 Rule01 private const string cRule02 Rule02 private const string cRule03 Rule03 TODO expand this list as much as necessary public Rules m_RulelDs new System Collections ArrayList m_RulelDEx new System Collections ArrayList private string LookupMap string sKey return DoLookupMap sKey m_RulelDs m_RulelDEx private string LookupMapEx string sRule private string DoLookupMap string sKey ArrayList arrValues ArrayList arrKeys return DoLookupMap sRule m_RulelDEx m_RulelDs if arrKeys Contains sKey return arrValues arrKeys IndexOf sKey ToString else ret
101. App as EA App Set App GetObject EA App MsgBox App Repository Models Count Another example which uses the App object without saving it to a variable Dim Rep as EA Repository Set Rep GetObject EA App Repository MsgBox Rep ConnectionString Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 191 7 2 3 Enumerations These enumerations are defined by the Automation Interface e Constl ayoutStyles 19 e CreateBaselineFlag l192 e CreateModelType 192 e EAEditionTypes 19 e EnumRelationSetType 192 e ExportPackageXMIFlag 19 e MDGMenus 193 e ObjectTypel 193 e PropTypel19 e ReloadTypel194 e ScenarioDiagramType 194 e ScenarioStepType 19 e ScenarioTestType 1951 e XMIType 19 7 2 3 1 ConstLayoutStyles Enum The enum values defined here are used exclusively for the Lay Out a Diagram method They enable you to define the layout options as depicted in the Layout a Diagram menu option For further information see the Lay Out a Diagram topic in UML Modeling With Enterprise Architect UML Modeling Too IsCrossReduceAggressive Perform sisi Cross reduction in the layout process time consuming O 1998 2010 Sparx Systems Pty Ltd 192 Enterprise Architect Object Model Reference 7 2 3 2 CreateBaselineFlag Enum The CreateBaselineFlag enumeration is used in Baseline Management when creating a Baseline cbSaveToStub
102. AttributeConstraint 246 AttributeTag 247 CustomProperties Collection 248 Diagram 243 EmbeddedElements Collection 248 Method 249 MethodConstraint 251 MethodTag 252 Parameter 252 Partitions Collection 253 Properties 254 Property 254 Transitions Collection 255 EmbeddedElements Collection Enterprise Architect Software Developers Kit Index 303 EmbeddedElements Collection Access Data from Attributes 90 Automation Interface ElementFeatures Package Access Data from Classes 90 248 Access Data from Operations 90 Enable Access Data from Packages 90 Add Ins 128 Access Data from Parameters 90 Enterprise Architect Conditional Substitution 90 Add In Model 123 Direct Substitution 90 Object Model Introduction 181 File SDK Introduction 2 Element Package Automation Interface 235 Enterprise Architect Simulation Library Function Behavioral Model Templates 109 Macros Code Template Syntax 103 EASL Code Generation 109 EASL_GET Macro 109 EASLList Macro 109 H Enumeration Automation Interface 191 Hidden Submenu ConstLayoutStyles 191 Create In Toolbox Profile 48 CreateBaselineFlag 192 CreateModelType 192 EnumRelationSetType 192 ExportPackageXMIFlag 193 Icon MDGMenus 193 Project Browser User Defined 19 ObjectType 193 Icons PropType 194 For Toolbox ltems Assign 49 ReloadType 194 Image ScenarioDiagramType 194 Add To MDG Technology 43 ScenarioStepType 195 Import ScenarioTestlype 195 Code Templates 119 XMIT
103. Baseline this package with only immediate children Child packages are included as stubs only 7 2 3 3 CreateModelType Enum The CreateModelType enumeration is used in the CreateModell20h method on the Repository class cmEAPFromBase Create a copy of the EABase model file to the specified file path cmEAPFromSQLRepository Create a eap file shortcut to an SQL based repository Requires user interaction to provide sql connection details 7 2 3 4 EAEditionTypes Enum The EAEditionTypes enumeration identifies the level of licensed functionality available to the current repository For example EAEditionTypes theEdition theRepository GetEAEdition if theEdition EAEditionTypes piDesktop else if theEdition EAEditionTypes piProfessional The enumeration defines the following formal values e piLite e piDesktop e piProfessional e piCorporate e piBusiness e piSystemEng e piUltimate There is no separate value for the trial edition the Repository EAEdition attribute contains the appropriate EAEditionTypes value for whichever edition the user has selected to trial 7 2 3 5 EnumRelationSetType Enum This enumeration represents values returned from the GetRelationSet method of the Element 228 object rsDependEnd List of elements that depend on the current element rsDependStart List of elements that the current element depends on rsGeneralizeEnd List of elements that are generalized by the current element
104. Category string String Defines a category of rules that can be performed during model validation there is typically one category Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 273 memod O CategoryName per Add In lt must be called once from the EA_OninitializeUserRules 160 broadcast handler The return value is a Categoryld that must to be passed to the DefineRule 27 gt method See Model Validation Example t5i for a detailed example of use of this method Parameters e CategoryName String a text string that is visible in the Model Validation Configuration dialog DeleteBaseline string Boolean Deletes a Baseline identified by the BaselineGUID BaselineGUID from the repository Parameters e BaselineGUID String the GUID in XML format of the Baseline to delete DoBaselineCompare String Performs a Baseline comparison using the supplied string PackageGUID string package GUID and Baseline GUID obtained in the Baseline string ConnectString result list from GetBaselines 277 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 275 automatically merging information from the Baseline Parameters Packa
105. Class and click on the Save button Once the stereotype is saved it displays in the list To override the appearance select the Shape Script radio button and then click on the Assign button The Shape Script Editor 647 displays shape main rectangle 0 0 100 100 Enterprise Architect Software Developers Kit Shape Scripts Getting Started With Shape Scripis 63 Type the example Shape Scripts in the Edit window You can click on the Refresh button in order to view the shape in the preview window Note If you define a composite Shape Script such as the connector at the end of the Example Scriots 7 topic click on the Next Shape button to page through the components of the shape Once you have finished writing your Shape Script 65 click on the OK button To save the Shape Script you must click on the Save button on the Stereotypes tab Once you have created your Shape Script for a particular stereotype you can assign that stereotype to an element or connector The appearance reflects the Shape Script you created To do this drag and drop the appropriate element or connector into your diagram Note If an element s appearance is modified by a Shape Script many of the options on the Advanced context menu for that element are disabled see UML Modeling With Enterprise Architect UML Modeling Tool Right click on the element or connector and select the Properties context
106. Code Templates Editor tab the new template displays in the Templates list with the value Yes in the Modified field The template is called lt Template Type gt _ lt Template Name gt 7 Select the appropriate template from the Templates list and edit the contents in the Template field to meet your requirements 1998 2010 Sparx Systems Pty Ltd 120 Code Template Framework in SDK The Code Template Editor in SDK Language Template Java X Templates New Language Name Class Parameter Attribute Attribute Notes Attribute Declaration Import Import Impl Import Section Import Section Impl Linked Attribute Linked Attribute Notes Linked Attribute Declaration Linked Class Base Linked Class Interface Operation Operation Impl Operation Notes Operation Notes Impl Operation Declaration Operation Declaration Impl Operation Body Operation Body Impl Parameter Parameter Impl Rule Task Rulet Rule Condition Rule Action Compute Rulet Compute Action Action Action Assignment i m j gt Stereotype Overrides Class Feature Modified No No No topTag Attribute topTag annotations PI 3 dd dd dd 3CONVERT_SCOPE opScope S3opTag native true native 3 3opSynchronized T synchronized 3 3opAbstract T 2 abstract 3 topStatic T static topConst T 2 final 3 topReturnTypettopReturnArray I 2 MS 3opTag g
107. EA_GetMenultems EA Repository Repository string MenuLocation string MenuName switch MenuName m case 1998 2010 Sparx Systems Pty Ltd 166 Enterprise Architect Add In Model Broadcast Events return amp myAddin case amp myAddin string ar amp Test return ar return public void EA_GetMenuState EA Repository Repository string MenuLocation string MenuName string ItemName ref bool IsEnabled ref bool IsChecked if no open project disable all menu options if IsProjectOpen Repository IsEnabled true else IsEnabled false public void EA_MenuClick EA Repository Repository string MenuLocation string MenuName string ItemName switch ItemName case amp Test DoTest Repository break public void EA_OnlnitializeUserRules EA Repository Repository if Repository null theRules ConfigureCategories Repository theRules ConfigureRules Repository public void EA_OnRunElementRule EA Repository Repository string RulelD EA Element element theRules RunElementRule Repository RulelD element public void EA_OnRunDiagramRule EA Repository Repository string RulelD long IDiagramID public void EA_OnRunConnectorRule EA Repository Repository string RulelD long IConnectorID public void EA_OnRunAttributeRule EA Repository Repository string RulelD string AttGUID long public void E
108. Framework in SDK Code Template Syntax e Or Note When specifying multiple conditions and and or have the same order of precedence and conditions are processed left to right The endifor endTemplate macros must be used to signify the end of a branch In addition the endTemplate macro causes the template to return immediately if the corresponding branch is being executed Example if elemType Interface Helse OperationBody endlf Example bases list ClassBase separator interfaces list ClassInterface separator if fbases and interfaces bases interfaces elself fbases bases elself finterfaces interfaces endlf The PI Macro There are two primary means of generating whitespace from the templates e Explicitly using the newline space and tab characters n t as part of Literal Text e Using the P macro to format lines in the template that result in non empty substitutions in the output By default each template line that generates a non empty substitution also results in a newline being produced in the output This behavior can be changed through the PI macro To demonstrate the use of the P macro consider the default C Operation template opTag Attribute Default Pl is n so any attributes would be on their own line oP la o Blank lines have no effect on the output o o opTag unsafe true unsafe Set the
109. Framework in SDK Code Template Syntax 99 Or lt lt dialog Const checkbox EXT The unique GUID for the current The unique GUID for the current operation oplmplMacros A space separated list of macros defined in the implementation of this operation oplsQuery Operation dialog IsQuery checkbox opMacros A space separated list of macros defined in the declaration for this operation Operation dialog Name opReturnQualType The operation return type qualified by the namespace path if generating namespaces and the classifier path dot delimited If the return type classifier has not been set is equivalent to the opReturnType macro scope Each package name is separated by a dot 1998 2010 Sparx Systems Pty Ltd 100 Code Template Framework in SDK Code Template Syntax paramClassifierGUID The unique GUID for the classifier of the current parameter paramQualType The parameter type qualified by the namespace path if generating namespaces and the classifier path dot delimited If the parameter classifier has not been set is equivalent to the paramType macro Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 101 resourceExpendedTime Project Management window Resource Allocation tab Time Expended scenarioGUID The unique ID for a scenario Identifies the scenario unambiguously within a model Properties d
110. G_Connect function syntax contains the following elements CAC CT PackageGui String IN The unique ID identifying the project provided by the Add In d when a connection to a project branch of an Enterprise Architect model was first established PackagelD Long The PackagelD of the Enterprise Architect package the user has requested to have connected to an external project Repository An EA Repository object representing the currently open is Enterprise Architect model Poll its members to retrieve model 19A data and user interface status information Return Value 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 6 7 1 3 MDGDisconnect Details MDG_Disconnect enables the Add In to respond to user requests to disconnect the model branch from an external project This function is called when the user attempts to disconnect an associated external project The Add In is required to delete the details of the connection Also look at MDG_Connectl 17h Syntax Function MDG_Disconnect Repository As EA Repository PackageGuid As String As Long The MDG_Disconnect function syntax contains the following elements pre Join p oe String The GUID identifying the Enterprise Architect package sub tree that is controlled by the Add In EA Repository An EA Repository object representing the currently open Repositor Enterprise Archit
111. Holding State Information 127 above or e It has been created by NET and the GC mechanism hasn t got around to releasing it There are two actions required to avoid deadlock situations e Automation controllers must call Repository CloseAddins at some point presumably at the end of processing e Add Ins must release all references to Enterprise Architect in the Disconnect event See the Add In Methods 129 topic for details It is possible that your Automation client controls a running instance of Enterprise Architect where the Add Ins have not complied with the rule above In this case you could call Repository Exit to terminate Enterprise Architect Miscellaneous In developing Add Ins using the Net framework you must select COM Interoperability in the project s properties in order for it to be recognized as an Add In Some development environments do not automatically register COM DLLs on creation You might have to do that manually before Enterprise Architect recognizes the Add In You can use your private Add In key as required for Add In deployment to store configuration information pertinent to your Add In Concurrent Calls In Enterprise Architect releases up to release 7 0 there is a possibility that Enterprise Architect could call two 1998 2010 Sparx Systems Pty Ltd 128 Enterprise Architect Add In Model Add In Tasks Add In methods concurrently if the Add In calls e A message box e
112. IICK E E E A A 132 EA_OnOutputltemClicked we 133 EA_OnOutputltemDoubleClicked ccocooccoconocnnonocanonccnnanonnnononnnononnnnnonnnnnnnnnnnnnnnnnnn nana nnnnnn cnn nnnnnnnnnnnnns 133 EA Saa 134 Broadcast EVents ii aiii 135 EA lee de 135 EA_FileClose s m 136 EX A A as 136 EA_OnPostCloSeDiagram csccccccccscessescesecscssenscnscsscsscscscscecsecseesecsscssesseseessessessessnasesnecnesseeaeeneeas 137 EA OnPostOpenDiag rants s 4 0 iets ias eenaa aAa a EEEE e 137 Fee eta AET a e A cl ahdeas ed va CA A 138 EA OnPreDeleteEle Meier A eae pa aa nic 138 EA OnPreDeleteAttribute viii ii 138 EA OnPreDeleteMeth Od ss tet ceccentevtenesceepessnisuci eenensencinnia widen ibewiventenagaad IO ad 139 EA_OnPreDeleteConnector 139 EA OnPreDeleteDiagraim cui as 140 EA OnPreDelotePackage viii a A aad a eden edie ee aaa te 141 o A EAN 141 EA OnPreNewElementarnacio AAA ed Rend lee 141 EA O PreNewConnectorn ossodes a ied ane 142 EA OnPreNeWwDiagr Mica edi HOO Ale ea AEE RE eta eatin abe uaa 143 EA OnPreNewDiagramObject cwoiiciiormorniiaiic e ad id 143 EA_OnPreNewaAttribute 144 EA OnPreNewMethod eric dalt 145 EA OnPreNewPackade u excitada ea tidad 145 EA ONPreExiNStANCe ai ceci 146 POSEEN ENS us a ES a A TAE E avia 146 EA OnPostiNewEleMentusui da A Aneto SEAS 147 EA OnPostNewConneclO Ri ici iris 147 EA OnPostNewDiagram sieis sao add 148 EA_OnPostNewDiagraMObjeCt coococncnnccinnnnccncnnoccccnconnnnnnonc cnn nnnn cnn
113. L String the build script XML data which you can export from within Enterprise Architect Installs a given MDG Technology resource into the repository Returns True if the technology is successfully loaded into the model Otherwise returns False Note 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 See Deploying MDG Technologies 607 from Add Ins Parameters e Technology String the contents of the technology resource file Checks whether a named Enterprise Architect tabbed view is open and active This includes open diagram windows or custom controls added using Repository AddTab 199 Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 207 IsTechnologyEnabled string 1D IsTechnologyLoaded string 1D OpenDiagram long DiagramID OpenFile string Filename OpenFile2 string FilePath string Username string Password Returns e 2 to indicate that a tab is open and active top most e 1 to indicate that it is open but not top most or e 0 to indicate that it is not visible at all Note TabName is case sensitive Parameters e TabName String the name of the tab to check for Boolean Checks whether a specified technology is enabled in Enterprise Architect Returns True if the MDG
114. L format LoadProject string FileName protected Loads an Enterprise Architect project file Do not use abstract this method if you have accessed the Project interface Boolean from the Repository which has already loaded a file Parameters e FileName String the name of the project file to load MigrateToBPMN11 string Migrates every BPMN 1 0 construct in a package or an GUID string Type element including elements attributes diagrams and connectors to BPMN 1 1 Parameters e 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 BPMN migrate to BPMN 1 1 BPEL migrate to BPMN 1 1 and update e any diagram with stereotype BPMN to BPEL any element with stereotype BusinessProcess to BPELProcess Note Migrating to BPEL is possible only in the Ultimate or Business and Software Engineering editions of Enterprise Architect PublishResult string Returns the results of each rule that can be performed CategorylD EA during model validation It must be called once for EnumMVErrorType ErrorType each rule from the EA_OniInitializeUserRules 16 string ErrorMessage broadcast handler The return value is a Ruleld which can be used for reference purposes when an individual rule is executed by Enterprise Architect during model validation See Model Validation Exam
115. Metrics GetAt idx Console WriteLine o Name If o Name Appended Then If bDel Then element Metrics Delete idx End if Next TaggedValues O element TaggedValues AddNew Appended Change If not o Update Then Console WriteLine TaggedValues error o GetLastError End if element TaggedValues Refresh For idx 0 to element TaggedValues Count 1 o element TaggedValues GetAt idx Console WriteLine o Name If o Name Appended Then If bDel Then element TaggedValues Delete idx End if Next Scenarios o element Scenarios AddNew Appendea Change If not o Update Then Console WriteLine Scenarios error o GetLastError End if element Scenarios Refresh For idx 0 to element Scenarios Count 1 O element Scenarios GetAt idx Console WriteLine o Name If o Name Appended Then If bDel Then element Scenarios Delete idx End if 1998 2010 Sparx Systems Pty Ltd 290 Enterprise Architect Object Model Reference Next Files o element Files AddNew MyFile doc If not o Update Then Console WriteLine Files error o GetLastError End if element Files Refresh For idx 0 to element Files Count 1 O element Files GetAt idx Console WriteLine o Name If o Name MyFile Then If bDel Then element Files Delete idx End if Next Tests O element Tests AddNew TestPlan Load If not o Update Then Console WriteLine Tests error o GetLastErr
116. Model Validation Broadcasts Add In Model 161 EA_OnlmportTechnology Technology Events Add In Model 155 EA_OnlnitializeTechnologies Technology Events Add In Model 152 EA OnlnitializeUserRules Model Validation Broadcasts Add In Model 160 EA_OnNotifyContextltemModified Context Item Events Add In Model 157 EA_OnOutputltemClicked Add In Event 133 EA_OnOutputltemDoubleClicked Add In Event 133 EA_OnPostActivateTechnology Technology Events Add In Model 153 EA_OnPostCloseDiagram Broadcast Events Add In Model 137 EA OnPosilnitialized Broadcast Events Add In Model 151 EA OnPostNewAttribute Post New Events Add In Model 149 EA OnPostNewConnector Post New Events Add In Model 147 EA_OnPostNewDiagram Post New Events Add In Model 148 EA_OnPostNewDiagramObject Post New Events Add In Model 148 EA OnPostNewElement Post New Events Add In Model 147 EA OnPostNewMethod Post New Events Add In Model 149 EA_OnPostNewPackage Post New Events Add In Model 150 EA_OnPostOpenDiagram Broadcast Events Add In Model 137 EA OnPostTransform Broadcast Events Add In Model 151 EA _OnPreActivate Technology Technology Events Add In Model 1 EA OnPreDeleteAttribute Pre Deletion Events Add In Model EA OnPreDeleteConnector Pre Deletion Events Add In Model EA_OnPreDeleteDiagram Pre Deletion Events Add In Model EA OnPreDeleteElement Pre Deletion Events Add In Model EA OnPreDeleteMethod Pre Deletion Events Add In Model EA_OnPr
117. Namedltem GUID nodeValue 8_sc_ Next End Select If there s no data to display then don t return any compartment data If sData lt gt Then sCompartmentData sCompartmentData CompartmentData sData Else sCompartmentData End If EA_GetCompartmentData sCompartmentData Exit Function ERR_GetCompartmentData EA_GetCompartmentData End Function 6 5 15 Model Validation Broadcasts Perform Model Validation from an Add In Using Enterprise Architect broadcasts it is possible to define a set of rules that are evaluated when the user instructs Enterprise Architect to perform model validation An Add In that performs model validation would involve the following broadcast events e EA OninitializeUserRules 160 is intercepted in order to define rule categories and rules e EA OnStartValidationlst can be intercepted to perform any required processing prior to validation e The following functions intercept each request to validate an individual element package diagram connector attribute and method e EA OnRunElementRulel162 e EA OnRunPackageRulels e EA OnRunDiagramRule 162 e EA OnRunConnectorRulel 165 e EA OnRunAttributeRule 163 e EA OnRunMethodRule 16 e EA OnEndValidation 1 h can be intercepted to perform any required clean up after validation has completed Also consider the Model Validation Example 165 6 5 15 1 EA_OnInitializeUserRules Details EA_OnlnitializeUserRules is c
118. Object ObjectiD Repository 4 Repositoryl19 An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True if the element has been updated during this notification Return False otherwise 6 5 9 5 EA_OnPostNewAttribute Details EA_OnPostNewAttribute notifies Add Ins that a new attribute has been created on a diagram It enables Add Ins to modify the attribute upon creation This event occurs when a user creates a new attribute on an element by either drag dropping from the Project Browser using the Attributes Properties dialog or using the in place editor on the diagram The notification is provided immediately after the attribute is created Set Repository SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs Also look at EA_OnPreNewaAttributel144 Syntax Function EA_OnPostNewAttribute Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPostNewAttribute function syntax contains the following elements CE CE CC Contains the following EventProperty objects for the new ici attribute 21 e AttributelD A long value corresponding to Attribute AttributelD Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user inte
119. OnRunMethodRule function syntax contains the following elements CC owen Ei MethodGUI String IN The GUID of the method to potentially perform validation on D Use the Repository GetMethodByGuid method to retrieve the method object ObjectID Long IN The ID of the object that owns the given method Use the Repository GetObjectBy D method to retrieve the object Repository EA Repository IN An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Ruled String O JIN The ID that was passed into the Project DefineRule command 6 5 15 10 EA_OnRunParameterRule Details This event is triggered once for each rule defined in EA OnlnitializeUserRules 160 to be performed on each parameter in the selection being validated If you don t want to perform the rule defined by RulelD on the given parameter then simply return without performing any action On performing any validation if a validation error is found use the Repository ProjectInterface PublishResult method to notify Enterprise Architect Syntax Sub EA_OnRunParameterRule Repository As EA Repository RulelD As String ParameterGUID As String MethodGUID As String ObjectID As Long The EA_OnRunMethodRule function syntax contains the following elements Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events
120. Pl so keywords are separated by a space CONVERT_SCOPE opScope i opTag new true new Any keyword that does not apply that is the macro opAbstract T abstract produces an empty result does not result in a space opConst T sealed opStatic T static opTag extern true extern opTag delegate true delegate opTag override true override opTag virtual true virtual nly on i ner for this lin opReturnType opReturnArray T Only one space is generated for this line opStereotype operator operator opName list Parameter separator f a The final line in the template does not generate a space In the above example macros for the various keywords are to be arranged vertically for readability In the output however each relevant keyword is to be separated by a single space This is achieved by the line Pl Notice how you do not specify the space between each of the possible keywords This space is already implied by setting the Pl to a single space Essentially the Pl acts as a convenience mechanism for formatting the output from within the templates The structure for setting the processing instruction is Pl lt value gt where lt value gt can be a literal string enclosed by double quotes Enterprise Architect Software Developers Kit Code Template Framework in SDK Co
121. Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value None 6 5 14 Compartment Events Enterprise Architect Add Ins can respond to the following events associated with user generated element compartments e EA QueryAvailableCompartments 158 e EA GetCompartmentData tss 6 5 14 1 EA_QueryAvailableCompartments Details This event occurs when Enterprise Architect s diagrams are refreshed It is a request for the Add In to provide a list of user defined compartments The EA_GetCompartmentDatal155 event then queries each object for the data to display in each user defined compartment Syntax Function EA_QueryAvailableCompartments Repository As EA Repository As Variant The EA_QueryAvailableCompartments function syntax contains the following elements renew fe Joron owen oE Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value A String containing a comma separated list of user defined compartments Example Function EA_QueryAvailableCompartments Repository As EA Repository As Variant Dim sReturn As String sReturn If m_FirstCompartmentVisible True Then sReturn sReturn first End If If m_SecondCompartmentVisible True Then sReturn
122. Rose10 xmiRose11 xmiRose12 xmiMOF13 xmiMOF14 xmiEA20 xmiEA21 1998 2010 Sparx Systems Pty Ltd 19 Enterprise Architect Object Model Reference 7 2 4 Repository public Package The Repository package contains the high level system objects and entry point into the model itself using the Models collection and the other system level collections This diagram illustrates the Repository 19 and its first level functions and collections Collection Reference i Resources 0 NX ProjectResource SS Clients Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 197 7 2 4 1 Repository public 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 lt also has some convenient methods to directly access the structures without having to locate them in the hierarchy first Associated table in EAP file lt none gt Repository Attributes Collection zih Read only The system Authors collection 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
123. String ItemName As String The EA_GetMenuClick function syntax has the following elements CCC recon owner Ei ps Oo The name of the option actually clicked for example Create a Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Add In Events 133 pare ie pesen eres A ree String The name of the parent menu for which sub items are to be defined In the case of the top level menu it is an empty string Repository 4 Repository IN An EA Repository object representing the currently open 19A Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value None 6 4 6 EA_OnOutputltemClicked Details EA_OnOutputltemClicked events inform Add Ins that the user has clicked on a list entry in the system tab or one of the user defined output tabs Usually an Add In responds to this event in order to capture activity on an output tab they had previously created through a call to Repository AddTab Note that every loaded Add In receives this event for every click on an output tab in Enterprise Architect irrespective of whether the Add In created that tab Add Ins should therefore check the TabName parameter supplied by this event to ensure that they are not responding to other Add Ins events Also look at EA_OnOutputltemDoubleClicked 135 Syntax EA_OnOutputltemClicked Repository As EA Repository TabName
124. Tagged Value Types 81 e Code Template Framework 88 e Enterprise Architect Object Model Automation Interface 18h e Enterprise Architect Add In Model 123 Enterprise Architect Software Developers Kit Developing Profiles 3 1 Developing Profiles gt ll 9 Introduction UML Profiles provide a means of extending the UML Language which enables you to build UML models in particular domains They are based on additional stereotypes 31 and Tagged Values 81 that are applied to UML elements connectors and their components A Profile is a collection of such extensions that together describe some particular modeling problem and facilitate modeling constructs in that domain UML Profiles for Enterprise Architect are specified in XML files with a specific format These XML files can be imported into Enterprise Architect through the Resources window The imported Profile also automatically generates a page of elements and relationships in the Enterprise Architect UML Toolbox The Resources window contains a tree structure with entries for items such as MDG Technologies Documents Stylesheets Matrix profiles and UML Profiles The UML Profiles node initially contains no entries to be able to use Profiles you must import them into Enterprise Architect from supplied XML files ltems in the Profile represent stereotypes UML supports a large number of stereotypes which are an inbuilt mechanism for logically extend
125. Task Panel Pages Add Tagged Value Types cs irocic Entes 39 Add Code Modules gt iooiicoian at A a 40 ADA MDA TranstOrms E Aaa 42 Add AMAS todos 43 Add Scripts 43 Add RTF Report Templates vi sssccccececent tented ater enne eee datada caf eet 44 Add Linked Document Templates c ccccccccscsscsscssesseseseessessnscessesenecnececnecsecsecasesecaecaseascaecascaecaseaseas 45 Working with MTS Files cccco ww 46 Customize Toolbox Profiles 47 Create Toolbox Profiles mitra ea 47 Toolbox Page Altributes viii ii ida da cuss ic Ea aaen aa aaaea aadA ia iaa 48 Create Hidden SubiMenUS ori ia 48 Override Default TOO DOXES c0oooooooononnoncononncnnonconconcnncnncnnnnncnnnnnnnnnnnnnn nro nnnnnnnnn rre nen nen nen ren rnn nene 49 Assign ICONS To TOOIDOX leMS cccconconccnnonccnnonocnnoncancnonnonnnnnnnnonnonnnnnnnnnnnnnnnnnnnnn idae 49 Enterprise Architect TOO DOXES occocccnccnnonconconconoononnconoononnonnnnnnononncnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnns 50 Elements Used in Toolboxes ea or ARI a 50 O 1998 2010 Sparx Systems Pty Ltd Il Contents Connectors Used In TOOlDOX S sssscccccecceseseseneeeeeceescseeeeeeeeeeeeecesseeneaeeeeeeesesseeeeaaeeeeeeeeeeseseeasseeeeeeesenses 51 Create Diagram Profiles vw 52 Built In Diagram Types 53 Attribute Values Stylex amp pdala irirna nieee aaaea aana aeara aR AER k AEEA KEENE naa 53
126. Technologies in SDK Customize Toolbox Profiles 2 3 1 1 Note To name an attribute for an item from your own technology precede it with your profile name as the namespace and then follow it in brackets with the element or connector type that you are extending so that Enterprise Architect knows what object to create For example a SysML block element would appear as SysML Block UML Class Click on the following links for a complete list of elements 50 and connectors 517 that can be extended To define a toolbox item that allows a pattern to be dropped onto a diagram name the attribute My Technology MyPattern UML Pattern where MyTechnology is the ID of the technology and MyPattern is the name of the pattern to drop For example BusFramework Builder UML Pattern To define a model based pattern in a custom toolbox such as the GoF patterns see Extending UML With Enterprise Architect create an attribute with a name of the format PatternCategory PatternName UML Pattern For example GoF Behavioral Patterns Mediator UML Pattern You might not want to use names such as UML Package or UML Class in your toolbox so give the attributes an Initial Value of for example Package or Class 5 To save the toolbox profile right click on the diagram and select the Save as Profile context menu option Note Each profile element incorporated into an MDG Toolbox page enables synchronization of the Tagged Values and Con
127. Technology resource is enabled Otherwise returns False Parameters e ID String the technology ID to check for 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 e ID String the technology ID to check for 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 e DiagramlD Long the ID of the diagram to open 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 see Using Enterprise Architect UML Modeling Tool by selecting a recently opened SQL repository Parameters e Filename String the filename of the Enterprise Architect project to open Boolean As for OpenFile except this enables the specification of a password Parameters e Filepath String the file path of the Enterprise Architect
128. Type Obi jectType Read only Distinguishes objects referenced through a Dispatch interface 19 Value String Read Write The value associated with this custom property Can be a string the boolean values true or false or an enumeration value from a defined list The UML 2 1 1 specification in general provides information on enumeration kinds relevant here 7 2 6 5 EmbeddedElements public Collection In UML 2 1 an element can have one or more embedded elements such as Ports Pins Parameters or ObjectNodes These are attached to the boundary of the host element and cannot be moved off the element They are owned by their host element This collection gives easy access to the set of elements embedded on the surface of an element Note that some embedded elements can have their own embedded element collection for example Ports can have Interfaces embedded on them The EmbeddedElements collection contains Element objects Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 249 collection CustomProperties CustomProperty Name String Value Sting Name String Note String Operator String Size int DurstionConstraint String Event String Note String TimeConstraint String TxState String TxTime int 7 2 6 6 Method public Class A method represents a UML operation It is accessed from the Element Methods collection and includes collections
129. Update Then Console WriteLine o GetLastError End If o con TaggedValues AddNew Tag Value If not o Update Then Console WriteLine o GetLastError End If use the client and supplier ends to set additional information client con ClientEnd client Visibility Private client Role m_client client Update supplier con SupplierEnd supplier Visibility Protected supplier Role m_supplier supplier Update Console WriteLine Client and Supplier set Console WriteLine client Role Console WriteLine supplier Role End Sub 7 2 10 6 Add and Manage Diagrams public Object An example of how to create a diagram and add an element to it Note the optional use of element rectangle setting using left right top and bottom dimensions in AddNew call Sub DiagramLifeCycle Dim diagram as object Dim v as object Dim o as object Dim package as object Dim idx as Integer Dim idx2 as integer package m_Repository GetPackageByID 5 diagram package Diagrams AddNew Logical Diagram Logical If not diagram Update Then Console WriteLine diagram GetLastError End if diagram Notes Hello there this is a test diagram update O package Elements AddNew ReferenceType Class o Update add element to diagram supply optional rectangle co ordinates v diagram DiagramObjects AddNew I 200 r 400 t 200 b 600 v ElementID 0 ElementID v Update Console WriteLine diagram DiagramID
130. Variant Constraints Collection 0 TaggedValues Collection 0 Name String AttributeGUID String Visibility String Containment String IsStatic Boolean IsCollection Boolean IsOrdered Boolean AllowDuplicates Boolean LowerBound String UpperBound String Container String Notes String IsDerived Boolean AttributelD Long Pos Long Length String Precision String Scale String IsConst Boolean Style String StyleEx String ClassifierlD Long Default String Type String Update Boolean GetLastError String An attribute corresponds to a UML Attribute It contains further collections for constraints and Tagged Values Attributes are accessed from the Element Attributes collection Associated table in EAP file t_attribute Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 245 Attribute Attributes AllowDuplicate Boolean Read Write Indicates if duplicates are allowed in the collection If the attribute represents a database column this when set represents the Not Null option AttributeGUID String Read Write A globally unique ID for the current attribute System generated AttributelD Read only Local ID number of the attribute ClassifierlD Long Read Write Classifier 1D if appropriate indicates the base type associated with attribute if not a primitive type Read Write The container type Containment String Read
131. _OnPostActivateTechnology 153 EA OnPostCloseDiagram 137 EA OnPosilnitialized 151 EA OnPostNewAttribute 149 EA OnPostNewConnector 147 EA OnPostNewDiagram 148 EA _OnPostNewDiagramObject 148 EA OnPostNewElement 147 EA OnPostNewMethod 149 EA _OnPostNewPackage 150 EA_OnPostOpenDiagram 137 EA OnPostTransform 151 EA _OnPreActivateTechnology 152 EA OnPreDeleteAttribute 138 EA OnPreDeleteConnector 139 EA _OnPreDeleteDiagram 140 EA OnPreDeleteElement 138 EA OnPreDeleteMethod 139 EA _OnPreDeletePackage 141 EA _OnPreDeleteTechnology 153 EA OnPreExitInstance 146 EA OnPreNewAttribute 144 EA OnPreNewConnector 142 EA_OnPreNewDiagram 143 EA _OnPreNewDiagramObject 143 EA OnPreNewElement 141 EA OnPreNewMethod 145 EA _OnPreNewPackage 145 EA _OnRetrieveModelTemplate 168 EA OnRunAttributeRule 163 EA OnRunConnectorRule 163 EA _OnRunDiagramRule 162 EA OnRunElementRule 162 EA OnRunMethodRule 164 EA _OnRunPackageRule 162 EA OnRunParameterRule 164 EA OnStartValidation 161 EA_QueryAvailableCompartments 158 EA_ShowHelp 134 Interface 123 Introduction 123 MDG Add Ins 170 MDG Add Ins MDG Events 170 MDG Events MDG_BuildProject 171 MDG Events MDG_Connect 171 MDG Events MDG_Disconnect 172 MDG Events MDG_GetConnectedPackages 173 MDG Events MDG_GetProperty 173 MDG Events MDG_Merge 174 MDG Events MDG_NewClass 175 MDG Events MDG_PostGenerate 176 MDG Events MDG_PostMerge 176 MDG Events MDG_PreGenerate 177 MDG Events MDG_P
132. a Dependency either to or from a component element When you drag a connector onto an existing Port or component element you want a Dependency either to or from the component or in the case of a component you want to be able to create an embedded Port element This results in 8 records in the Quick Linker definition 257 file Dependency to new Component Dependency from new Component Dependency to existing Component Dependency from existing Component Dependency to existing Port Dependency from existing Port Dependency to existing Component create new Port 8 Dependency from existing Component create new Port In the spreadsheet this is implemented by the following values 01 0 NS a le E F H SAT K Source Source Target New New 1 Element ST Element Diagram Element New Link Link Type filter Type Filter Type Type Direction New Link Caption 2 Class quick Component Dependency to 3 Class quick Component Dependency from 4 Class quick Component Dependency to Dependency to 5 Class quick Component Dependency from Dependency from 6 Class quick Por Dependency to Dependency to 7 Class quick Port Dependency from Dependency from 8 Class quick Component Port Dependency to _9 Class quick Component Port Dependency from O 1998 2010 Sparx Systems Pty Ltd 28 Developing Profiles Quick Linker L DO o FA Q Fa aS a Disallow No inherit Target Preceeds Preceeds 1 New Link amp Create Create Self
133. a validation Rather than perform this configuration manually and potentially have to change the settings every time Enterprise Architect is started and a different technology is set active you can define the configuration settings within the MTS file To specify a set of rules as a white list that is anything added to this list is turned ON open your MTS file in a text editor and copy and paste the following lt ModelValidation gt block at the top level inside the lt MDG Selections gt block lt ModelValidation gt lt RuleSet name BPMNRules gt lt ruleset ID defined in the Project DefineRuleCategory call gt lt RuleSet name MVR7F0001 gt lt notice you can turn on off system rules as well gt lt ModelValidation gt Enterprise Architect Software Developers Kit MDG Technologies in SDK Define Validation Configuration 59 Ensure that the ruleset IDs do not contain any spaces To specify a set of rules as a black list that is anything added to this list is turned OFF open your MTS file in a text editor and copy and paste the following lt ModelValidation gt block at the top level inside the lt MDG Selections gt block lt ModelValidation isBlackList true gt lt RuleSet name BPMNRules gt lt RuleSet name MVR7F0001 gt lt ModelValidation gt In the examples above BPMNRules is the rule set ID defined in the Project DefineRuleCategory call see Project Interface 271 fo
134. aT Broadcast Event EA_OnPostinitialized 151 Automation Interface Code Example 285 ae a Broadcast Event EA_OnPostOpenDiagram Add Connector 137 Automation Interface Code Example 286 Broadcast Event EA_OnPostTransform 151 Add Stereotypes Broadcast Event EA_OnPreExitInstance 146 Automation Interface Code Example 292 Broadcast Event EA_OnRetrieveModelTemplate Add In 168 And Enterprise ArchitectDeadlocks NET 126 Broadcast Events 135 COM Interoperability 126 Compartment Events 158 Concurrent Method Calls 126 Compartment Events EA_GetCompartmentData Create 124 159 Create Define Menu Items 124 Compartment Events Deploy 125 EA _QueryAvailableCompartments 158 Disable 128 Context Item Events 155 1998 2010 Sparx Systems Pty Ltd 296 Index Add In Model Context ltem Events EA _OnContextltiemChanged 155 157 Context Item Events EA OnContextltemDoubleClicked 156 Create Add In 124 Create Add In Tricks and Traps 126 Create Custom View 169 Custom View 169 EA Connect 130 EA Disconnect 130 EA FileClose 136 EA FileNew 136 EA FileOpen 135 EA GetCompartmentData 159 EA GetMenultems 131 EA GetMenuState 131 EA MenuClick 132 EA OnContextltemChanged 155 157 EA OnContextltemDoubleClicked 156 EA OnDeleteTechnology 154 EA OnEndValidation 161 EA _OnlmportTechnology 155 EA _OnlnitializeTechnologies 152 EA OnlnitializeUserRules 160 EA OnOutputltemClicked 133 EA_OnOutputltemDoubleClicked 133 EA
135. able Files panel 3 To select each required taskpage profile individually highlight the file name in the Available Files list and click on the gt button The file name displays in the Selected Files list Alternatively to select all available profiles assuming they are all taskpage profiles click on the gt gt button 4 Click on the Next button to proceed 2 1 6 Add Tagged Value Types When creating an MDG Technology file you can include Tagged Value Types 81 To use the Tagged Value Types section of the MDG Technology Types Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 30 topic up to and including Step 6 33 where you select the Tagged Value Types checkbox The MDG Technology Wizard Tagged Value Types dialog displays 1998 2010 Sparx Systems Pty Ltd 40 MDG Technologies in SDK Create MDG Technologies MDG Technology Wizard Tagged Value Types Select the tagged value types to be included in this technology Available Tagged Values Selected Tagged Values Property Activity scription Notes Type RefGUID Stereotypes Activity 2 To select each required Tagged Value Type individually highlight the file name in the Available Files list and click on the gt button The file name displays in the Selected Files list Alternatively to select all available Tagged Value Types click on the gt gt button 3 Click o
136. ace Class1 CStudent m_Name MathClass Doublelt int Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Removes an existing User or Group lock from the package object Throws an exception if the operation fails Use GetLastError to retrieve error information Update the current package object after modification or appending a new item lf false is returned check the GetLastError function for more information Note that a package object also has an element component that must be taken into account The package object contains information about the package attributes such as hierarchy or contents The element attribute contains information about for example Stereotype Constraints or Files all the attributes of a typical element Places the package under version control using the specified Version Control Configuration and the specified XMI filename 1998 2010 Sparx Systems Pty Ltd 218 Enterprise Architect Object Model Reference ConfigGuid string Throws an exception if the operation fails Use GetLastError XMLFile string Comment to retrieve error information boolean KeepCheckedOut It is recommended that the package be saved using Update before calling VersionControlAda so that any outstanding changes are not lost Parameters e ConfigGuid String N
137. ace provides acoess to the methods defined in the XML based automation interface Altough this interface can be loaded seperstely it is convenient to use it from the Repository interface using the GetProjectinterfaos method allowing access to the XML for elements This interface also has some additional utility methods to copy a diagram to the clipboard load a disgram run a report etc 7 2 9 1 Project public 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 Note These methods all require input GUIDs in XML format use GUIDtoXML 2781 to change the Enterprise Architect GUID to an XML GUID O 1998 2010 Sparx Systems Pty Ltd 272 Enterprise Architect Object Model Reference Project Attributes A 22222 ObjectType ObjectTypelt93 Read only Distinguishes objects referenced through a Dispatch interface Project Methods CreateBaseline string Boolean Creates a Baseline of a specified package PackageGUID string Version Parameters string Notes PackageGUID String the GUID in XML format of the package to Baseline Version String the version of the Baseline Notes String any notes conce
138. ack via the language parameter Also look at MDG PreGeneratel177 Syntax Function MDG_NewClass Repository As EA Repository PackageGuid As String CodelD As String Language As String As String The MDG_NewClass function syntax contains the following elements Pew ome CC CodelD String A string used to identify the code element before it is created for more information see MDG _View View 179 Language String A string used to identify the programming language for the new Class The language must be supported by Enterprise Architect PackageGui String The GUID identifying the Enterprise Architect package sub tree d that is controlled by the Add In Repository EA IN An EA Repository object representing the currently open Repository Enterprise Architect model Poll its members to retrieve model 1998 2010 Sparx Systems Pty Ltd 176 Enterprise Architect Add In Model MDG Add Ins CIC CE CTN ooo m ee data and user interface status information Return Value Returns a string containing the file path that should be assigned to the Class 6 7 1 8 MDGPostGenerate Details MDG_PostGenerate enables the Add In to handle file changes caused by generation This event is called after Enterprise Architect has prepared text to replace the existing contents of a file Responding to this event enables the Add In to write to the linked application s user interface rather than modify the file directly When t
139. ackage 141 Pre New Events 141 Pre New Events EA_OnPreNewaAttribute 144 Pre New Events EA_OnPreNewConnector 142 Pre New Events EA_OnPreNewDiagram 143 Pre New Events EA_OnPreNewDiagramObject 143 Pre New Events EA _OnPreNewElement 141 Pre New Events EA_OnPreNewMethod 145 Pre New Events EA_OnPreNewPackage 145 Search Data XML Format 129 Technology Event EA_Oninitialize Technologies 152 Technology Events 152 Technology Events EA_OnDeleteTechnology 154 Technology Events EA_OnImportTechnology 155 Technology Events EA_OnPostActivateTechnology 153 Technology Events EA_OnPreActivateTechnology 152 Technology Events EA_OnPreDelete Technology 153 App Object Automation Interface 190 Attribute Add And Delete Automation Interface Code Example 288 Automation Interface ElementFeatures Package 244 Of Toolbox Page 48 PData amp StyleEx Diagram Profiles 53 Supported Create Composite Elements 23 Supported Define Child Diagram Types 23 Supported Metatype In UML Profiles 19 Supported Stereotype In UML Profiles 19 Work With Automation Interface Code Example 292 AttributeConstraint Automation Interface ElementFeatures Package 246 AttributeTag Automation Interface ElementFeatures Package 247 Author Attributes 210 Methods 210 Author Collection Automation Interface Repository 210 Automation Interface App Object 190 Attribute ElementFeatures Package 244 Attribut
140. ages and technologies using the following broadcast events e EA OnPreDeleteElement 138 e EA OnPreDeleteAttribute 138 e EA OnPreDeleteMethod 135 e EA OnPreDeleteConnector 138 e EA OnPreDeleteDiagraml116 e EA OnPreDeletePackagel 4h e EA OnPreDelete Technologyl153 Deprecated EA_OnPreDeleteElement Details EA_OnPreDeleteElement notifies Add Ins that an element is to be deleted from the model It enables Add Ins to permit or deny deletion of the element This event occurs when a user deletes an element from the Project Browser or on a diagram The notification is provided immediately before the element is deleted so that the Add In can disable deletion of the element Syntax Function EA_OnPreDeleteElement Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreDeleteElement function syntax contains the following elements NC CN Contains the following EventProperty Objects for the element eE to be deleted 214 e ElementID A long value corresponding to Element ElementID data and user interface status information Repository EA Repository 197 An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model Return Value 6 5 6 2 Return True to enable deletion of the element from the model Return False to disable deletion of the element EA_OnPreDeleteAttribute Details EA_OnPreDeleteAttribute notifies Add Ins th
141. ails EA_OnContextltemChanged notifies Add Ins that a different item is now in context This event occurs after a user has selected an item anywhere in the Enterprise Architect GUI Add Ins that O 1998 2010 Sparx Systems Pty Ltd 156 Enterprise Architect Add In Model Broadcast Events require knowledge of the current item in context can subscribe to this broadcast function If of otRepository then this function behaves the same as EA _ FileOpen 135 Also look at EA OnContextltemDoubleClicked 15 and EA_OnNotifyContextltemModified 157 Syntax Sub EA_OnContextltemChanged Repository As EA Repository GUID As String ot as EA ObjectType The EA_OnContextltemChanged function syntax contains the following elements CECI Joren per ooo String IN Contains the GUID of the new context item This value corresponds to the following properties depending on the value of the ot parameter ot ObjectType GUID value otElement Element ElementGUID otPackage Package PackageGUID otDiagram Diagram DiagramGUID otAttribute Attribute AttributeGUID otMethod Method MethodGUID otConnector Connector ConnectorGUID otRepository NOT APPLICABLE GUID is an empty string EA IN Specifies the type of the new context item ObjectType Repository EA Repository IN An EA Repository object representing the currently open Enterprise 197 Architect model Poll its members to retrieve model data and user interface status informa
142. alization steps can now be performed on the object For example the Add In can create an Output tab using Repository CreateOutputTab 20 Syntax Sub EA_OnPosilnitialized Repository As EA Repository The EA_OnPostInitialized function syntax contains the following elements Peon pme omsfanewin ooo Repository EA Repository An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value None 6 5 11 EA_OnPostTransform Details EA_OnPostTransform notifies Add Ins that an MDG transformation has taken place with the output in the specified target package This event occurs when a user runs an MDG transform on one or more target packages The notification is provided for each transform target package immediately after all transform processes have completed Syntax Function EA_OnPosiTransform Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPostTransform function syntax contains the following elements CS CC Contains the following EventProperty Objects for the si transform performed 21 a e Transform A string value corresponding to the name of the transform used e PackagelD A long value corresponding to Package PackagelD of the destination package Repository 4 Repository 197 An EA Repository object representing the currently open Enterprise Architect model Poll its mem
143. alled on Enterprise Architect start up and requests that the Add In provide Enterprise Architect with a rule category and list of rule IDs for model validation This function must be implemented by any Add In that is to perform its own model validation It must call Project DefineRuleCategory once and Project DefineRule for each rule these functions are described in the Project Interface 27h section Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 161 Syntax Sub EA_OnlnitializeUserRules Repository As EA Repository The EA_OnlnitializeUserRules function syntax contains the following elements CT CCT IN Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information 6 5 15 2 EA_OnStartValidation Details EA_OnStartValidation notifies Add Ins that a user has invoked the model validation command from Enterprise Architect Syntax Sub EA_OnStartValidation Repository As EA Repository ParamArray Args as Variant The EA_OnStartValidation function syntax contains the following elements CN CEIC ParamArray of Variant IN Contains a list of Rule Categories that are active for the current invocation of model validation Repository EA Repository 197 An EA Repository object representing the currently open Enterprise Architect mo
144. ame corresponding to the Unique ID of the version control configuration to use XMLFile String Name of the XML file to use for this package This filename is relative to the Working Copy folder specified for the Config Comment String Log message that is added to the version controlled file s history where applicable KeepCheckedOut Boolean Specify True to add to version control and keep package checked out VersionControlCheckin Perform checkin of the version controlled package string Comment Throws an exception if the operation fails Use GetLastError to retrieve error information Parameters e Comment String Log message that is added to the version controlled file s history where applicable VersionControlCheckout Perform checkout of the version controlled package string Comment Throws an exception if the operation fails Use GetLastError to retrieve error information Parameters e Comment String Log message that is added to the version controlled file s history where applicable VersionControlGetLatest Updates the local working copy of the package file associated boolean Forcelmport with the object package before re importing the package data from the package file Parameters e Forcelmport Boolean Used if the package data in the model is found to be up to date with respect to the version controlled package file If e False the package data that exists in the model is accepted
145. and user interface status information Ruled string No The ID that was passed into the Project DefineRule method 6 5 15 6 EA_OnRunDiagramRule Details This event is triggered once for each rule defined in EA_OninitializeUserRules 1661to be performed on each diagram in the selection being validated If you don t want to perform the rule defined by RulelD on the given diagram then simply return without performing any action On performing any validation if a validation error is Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 163 found use the Repository ProjectInterface PublishResult method to notify Enterprise Architect Syntax Sub EA_OnRunDiagramRule Repository As EA Repository RulelD As String DiagramID As Long The EA_OnRunDiagramRule function syntax contains the following elements CC CCT DiagramiD Long IN The ID of the diagram to potentially perform validation on Use the Repository GetDiagramByID method to retrieve the diagram object data and user interface status information RuleiD string IN The ID that was passed into the Project DefineRule command 6 5 15 7 EA_OnRunConnectorRule Repository 4 Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model Details This event is triggered once for each rule defined in EA _OnlnitializeUserRulesli6
146. ard attribute types e EASystem MenuCmd These entries name an Enterprise Architect main menu command inside round brackets See the complete list of inbuilt commands 55 Type the text to appear in the Tasks Pane into the Initial Value field e EASystem ShowHelp These entries name a page from the Enterprise Architect User Guide inside round brackets To find out the names of pages in the Enterprise Architect User Guide right click on the page and select the Properties context menu option Type the text to appear in the Tasks Pane into the Initial Value field e EASystem ShowMovie These entries give the URL of a movie inside round brackets Type the text to appear in the Tasks Pane into the Initial Value field e SEPARATOR This entry indicates that a separator should be placed in the Tasks Pane toolbox If it is necessary to place multiple separators in a single toolbox note that Enterprise Architect does not allow identically named attributes for a Class simply change the case of one or more letters to get around the problem Other useful attributes include e EASystem ShowURL This entry gives the URL of a web page inside round brackets Type the text to appear in the Tasks Pane into the Initial Value field e isCommon A boolean attribute with Initial Value set to True defines a Tasks Pane toolbox as context free and common appearing for all contexts e You can also run Add In functions 564 from the Tasks Pane Next Step Th
147. arent isleaf islocked isroot isspec istagged keywords language metatype multiplicity name notes packagename parentedge Right Left Top Bottom parent metatype persistence O 1998 2010 Sparx Systems Pty Ltd 74 Shape Scripts Write Scripts phase propertytype propertytype alias propertytype metatype propertytype name propertytype stereotype scope status stereotype type version visibility Properties for Connector Shape Scripts addin value returned from an Add In alias diagram connectornotation diagram mdgtype diagram name diagram stereotype diagram type direction isroot isleaf name notes source aggregation source alias source changeable source constraints source element name source element stereotype source metatype source multiplicity source multiplicityisordered source qualifiers source stereotype source targetscope stereotype subtype target aggregation target alias target changable target constraints target element name target element stereotype target metatype target multiplicity target multiplicityisordered target qualifiers target stereotype target targetscope Enterprise Architect Software Developers Kit Shape Scripts Write Scripts 75 e type 3 3 8 Sub Shapes Shapes can contain and be composed of other shapes Subshape Layout To set the layout type the layoutType attribute must be set in the i
148. as being up to date and no attempt is made to re import data from the package file e True Enterprise Architect re imports the package from the package file regardless See also the version control menu option Get Latest in Version Control Within UML Models Using Enterprise Architect VersionControlGetStatus Returns the version control status of the package Throws an 0 exception if the operation fails Use GetLastError to retrieve error information Return value maps to the following enumerated type enum EnumCheckOutStatus csUncontrolled 0 csCheckedin csCheckedOutToThisUser csReadOnly Version Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 219 csCheckedOutToAnotherUser csOfflineCheckedIn csCheckedOutOfflineByUser csCheckedOutOfflineBy Other csDeleted y csUncontrolled Either unable to communicate with the version control provider associated with the package or the package file is unknown to the provider csReadOnly Version Package is marked as read only An earlier revision of the package has been retrieved from version control csOfflineCheckedOutToThisUser Indicates that the package was checked out by this user whilst disconnected from version control csOfflineNotCheckedOutToThisUser Indicates that Enterprise Architect can not currently connect to the version control config and the package was not previously checked out to
149. at to merge into the package Mergelnstructions String the file containing the GUID of each differenced item from the XML difference log returned by DoBaselineCompare 273 ConnectString String the location of the EAP file or DBMS to get the Baseline from if not in the same model as the package EnumDiagramElements string protected Gets an XML list of all elements in a diagram DiagramGUID abstract String Parameter e DiagramGUID String the GUID in XML format of the diagram to get elements for EnumDiagrams string protected Gets an XML list of all diagrams in a specified PackageGUID abstract String package Parameters e PackageGUID String the GUID in XML format of the package to list diagrams for EnumElements string protected Gets an XML list of elements in a specified package PackageGUID abstract String Parameters e PackageGUID String the GUID in XML format of the package to get a list of elements for EnumLinks string protected Gets an XML list of connectors for a specified element ElementGUID abstract String Parameter e ElementGUID String the GUID in XML format of the element to get all associated connectors for EnumPackages string protected Gets an XML list of child packages inside a parent PackageGUID abstract String package Parameters e PackageGUID String the GUID in XML format of the parent package EnumProjects protected Gets a list of proj
150. at an attribute is to be deleted from the model It enables Add Ins to permit or deny deletion of the attribute This event occurs when a user attempts to permanently delete an attribute from the Project Browser The notification is provided immediately before the attribute is deleted so that the Add In can disable deletion of the attribute Syntax Function EA_OnPreDeleteAttribute Repository As EA Repository Info As EA EventProperties As Boolean Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 139 The EA_OnPreDeleteAttribute function syntax contains the following elements AAA a Contains the following EventProperty Objects for the attribute to la be deleted 21 e AttributelD A long value corresponding to Attribute AttributelD Repositor 4 Repository 19 An EA Repository object representing the currently open y Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True to enable deletion of the attribute from the model Return False to disable deletion of the attribute 6 5 6 3 EA_OnPreDeleteMethod Details EA_OnPreDeleteMethod notifies Add Ins that a method operation is to be deleted from the model It enables Add Ins to permit or deny deletion of the method This event occurs when a user attempts to permanently delete a method from the Project Browser The no
151. ate Boolean Update the current MethodConstraint object after modification or appending a new item If false is returned check the GetLastError function for more information 1998 2010 Sparx Systems Pty Ltd 252 Enterprise Architect Object Model Reference 7 2 6 8 MethodTag public Class A MethodTag is a Tagged Value associated with a method Associated table in EAP file t_operationtag MethodTag Attributes jatwibute tyre motes MethodID Read Write The ID of the associated method Name Sting Read Write The tag or name of the property String Read Write Further descriptive notes about this tag If Value below is set to lt memo gt then Notes should contain the actual Tagged Value content ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 19 TagGUID Read Write A unique GUID for this Tagged Value TagID Read only A unique ID for this Tagged Value Value String Read Write The value assigned to this tag This field has a 255 character limit If the value is greater than 255 characters long set the value to lt memos and insert the body of text in the Notes attribute above When reading existing Tagged Values if Value lt memo gt then the developer should read the actual body of text from the Notes attribute MethodTag Methods GetLastError String Returns a string value describing the most recent error that occurred in rel
152. ate Tasks Pane Profiles ClassElement PackageElement contextitemType UML Class contextitemType UML Packsge pk taggedValue taggedValue DebuggingTasks gt taggedValue ClassDiagram contextDisgramType UML Class Next Step The next step is to Save your Tasks Pane Profile 587 2 5 4 Save a Tasks Pane Profile The best organization structure for the model in which you are creating your Tasks Pane Profile is A single profile package Three diagrams within the profile package named Toolboxes Contexts and Context Allocations Each toolbox page stereotype element is owned by the profile package and appears on the Toolboxes and Context Allocations diagrams Each context stereotype element is owned by the profile package and appears on the Contexts and Context Allocations diagrams Each metaclass element is owned by the profile package and appears on the Toolboxes or Contexts diagram From this structure creating a Tasks Pane Profile is as simple as right clicking on the profile package in the Project Browser and selecting the Save Package as UML Profile context menu option 2 6 Define Validation Configuration The Model Validation Configuration dialog can be opened using the Project Model Validation Configure menu option Using this dialog you can choose which sets of validation rules are and are not executed when a user performs
153. ate the current stereotype object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 4 15 Task public Class A Task is an entry in the System ToDo list Accessed using the Repository Tasks collection 1998 2010 Sparx Systems Pty Ltd 224 Enterprise Architect Object Model Reference Associated table in EAP file t_tasks Task Attributes Atribute type motes OOOO ActualTime Read Write Time already expended on task in hours days or other units resource CO O CT CO TEN 19 CO CT CO EN CO CAEN see E CTN TotalTime Long Read Write The total expected time the task might run in hours days or some other unit Read Write Sets or returns string representing the type Task Methods Returns a string value describing the most recent error that occurred in 0 relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Task object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 4 16 Term public Class A Term object represents one entry in the system glossary Accessed using the Repository Terms collection Associated table in EAP file _glossary Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 225 Te
154. ate to the directory containing the required toolbox profiles The profile files are automatically listed in the Available Files panel 3 To select each required toolbox profile individually highlight the file name in the Available Files list and click on the gt button The file name displays in the Selected Files list Alternatively to select all available profiles assuming they are all toolbox profiles click on the gt gt button 4 Click on the Next button to proceed 2 1 5 Add Task Panel Pages When creating al MDG Technology file you can include Enterprise Architect Task Panel profiles that you have created 547 To use the Taskpages section of the MDG Technology Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 301 topic up to and including Step 6 33 where you select the Taskpages checkbox The MDG Technology Wizard Taskpages dialog displays Enterprise Architect Software Developers Kit MDG Technologies in SDK Create MDG Technologies 39 MDG Technology Wizard Taskpages Select the files to be included as Taskpage definitions in this technology Directory Y Dev Builds Addins UPDM CURRENT Available Files Selected Files Taskpane Profile xml UPDM Stereotypes xml gt 2 Inthe Directory field navigate to the directory containing the required taskpage profiles The profile files are automatically listed in the Avail
155. atePerspective string Deprecated no longer in use long ActivateTab string Name Activates an open Enterprise Architect tabbed view Parameters e Name String the name of the view to activate ActivateTechnology string Activates an enabled MDG Technology Name Parameters e Name String the name of the Technology to activate ActivateToolbox string Boolean Activates a Toolbox page in the GUI Toolbox Jong Options Returns true if the specified Toolbox page is successfully activated otherwise returns false Parameters e Toolbox String the name of the Toolbox page to activate e Options Long reserved for future use AddDefinedSearches string Enables you to enter a set of defined searches that last in sXML Enterprise Architect for the life of the application When Enterprise Architect loads again they must be inserted again by your Add In Parameters e sXML String the XML of the defined searches you can get this XML by performing an export of the searches from the Manage Searches dialog in Enterprise Architect See Using Enterprise Architect UML Modeling Tool AddPerspective string Boolean Deprecated no longer in use Perspective long Options AddTab string TabName activex Adds an ActiveX custom control as a tabbed window string ControllD custom Enterprise Architect creates a control and if successful control returns its Unknown pointer which can be used by the caller to manipulat
156. ation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current MethodTag object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 6 9 Parameter public Class A Parameter object represents a method argument and is accessed through the Method Parameters collection Associated table in EAP file t_operationparams Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 253 Parameter Attributes Amute Type motes OOOO CO CO TT CO CO CTE CO CN CTN CO AAN CO CO CT ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface OperationID Read only ID of the method associated with this parameter ParameterGUI String Read Write A globally unique ID for the current Parameter System D generated Position Long Read Write The position in the argument list Stereotype Read Write The first stereotype of the parameter StereotypeEx String Read Write All the applied stereotypes of the parameter in a comma separated list Style Read Write Some style information StyleEx String Read Write Advanced style settings Reserved for the use of Sparx Systems Read Write The parameter type can be a primitive type or defined classifier Parameter Methods GetLastError Returns a st
157. ation to this object This function is rarely used as an exception is thrown when an error occurs Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 267 ReleaseUserLock Boolean Releases a group lock or user lock on this diagram object 0 Throws an exception if the operation fails Use GetLastError to retrieve error information ReorderMessages Void Resets the display order of Sequence and Collaboration messages 0 Typically used after inserting or deleting messages in the diagram ShowAsElementLi Boolean Toggles the diagram display between diagram format and Element List st bool depending on the value of ShowAsList ShowAsList bool A If Persist is set the display format is written to the database so the Persist diagram always opens in that format diagram or list Otherwise the display format falls back to the default diagram once the display is closed Parameters e ShowAsList Boolean indicates diagram or Element List e Persist Boolean indicates set maintain ShowAsList value or not revert to default Update Boolean Updates this diagram object after modification or appending a new item If false is returned use GetLastError to retrieve error information 7 2 8 2 DiagramLinks public Class A DiagramLink is an object that holds display information about a connector between two elements in a specific diagram It incl
158. bers to retrieve model data and user interface status information Return Value Reserved for future use O 1998 2010 Sparx Systems Pty Ltd 152 Enterprise Architect Add In Model Broadcast Events 6 5 12 Technology Events Enterprise Architect Add Ins can respond to the following events associated with the use of MDG Technologies e EA OnlnitializeTechnologies 15 1 e EA OnPreActivate Technology 52 e EA OnPostActivateTechnology 531 e EA OnPreDeleteTechnology 155 Deprecated e EA OnDeleteTechnologyl15 Deprecated e EA OnimportTechnology 155 Deprecated 6 5 12 1 EA_OnlInitializeTechnologies Details EA_Onlnitialize Technologies requests that an Add In pass an MDG Technology to Enterprise Architect for loading This event occurs on Enterprise Architect startup Return your technology XML to this function and Enterprise Architect loads and enables it Syntax Function EA_OninitializeTechnologies Repository As EA Repository As Object The EA_Onlnitialize Technologies function syntax contains the following element ES poepen ooo Repository EA An EA Repository object representing the currently open Enterprise Repository Architect model Poll its members to retrieve model data and user 1977 interface status information Return Value Return the MDG Technology as a single XML string Example Public Function EA_OnlInitializeTechnologies ByVal Repository As EA Repository As Objec
159. bstring of lt src gt starting at lt start gt and including lt count gt characters Where lt count gt is omitted the rest of the string is included Pl lt option gt lt value Sets the PI for the current template to lt value gt lt option gt controls when the new PI takes effect Valid values are e Immediate the new Pl is generated before the next non empty template line e N Next the new Pl is generated after the next non empty template line Multiple pairs of options are allowed in one call For more details see the description of Pl 106 PROCESS_END_OBJECT lt template_name gt Enables the Classes that are one Class further away from the base Class to be transformed into objects such as attributes operations packages parameters and columns of the base Class lt template_name gt refers to the working template that temporarily stores the data REMOVE_DUPLICATES lt source gt lt separator gt Where lt source gt is a lt separator gt separated list this removes any duplicate or empty strings REPLACE lt string gt lt old gt lt new gt Replaces all occurrences of lt old gt with lt new gt in the given string lt string gt RESOLVE_OP_NAME Resolves clashes in interface names where two method from interfaces have the same name RESOLVE_QUALIFIED_TYPE RESOLVE_QUALIFIED_TYPE lt separator gt RESOLVE_QUALIFIED_TYPE lt separator gt lt default gt Generates a qualified type for
160. cannot change the font size type or color of this text Appends a line of text to the shape and a line break Note You cannot change the font size type or color of this text Prints the specified text string wrapped over multiple lines if the text is wider than its containing shape Note You cannot change the font size type or color of this text Draws a rectangle with extents at left top right bottom Values are percentages Draws a rectangle with rounded corners with extents defined by left top right and bottom The size for the corners is defined by abs_cornerwidth and abs_cornerheight these values do not scale with the shape Enterprise Architect Software Developers Kit Shape Scripts Write Scripts 71 setdefaultcolors Returns the brush and pen color to the default settings or to the user defined colors if available See Color Queries 721 setfillcolor Sets the fill color int red int green int blue You can specify the required color by defining RGB values or using a color value returned by any of the Color Queries 727 for example GetUserFillColor setfillcolor Color newColor setlinestyle Changes the stroke pattern for commands that use the pen string linestyle Parameters string linestyle the following styles are valid solid dash dot dashdot dashdotdot setorigin Positions floating text labels relative to the main shape ict gaa relativeTo is one of N
161. ce 181 Automation Interface Repository 210 Connector Code Module Add Automation Interface Code Example 286 Aaa TO MDG becinology lt 40 Automation Interface Connector Package 257 Code Template c 44 Shape Script Properties 72 Custom Templates Create 9 Tagged Value Use 11 Default Templates 120 Edi 119 Connector Package itor NewS T 191 Connector Automation Interface 257 Editor peo Dew Sicteowped Templates ComnectorConstraint Automation Interface Editor Create Templates For Custom Languages 256 122 In SDK ConnectorEnd Automation Interface 260 Editar n ne ConnectorTag Automation Interface 262 aes SDK 88 RoleTag Automation Interface 263 ae i Connector Package Diagram mpor l Automation Interface 255 Syntax Introduction 88 S Literal Text 88 ConnectorConstraint yntan itera Tex Automation Interface Connector Package 256 Syntax Macros 89 S T E E 89 ConnectorEnd Mts Template SUBSIHULON MaGTOS Automation Interface Connector Package 260 a a ridad a 117 ConnectorTag aria One Automation Interface Connector Package 262 Variable References 117 Variabl 117 ConstLayoutStyles Enum aie un Automation Interface 191 RD ma E i i Constraint utomation MENACES HEPHSIONY Automation Interface Element Package 227 Collections EASL Profile 12 Ae Olas Stereotype 12 ie gt Context Item Events Glassilien AT Add In Model 155 CONSUL a EA _OnContextltiemChanged 155 157 Ren es EA_OnContextltemDoubleClicked 156 S oe Machi 111 Control Macros ete o
162. ce criteria for successful execution CheckedBy Read Write Results confirmed by Class Long Read Write The test Class 1 Unit Test 2 Integration Test 3 System Test 4 Acceptance Test 5 Scenario Test Notes Sting Read Write Detailed notes about test to be carried out o o reco en sms Test Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Test object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 6 Element Features public Package The ElementFeatures package contains descriptions of the model interfaces that enable access to operations O 1998 2010 Sparx Systems Pty Ltd 244 Enterprise Architect Object Model Reference and attributes and their associated Tagged Values and constraints This diagram illustrates the components associated with element features These include Attributes and Methods and the associated constraints and Tagged Values related to them It also includes the Parameter object that defines the arguments associated with an operation method MethodConstraint MethodiD Long Name String Type String TagiD Long E MethodiD Long Name String Value String Notes Strin
163. ckage has information on a diagram and on DiagramObjects and DiagramLinks which are the instances of elements within a diagram O 1998 2010 Sparx Systems Pty Ltd 264 Enterprise Architect Object Model Reference Diagrams 0 Elements 0 DiagramObject Connectors DiagramLinks DisgramLinks 7 2 8 1 Diagram public Class A Diagram corresponds to a single Enterprise Architect diagram It is accessed through the Package Diagrams collection and in turn contains a collection of diagram objects and diagram connectors Adding to the DiagramObjects collection adds an element to the diagram the element must already exist When adding a new diagram you must set the diagram type to a valid type these are e Activity e Analysis e Component e Custom e Deployment Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 265 e Logical e Sequence e Statechart e Use Case Note Use the Analysis type for a Collaboration Diagram Associated table in EAP file t_diagram Diagram Attributes Atribute E EE CEI fome CTN ia pesame The amen gon cana E DiagramLinks Collection Read only A list of DiagramLink objects each containing information about the display characteristics of a connector in a diagram Note A DiagramLink is only created once a user modifies a connector in a diagram in some way Until this condition has been
164. ct T pure e opStereotype operator operator e paramDefault value The third example of both blocks shows a comparison checking for a non empty value or existence This test can also be omitted e paramDefault value e paramDefault value All of the above examples containing paramDefault are equivalent If the parameter in scope had a default value of 10 the output from each of them would normally be 10 Note In a conditional substitution macro any white space following lt macroName gt is ignored If white space is required in the output it should be included within the quoted substitution strings Tagged Value Macros Tagged Value macros are a special form of field substitution macros which provide access to element tags and the corresponding Tagged Values Use 1 Direct Substitution This form of the macro directly substitutes the value of the named tag into the output Structure lt macroName gt lt tagName gt lt macroName gt can be one of e attTag e classTag e connectorDestElemTag Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 103 e connectorDestTag e connectorSourceElemTag e connectorSourceTag e connectorTag e linkAttTag e linkTag e opTag e packageTag e paramTag This corresponds to the tags for attributes Classes operations packages parameters connectors with bot
165. ct model Test types that have been defined for the Enterprise Architect model To create your own Tagged Value based on a predefined Reference Data Tagged Value Type 84 follow the steps below 1 2 3 4 Select the Settings UML menu option The UML Types dialog displays select the Tagged Value Types tab Tag Name Author Stereotypes Tagged Value Types Cardinaiity Values Description Retums Authors of the Model Detail Type Enum Type List List Alithors New Delete Defined Tag Types Type Description Activity 1 Assignments Assignments 3 Author Retums Authors of the Model Categories Categories Datafield Database field In the Tag field type an appropriate Tagged Value name In the Description field type a description of the purpose of the Tagged Value if required In the Detail field copy and paste or type the syntax of the predefined Reference Data Tagged Value Type In the example above the Tagged Value returns the values for all of the Authors in the Enterprise Architect model This enables you to assign any of the previously defined Authors to a model feature model features that can have Tagged Values applied to them are detailed in the Model Elements and Features with Tagged Values topic in Using Enterprise Architect UML Modeling Too O 1998 2010 Sparx Systems Pty Ltd 86 Tagged Value Types Create Reference Data Tagged Values Tagged Values x B
166. ction Macros nuit a tra SA AA 103 Gontro Macros riiston in AA io dond 106 EASL Code Generation Macros inicia AAA 109 EASE Collect aiii A A Arz 111 EASE Properties da dad 113 Variables viii A a a aaa 117 The Code Template Editor in SDK cssssssesssscseesseeseesseeneneseeceneneeseessneneesseeseneseeseesseeseeseneseneseneenensees 118 Custom Templates vesscss tsccctececescseaticeusacg sa ccacavedgeesiiciaseadecdvnh acdieheatstersiadeeesduectaiveete degen dies 119 Override Default TemplateS cocccocoonconcnocononccnnononanononoononnonnonnnonconcnnnannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnno 120 Add New Stereotyped Templates ccsccceccccsescescssssssssceseecssscsseecesseesseaeesseeessacesaeeessseaseasesatenseaeasanees 121 Create Custom Language Template ccccccsssescscscsessscscscssnsnecscsessesssscecsessiesescsessssensnsesessasnenees 122 Enterprise Architect Add In Model A O e aa aE Create Add A a aa a a Define Menu IEMS E a e r a ear re e T aaa a r a a a areena c ndida da Enterprise Architect Software Developers Kit Contents 11 Deploy Add Soi IA AAA AAA ee es Tricks and Traps The Add ln Ma e la LOTO XML Format Search Data ikanra aeea are aae EEEa eaaa ae Rae ra EREA SA Erana eraa Eaei enina Eee 129 Add In Eve S i aaa ara AT 129 A E ON 130 A NON 130 EA GOtMGnult rniss E ET abiansaavouonieh iondetnasaes 131 EA GetMGnuU Statics aa E REA a Aira 131 EBAY M MUG
167. ctivities and States Persistence String Read Write The persistence associated with this element Can be Persistent or Transient String Read Write Phase this element scheduled to be constructed in Any string value Priority String Read Write The priority of this element as compared to other project elements Only applies to Requirement Change and Issue types otherwise ignored Valid values are Low Medium and High Properties Properties 254 Returns a list of specialized properties that apply to the element that might not be available using the automation model The properties are purposely undocumented because of their obscure nature and because they are subject to change as progressive enhancements are made to them PropertyType Long Read Write The ElementiD of a Type associated with this element Only valid for Port and Part elements Realizes Collection 21 Read only List of Interfaces realized by this element for convenience Collection Read only Collection of Requirement 237 objects RequirementsEx Collection Read only Collection of Requirement 237 objects belonging to the current element and its parent elements Collectionl21H Read only Collection of Resource 2351 objects for current element Risks Collection 21h Read only Collection of Risk 2351 objects fRunState string Read Write The object s runstate list as a string Collection 21h Read only Collection of Scenario 2351 objects for current
168. cts for current element Collectionl21H Read only Collection of Method objects belonging to the current element and its parent elements Collection 2ih Read only Collection of Metric elements for current element String Read only This low level property provides information about the contents of the PDatax fields These database fields are not documented and developers must gain understanding of these fields through their own endeavors to use this property MiscData is zero based therefore e MiscData 0 corresponds to PData1 e MiscData 1 to PData2 and so on Modified Date Read Write The date the element was last modified Multiplicity String Read Write Multiplicity value for this element Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 231 CA A Notes String Read Write The element name should be unique within the current package Notes string Read Write Further descriptive text about the element ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch PackagelD Read Write A local ID for the package containing this element ParentID Long Read Write If this element is a child of another used to set or retrieve the ElementiD of the other element If not returns 0 Collection Read only List of logical partitions into which an element can be divided Only valid for elements that support partitions such as A
169. d line and re register Enterprise Architect using EA exe unregister then EA exe register See the general library documentation on the use of Classes The following example creates and opens a repository object Public Sub ShowRepository Dim MyRep As New EA Repository MyRep OpenFile c eatest eap End Sub Borland Delphi 7 0 1 2 3 Create a new project Select the Project Import Type Library menu option Select Enterprise Architect Object Model 2 0 from the list If this does not appear go to the command line and re register Enterprise Architect using EA exe unregister then EA exe register Click on the Create Unit button Include EA_TLB in Project1 s Uses clause See the general library documentation on the use of Classes The following example creates and opens a repository object procedure TForm1 Button1Click Sender TObject var r TRepository b boolean begin r TRepository Create nil b r OpenFile c eatest eap end Microsoft C 1 2 3 Java Select the Visual Studio Project Add Reference menu option Click on the Browse tab Navigate to the folder in which you installed Enterprise Architect usually Program Files Sparx Systems EA and select Interop EA dll See the general library documentation on the use of Classes The following example creates and opens a repository object private void button1_Click object sender System EventArgs e EA Reposito
170. d In Model 141 EA OnPreNewAttribute 144 EA OnPreNewConnector 142 EA_OnPreNewDiagram 143 EA OnPreNewDiagramObject 143 EA OnPreNewElement 141 EA OnPreNewMethod 145 EA OnPreNewPackage 145 Profile Add Elements 6 Add Enumeration Elements 14 Add Metaclasses 6 Add Shape Script 15 Add Stereotypes 6 Add To MDG Technology 35 And Element Templates 3 Constraints 12 Create 5 Diagram Create 52 Export 17 Import From XML 3 Package 5 Save From Diagram 18 Save From Package 18 Set Default Appearance Of Stereotype Objects 17 Stereotype 5 24 Stereotypes 3 Tags 8 Tasks Pane Create 54 Toolbox 47 Work With 5 Project Browser Icon User Defined 19 Project Interface Automation Interface 271 Project 271 Projectlssues Automation Interface Repository 219 ProjectResource Automation Interface Repository 220 Properties Automation Interface ElementFeatures Package 254 Properties EASL Action 113 Argument 113 Behavior 113 CallEvent 113 ChangeEvent 113 Classifier 113 Condition 113 Construct 113 Edge 113 EventObject 113 Instance 113 Parameter 113 Primitive 113 PropertyObject 113 SignalEvent 113 State 113 StateMachine 113 TimeEvent 113 Transition 113 Trigger 113 Vertex 113 Property Automation Interface ElementFeatures Package 254 PropertyType Automation Interface Repository 221 PropType Enum Automation Interface 194 Q Query Methods In Shape Scripts 72 Quick Linker Enterprise Architect Software
171. d Tags setting _TargetAggregation Used to set the aggregation type at the end of a connector do not set both _SourceAggregation and _TargetAggregation Enterprise Architect Software Developers Kit Developing Profiles Create Profiles 21 E Set to 1 for shared 2 for composite _TargetMultiplicity Used to set the multiplicity of the target element such as 1 or 0 1 _TargetNavigability If the connector is non navigable set this attribute to Non Navigable For other values set the direction 257 attribute 1 2 9 1 Define a Stereotype as a Metatype The _metatype attribute is applied to a stereotype element This is used where users want to hide the identity of an element as a stereotyped UML element It is also a method of getting custom types to appear in contexts where only Enterprise Architect s inbuilt types would normally appear for example in the lists of element types in the Relationship Matrix In the following example from SysML block is defined as a stereotype that extends a UML Class ametscisss Class Active Boolean extends _metatype string Block However a SysML user isn t interested in UML Classes only in SysML Blocks An element created from a stereotype defined this way while behaving like a stereotyped Class in most contexts e Shows Block Properties rather than Class Properties as the title of its Properties dialog e Is auto numbered as Block not Class o
172. d to define templates for custom languages Define a Template for a Custom Language 1 Create the custom language as a new product To do this e Select the Settings Code Datatypes menu option The Programming Languages Datatypes dialog displays e Inthe Product Name field type the name of the new language and in the Datatype field type a datatype one is enough to declare that the new language exists See the Data Types topic in UML Model Management for more details 2 Select the Settings Code Generation Templates menu option The Code Templates Editor view displays In the Language field click on the drop down arrow and select the custom language From the Templates list select one of the base templates Define the template using the Code Templates Editor Click on the Save button This stores the template in the EAP file 7 Repeat steps 1 to 6 for each of the relevant base templates for the custom language DA Note The File template must be defined for the custom language The File template can then see the Import Section Namespace and Class templates Enterprise Architect Software Developers Kit Enterprise Architect Add In Model 123 6 Enterprise Architect Add In Model Introduction Add Ins enable you to add functionality to Enterprise Architect The Enterprise Architect Add In model builds on the features provided by the Automation Interface 18h to enable you to extend the Enterpr
173. d to show particular items to the user Sub EA_GetMenuState Repository As EA Repository Location As String MenuName As String ItemName As String IsEnabled As Boolean IsChecked As Boolean Select Case Location Case TreeView Always enable Case Diagram Always enable Case MainMenu Select Case ItemName Case amp Translate Save amp Project If GetlsProjectSelected Then IsEnabled False End If End Select End Select IsChecked GetlsCurrentSelection End Sub 6 1 1 2 Deploy Add Ins To deploy Add Ins to users sites follow the steps below 1 Add the Add In DLL file to an appropriate directory on the user s computer that is C Program Files new dir 2 Register the DLL as appropriate to your platform e If compiled as a native Win32 DDL such as VB6 or C register the DDL using the regsvr32 command from the command prompt for example regsvr32 C Program Files MyCompany EAAddin EAAddin dll e If compiled as a NET DLL such as CH or VB NET register the DLL using the RegAsm command from the command prompt for example C AWINDOWS Microsoft NET Framework v2 0 50727 RegAsm exe C Program Files MyCompany EAAddin EAAddin dll codebase 3 Place a new entry into the registry using the registry editor run regedit so that Enterprise Architect recognizes the presence of your Add In 4 Add a new key value EAAddIns under the location HKEY_CURRENT_USER Software Sparx Systems de Sparx Systems de EA Le
174. de Template Syntax 109 The following points apply to the P macro The value of the Pl is not accessed explicitly Only template lines that result in a non empty substitution cause the Pl to be generated The last non empty template line does not cause the Pl to be generated The Pl is not appended to the last substitution regardless of which template line caused that substitution Synchronization Macros The synchronization macros are used to provide formatting hints to Enterprise Architect when inserting new sections into the source code during forward synchronization The values for synchronization macros must be set in the File templates The structure for setting synchronization macros is lt name gt lt value gt where lt name gt can be one of the macros listed below and lt value gt is a literal string enclosed by double quotes synchNewClassNotesSpace Space to append to a new Class note Default value n synchNewAttributeNotesSpace Space to append to a new attribute note Default value n synchNewOperationNotesSpac Space to append to a new operation note Default value n e synchNewOperationBodySpace Space to append to a new operation body Default value n synchNamespaceBodylndent Indent applied to Classes within non global namespaces Default value t 5 1 2 6 EASL Code Generation Macros Enterprise Architect provides two Enterprise Architect Simulation Library EASL code generation mac
175. definition with the Exclusive to stereotype flag column P set to TRUE then the default Quick Linker definitions between the given source and target are overridden However you might want to override the defaults without actually having a Quick Linker definition For example if you don t define any Quick Links for a quick Class to another quick Class Enterprise Architect displays the default Quick Links for a Class to another Class To override this behaviour create a Quick Linker definition that has the source element type source stereotype filter target element type and target stereotype filter fields columns A B C and D all set with the Exclusive to stereotype flag column P set to TRUE and with the new link type field column H set to lt none gt For example add this line to the example in Quick Linker Example 27 Class quick Interface lt none gt TRUE 0 This overrides the default Class to Interface Quick Links when a Quick Link is dragged from a quick Class to an Interface element Enterprise Architect Software Developers Kit Developing Profiles Quick Linker 29 Note This technique does not affect the automatic appearance of Dependency Trace Information Flow and Help items on the Quick Linker menu 1 3 4 Quick Linker Object Names List of Element Types The following element names can be used in Quick Linker definitions Action ActionPin Activity Activi
176. del Poll its members to retrieve model data and user interface status information 6 5 15 3 EA_OnEndValidation Details EA_OnEndValidation notifies Add Ins that model validation has completed Use this event to arrange any clean up operations arising from the validation Syntax Sub EA_OnEndValidation Repository As EA Repository ParamArray Args as Variant The EA_OnEndValidation function syntax contains the following elements ParamArray of Contains a list of Rule Categories that were active for Variant the invocation of model validation that has just completed Repository 4 Repositoryl19 An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information O 1998 2010 Sparx Systems Pty Ltd 162 Enterprise Architect Add In Model Broadcast Events 6 5 15 4 EA_OnRunElementRule Details This event is triggered once for each rule defined in EA_OnlnitializeUserRules to be performed on each element in the selection being validated If you don t want to perform the rule defined by RulelD on the given element then simply return without performing any action On performing any validation if a validation error is found use the Repository ProjectInterface PublishResult method to notify Enterprise Architect Also look at EA_OnlnitializeUserRules 160 Syntax Sub EA_OnRunElementRule Repository As EA Repositor
177. down If there are any external automation clients Enterprise Architect must stay active in which case all the Add Ins are reloaded losing all the data e Enterprise Architect acting as an automation client does not close if an Add In still holds a reference to it releasing all references in the Disconnect event avoids this problem It is recommended that unless there is a specific reason for doing so the Add In should use the repository parameter and its method and properties to provide the necessary data Enterprise Architect Not Closing Net Specific Issues Automation checks the use of objects and won t enable any of them to be destroyed until they are no longer being used As noted in the Automation Interface 84 topic if your automation controller was written using the NET framework Enterprise Architect does not close even after you release all your references to it To force the release of the COM pointers call the memory management functions as shown below GC Collect GC WaitForPendingFinalizers Additionally because automation clients hook into Enterprise Architect which creates Add Ins which in turn hook back into Enterprise Architect it is possible to get into a deadlock situation where Enterprise Architect and the Add Ins won t let go of one another and keep each other active An Add In might retain hooks into Enterprise Architect because e It keeps a private reference to an Enterprise Architect object see
178. e Architect toolboxes The text in red indicates the label name displayed in the default Enterprise Architect Toolbox pages where this differs in any way from the UML statement text You can also extend elements 504 e Aggregation Aggregate e NoteLink Note Link e Assembly e ObjectFlow Object Flow 1998 2010 Sparx Systems Pty Ltd 52 MDG Technologies in SDK Customize Toolbox Profiles e Association Associate e AssociationClass Association Class e CallFromRecursion Call e CommunicationPath Communication Path e Composition Compose e Connector e ControlFlow Control Flow e Delegate e Dependency e Deployment e Extension e Generalization Generalize or Inheritance e InformationFlow Information Flow e InterruptFlow Interrupt Flow e Invokes e Manifest e Message e Nesting 2 4 Create Diagram Profiles Custom Diagram Types Occurrence Packagelmport Package Import PackageMerge Package Merge Precedes ProfileApplication Application Realization Realize or Implements Recursion Redefinition Representation Represents RoleBinding Role Binding SelfMessage Self Message TagValAssociation Tagged Value TraceLink Trace Transition UCExtend Extend UCInclude Include UseCaseLink Use You can create extended diagram types in Enterprise Architect and include them in MDG Technologies To do this perform the following steps 1 Create a profile wit
179. e model data and user interface status information Return Value Return True to enable deletion of the MDG Technology resource from the model Return False to disable deletion of the MDG Technology resource 6 5 12 5 EA_OnDeleteTechnology Deprecated refers to deleting a technology through the Resources window this process is no longer recommended See e EA OnPreActivateTechnology 152 e EA OnPostActivate Technology 15 e EA OninitializeTechnologies 152 Details EA_OnDeleteTechnology notifies Add Ins that an MDG Technology resource has been deleted from the model This event occurs after a user has deleted an MDG Technology resource from the model Add Ins that require an MDG Technology resource to be loaded can catch this event to disable certain functionality Also look at EA_OnPreDelete Technology 53 Syntax Sub EA_OnDeleteTechnology Repository As EA Repository Info As EA EventProperties The EA_OnDeleteTechnology function syntax contains the following elements peme Jerome ooo Contains the following EventProperty objects 77 NS EventPro erties e TechnologyID A string value corresponding to the MDG Technology ID EA Repository IN An EA Repository object representing the currently open Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 155 CIC CET CN y 197 Enterprise Architect model Poll its members to retrieve model data and
180. e Add In for information relating to the PropertyName This event should occur in as short a duration as possible as Enterprise Architect does not cache the information provided by the function Values corresponding to the following PropertyNames must be provided e IconlD Return the name of a DLL and a resource identifier in the format Res D where the resource ID indicates an Icon for example c program files myapp myapp dlll 101 e Language Return the default language that Classes should be assigned when they are created in Enterprise Architect e HiddenMenus Return one or more values from the MDGMenus enumeration to hide menus that do not apply to your Add In For example if PropertyName HiddenMenus return mgBuildProject mgRun Syntax Function MDG_GetProperty Repository As EA Repository PackageGuid As String PropertyName As String As Variant The MDG_GetProperty function syntax contains the following elements CE fe E IN PackageGuid String IN The GUID identifying the Enterprise Architect package sub tree that is controlled by the Add In PropertyNam String IN The name of the property that is used by Enterprise Architect e See Details for the possible values Repository EA IN An EA Repository object representing the currently open Repository Enterprise Architect model Poll its members to retrieve model O 1998 2010 Sparx Systems Pty Ltd 174 Enterprise Architect Add In Model MDG Add Ins
181. e Bi co Ee x fo ry Computer Class Author John Redfem 7 Handicap 11 MemberAge 35 MemberPhone 03 1234 5678 Membership Expires 30 Dec 2099 Note If the values in the reference data are changed after the Tagged Value Type is created Enterprise Architect must be reloaded in order to reflect the changes in the Tagged Value Type 4 5 Create Custom Tagged Value Type Creating a custom masked Tagged Value gives you great flexibility in designing model components that accept data entries To create a masked Tagged Value follow the steps below 1 Select the Settings UML menu option The UML Types dialog displays select the Tagged Value Types tab 2 Inthe Tag field type an appropriate name for the Tagged Value 3 Inthe Description field type the purpose of the Tagged Value if required 4 In the Detail field type Type Custom The type Custom enables you to set up the appropriate mask using the following characters to define the format of the mask Mask Description OO p eet Taner vane o aeara OO e reo Taste o asarsaran O EOS pers e o apro caes OO INES In the diagram below the Mask configuration option shows syntax that first defines seven blank spaces which are occupied by characters determined by the template option The first two visible characters in the Mask option are represented by a lower case c indicating that the enableable information can entered as either an alpha character or as a space The f
182. e Developers Kit MDG Technologies in SDK Create Diagram Profiles 53 2 4 1 Built In Diagram Types e DGMOWNERNAME e DGMOWNERNAMEFULL e DGMNAME e DGMNAMEFULL e swimlanes string Lanes 2 Orientation Horizontal Lane 1 Title1 Lane2 Title2 where Lanes can be any value but the number of Lane lt n gt values must equal the value of Lanes Orientation can be omitted in which case the swimlanes default to vertical e styleex string one or more of a range of values see Attribute Values stylex 8 pdatal 537 e pdata string one or more of a range of values see Attribute Values stylex 8 pdata 53 The following example shows the DFD diagram profile which defines a DFD diagram as an extension of the Enterprise Architect Analysis diagram alas sting Data Flow diagramiD string dfd toolbox string ToolboxProfile extends 7 Save the diagram as a profile in the usual manner 8 Add the diagram profile to thel 387 MTS file used in the MDG Technology The following is a full list of built in diagram types provided by Enterprise Architect Activity Analysis Collaboration Component CompositeStructure Custom Deployment InteractionOverview Logical Object Package Sequence Statechart Timing Use Case Note the use of Logical for Class diagrams and also notice the space in the middle of Use Case These names are used in Defining Child Diagram Types 23 or prefixed by Diagram_
183. e Editor 118 Enterprise Architect s code templates specify the transformation from UML elements to the various parts of a given programming language The templates are written as plain text with a syntax 8 that shares some aspects of both mark up languages and scripting languages The Base Templates provided in Enterprise Architect are described in the Base Templates topic of Code Engineering Using UML Models 5 1 Code Template Syntax Code Templates are written as plain text using Enterprise Architect s code template editor see The Code Template Editor 118 The template syntax centers on three basic constructs e Literal Text 88 e Macros 8 e Variables 11 Templates can contain any or all of these constructs 5 1 1 Literal Text All text within a given template that is not part of a macro or a variable definition reference is considered literal text With the exception of blank lines which are ignored literal text is directly substituted from the template into the generated code Consider the following excerpt from the java Class Declaration template Pl CONVERT_SCOPE classScope classStereotype static static classStereotype final final classStereotype static final static final classAbstract T abstract PI class className bases On the final line the word class including the subsequent space would be treated as literal text and thus reproduced in th
184. e from the toolbox a hidden menu displays giving the choice of Class or Interface then the appropriate element is dropped Enterprise Architect Software Developers Kit MDG Technologies in SDK Customize Toolbox Profiles 49 MyTech MyStereo Choose one extends MyTech MyStereo extends tsHidden true MyTech MyStereo UML Cisss Class MyTech MyStereo UML Interface Interface 2 3 3 Override Default Toolboxes Enterprise Architect has many default Toolbox Profiles one for each of its inbuilt diagram types These define the Toolbox pages that are displayed by default every time a diagram of a specific type is opened or brought into view To replace one of Enterprise Architect s default toolboxes with one of your own for example if you have your own version of the UML Class toolbox that you want to be opened every time a Class diagram is opened as long as your technology is active then include a RedefinedToolbox clause in the Notes field for the diagram properties of your Toolbox Profile diagram For example the profile diagram s Notes field could resemble the following RedefinedToolbox UML Class Alias Class Notes Structural elements for Class diagrams This states that the toolbox defined by this profile replaces the Enterprise Architect toolbox UML Class as the default toolbox for all UML Class diagrams For a list of inbuilt toolboxes see the Enterprise Archit
185. e how to create and apply Shape Scripts e Getting Started with Shape Scripts 61 e Write Scripts es e Example Scripts 7A e Shape Editor 6 e Add Shape Scripts to UML Profiles 157 3 1 Getting Started With Shape Scripts Shape Scripts 611 are associated with stereotypes and are defined via the Stereotypes tab of the UML Types dialog To access this dialog select the Settings UML menu option Each stereotype defined can have a Shape Script 1998 2010 Sparx Systems Pty Ltd 62 Shape Scripts Getting Started With Shape Scripts Stereotypes Tagged Value Types Cardinaity Values Stereotype myStereotype Group name interview Suspect Constrain must always hold f Joinerism Notes my Stereotype Ajava server page BPMN Lane object Static or dynamic object library A List of Information Astand list view control The corresponding object is BPMN MessageFlow conne A classifier whose objects ar Base Class object Set a class as an RTF Mod monster name Contains business process O occurrence option Subsystem corresponding to A GUI element for grouping The corresponding element i A class that represents a per _ You can create a Shape Script for an existing stereotype by selecting the stereotype from the list Alternatively you can create new stereotypes by clicking on the New button and giving the stereotype a name Select a base
186. e next step is to create a set of Tasks Pane Contexts 574 2 5 1 1 Built In Tasks Pane Commands The following Enterprise Architect commands can all be used in user defined Tasks Pane profiles Tasks Pane pages have attributes named in the form EASystem MenuCmd lt CommandName gt where lt CommandName gt is the name chosen from the following list 1998 2010 Sparx Systems Pty Ltd 56 MDG Technologies in SDK Create Tasks Pane Profiles AddDiagram AddElement AddPackage AutoRecordThread AddModelFromPattern Build BuildScripts ConfigureCSV ConfigureValidation CreateBaseLine CreateSequenceDiagram ImplementationDetails ImportBinary ImportExportCSV ImportSchema ImportSourceDirectory ImportWSDL ImportXMI ImportXMLSchema Run RunHTMLReport RunRTFReport ValidateModel ViewAuditing ViewDebug ViewElementList ViewForum for Team Review window ViewHierarchy for Traceability window ViewMaintenance ViewOutput ViewProjectManagement ViewRelationships DebugPause SetClassifier ViewRelMatrix DebugRun ShowHideExecution ViewRequirementTypes DebugStop StartDebugRecording ViewRules Deploy Stepinto ViewSearch DiagramsOnlyReport StepOut ViewSourceCode ElementUsage StepOver ViewTaggedValues ExportXMI StopDebugRecording ViewTesting FileNew Test ViewTestingDetails FileOpen TestingReport ViewWebBrowser GenerateDDL ToggleLevelNumbering GenerateWSDL TransformPackage e GenerateXMLSchema e TransformSelec
187. e output The blank line following the CONVERT_SCOPE macro however would have no effect on the output The and characters have special meaning in the template syntax and cannot always be used as literal text If these characters must be generated from within the templates they can be safely reproduced using the following direct substitution macros Adl Produce a literal character Produce a literal character qt Produce a literal character Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 89 5 1 2 Macros 5 1 2 1 Macros provide access to element fields within the UML model and are also used to structure the generated output All macros are enclosed within percent signs The CTF contains six basic types of macros e Template substitution macros 89 e Field substitution macros 90 e Tagged Value substitution macros 102 e Control macros 10 e Function macros 10 e EASL code generation macros 10 In general macros including the delimiters are substituted with literal text in the output For example consider the following item from the Class Declaration template Class className The field substitution macro className would result in the current Class name being substituted in the output So if the Class being generated was named Foo the output would be Class FOO Template Substitution Macros Tem
188. e sequence of drawing commands that define a path strokepath Draws the outline of the previously defined path with the current pen 3 3 4 Color Queries Color queries can only be used to retrieve arguments for the SetPenColor and SetFillColor commands These queries can be used in place of the arguments getUserFillColor getUserBorderColor getUserFontColor getUserPenSize shape main setfillcolor getuserbordercolor setpencolor getuserfillcolor rectangle 0 0 100 100 3 3 5 Conditional Branching Shape Scripts provide condition branching with the if else statement and query methods that evaluate to either True or False See e Syntax Grammar 65 for IF statement syntax e Query Methods 721 for methods that can be used as the conditional expression for IF statements e Example Scripts 77 for an example 3 3 6 Query Methods Two query methods are available for seeing if the associated element has certain tags or properties these methods can be used as the conditional expression for an if else statement C boolean HasTag Returns true if the associated element has a tag value with the name tagname string tagname If the second parameter tagvalue is provided the tag tagname must be present string and the value of the tag has to be equal to tagvalue for the method to return true tagvalue boolean HasProperty Returns true if the associated element has a property with the name string propertyna
189. e the control Parameters e TabName String used as the tab caption e ControllD String the ProgID of the control for example Project1 UserControl1 AddWindow string activex Adds an ActiveX custom control as a window to the Add Ins WindowName string custom docked window Enterprise Architect creates a control and ControllD control if successful returns its Unknown pointer which can be used by the caller to manipulate the control The window can be shown by selecting it from the list in the Workspace Layouts toolbar see Using Enterprise Architect 1998 2010 Sparx Systems Pty Ltd 200 Enterprise Architect Object Model Reference AdviseConnectorChange long ConnectorlD AdviseElementChange long ObjectID ChangeLoginUser string Name string Password ClearAuditLogs Object StartDateTime Object EndDateTime ClearOutput string Name CloseAddins Cioseaddins0 Boolean UML Modeling Tool click on the third icon from the right and look at the end of the list Parameters e WindowName String used as the window title e ControllD String the ProgID of the control for example Project1 UserControl1 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 e Connec
190. e top edge of its parent For example topAnchorOffset 0 10 move embedded element down 10 pixels from the top edge string Affects vertical placement of printed text and subshapes depending on the layoutType attribute Valid values top center or bottom 3 3 3 Drawing Methods addsubshape Adds a sub shape with the name shapename that must be defined within string shapename the current shape definition int width int height Draws an elliptical anticlockwise arc with the ellipse having extents at left int left top right and bottom The start point of the arc is defined by the int top intersection of the ellipse and the line from the center of the ellipse to the int right point startingpointx startingpointy The end of the arc is similarly int bottom defined by the intersection of the ellipse and the line from the center of the int startingpointx ellipse to the point endingpointx endingpointy int startingpointy int endingpointx int endingpointy For example Arc 0 0 100 100 95 0 5 0 As for the arc method except that a line is drawn from the current position int left to the starting point of the arc and then the current position is updated to int top the end point of the arc int right Enterprise Architect Software Developers Kit Shape Scripts Write Scripts 69 int bottom int startingpointx int startingpointy int endingpointx int endingpointy bezie
191. eConstraint ElementFeatures Package 246 AttributeTag ElementFeatures Package 247 Available Resources 186 Call Executables From Enterprise Architect 181 Call From Enterprise Architect 185 Code Example Add And Delete Attributes 288 Code Example Add And Delete Methods 288 Code Example Add And Manage Diagrams 287 Code Example Add And Manage Elements 286 Code Example Add And Manage Packages 285 Code Example Add Connector 286 Code Example Add Stereotypes 292 Code Example Iterate Through EAP File 284 Code Example Open The Repository 284 Code Example Use Element Extras 288 Code Example Use Repository Extras 290 Code Example Work With Attributes 292 Code Example Work With Methods 293 Code Examples Introduction 284 Connect From Borland Delphi 7 0 181 Connect From Java 181 Connect From MS C 181 O 1998 2010 Sparx Systems Pty Ltd 298 Index Automation Interface Connect From MS Visual Basic 6 0 181 Connect To 181 Connector Package Diagram 255 Connector Connector Package 257 ConnectorConstraint Connector Package 256 ConnectorEnd Connector Package 260 ConnectorTag Connector Package 262 ConstLayoutStyles Enum 191 Constraint Element Package 227 CreateBaselineFlag Enum 192 CreateModelType Enum 192 CustomProperties Collection ElementFeatures Package 248 Diagram Package 263 Diagram Diagram Package 264 DiagramLinks Diagram Package 267 DiagramObjects Diagram Package 268 Effort
192. eDeletePackage Pre Deletion Events Add In Model EA_OnPreDelete Technology Technology Events Add In Model 1 EA OnPreExitInstance 301 52 138 139 140 138 139 141 53 Broadcast Events Add In Model 146 EA OnPreNewAttribute Pre New Events Add In Model 144 EA OnPreNewConnector Pre New Events Add In Model 142 EA_OnPreNewDiagram Pre New Events Add In Model 143 EA _OnPreNewDiagramObject Pre New Events Add In Model 143 EA OnPreNewElement Pre New Events Add In Model 141 EA OnPreNewMethod Pre New Events Add In Model 145 EA_OnPreNewPackage Pre New Events Add In Model 145 EA_OnRetrieveModelTemplate Broadcast Events Add In Model 168 EA OnRunAttributeRule Model Validation Broadcasts Add In Model 163 EA OnRunConnectorRule Model Validation Broadcasts Add In Model 163 EA_OnRunDiagramRule Model Validation Broadcasts Add In Model 162 EA OnRunElementRule Model Validation Broadcasts Add In Model 162 EA OnRunMethodRule Model Validation Broadcasts Add In Model 164 EA _OnRunPackageRule Model Validation Broadcasts Add In Model 162 EA OnRunParameterRule 1998 2010 Sparx Systems Pty Ltd 302 Index EA_OnRunParameterRule Model Validation Broadcasts Add In Model 164 EA OnStartValidation Model Validation Broadcasts Add In Model 161 EA_QueryAvailableCompartments Compartment Events Add In Model 158 EA_ShowHelp Add In Event 134 EAP File
193. ect Toolboxes 50 gt topic 2 3 4 Assign Icons To Toolbox Items To assign an icon to a toolbox item create a new stereotype element in the same toolbox profile as the toolbox item Have the stereotype element extend a metaclass element named Toolboxltemimage The stereotype element must have the same name as the attribute that it is assigning an image to for example MyTech MyStereo UML Class in the diagram below and must have an attribute named con with Initial Value set to the full path and file name of the image to be used The image must be a 16x16 BMP file My Elements lt gt MyElements MyTech MyStereo UML Class My Stereo extends extends MyTech My Stereo UML Class lt gt metaciass Toolboxltemimage Icon C images MySte O 1998 2010 Sparx Systems Pty Ltd 50 MDG Technologies in SDK Customize Toolbox Profiles 2 3 5 Enterprise Architect Toolboxes The following is a list of the Enterprise Architect UML Toolboxes that can be overridden UML UML UML UML UML UML UML UML UML UML UML UML UML Activity Class Communication Component Composite Deployment Interaction Metamodel Object Profile State Timing UseCase Extended Extended Extended Extended Extended Extended Extended Extended 2 3 6 Elements Used in Toolboxes Analysis Custom DataModeling Maintenance Require
194. ect model Poll its members to retrieve model a data and user interface status information Return Value Returns a non zero to indicate that a disconnection has occurred enabling Enterprise Architect to update the user interface A zero indicates that the user has not disconnected from an external project Enterprise Architect Software Developers Kit Enterprise Architect Add In Model MDG Add Ins 173 6 7 1 4 MDGGetConnectedPackages Details MDG_GetConnectedPackages enables the Add In to return a list of current connection between Enterprise Architect and an external application This function is called when the Add In is first loaded and is expected to return a list of the available connections to external projects for this Add In Also look at MDG_Connectl17h Syntax Function MDG_GetConnectedPackages Repository As EA Repository As Variant The MDG_GetConnectedPackages function syntax contains the following elements pm ret eres ooo Repository EA An EA Repository object representing the currently open Enterprise Repository Architect model Poll its members to retrieve model data and user 1977 interface status information Return Value Returns an array of GUID strings representing individual Enterprise Architect packages 6 7 1 5 MDGGetProperty Details MDG_GetProperty provides miscellaneous Add In details to Enterprise Architect This function is called by Enterprise Architect to poll th
195. ect 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 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 The GUID identifying the Enterprise Architect package sub tree that is controlled by the Add In EA An EA Repository object representing the currently open Repositor Enterprise Architect model Poll its members to retrieve model data and user interface status information 19 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 1751 for the format of the Object IDs SynchType String OUT The value determining the user selected type of synchronization to take place See belowl175 for a list of valid values Repository Enterprise Architect Software Developers Kit Enterprise Architect Add In Model MDG Add ins 175 Return Value Return a non zero if the merge operation completed successfully and a zero value when the operation has been unsuccessful Merge
196. ector ends AdvancedConnectorProps 1 to show connector property strings SuppConnectorLabels 1 to suppress all connector labels pdata string UseAlias 1 to use the aliases or elements in the diagram if available HideParents 0 to show additional parents of elements in the diagram HideEStereo 0 to show element stereotypes in the diagram ShowSN 1 to show sequence notes Showlcons 1 to use stereotype icons HideAtts 0 to show the element Attributes compartment HideOps 0 to show the element Operations compartment ShowTags 1 to show the element Tagged values compartment ShowReqs 1 to show the element Requirements compartment ShowCons 1 to show the element Constraints compartment HideStereo 0 to show attribute and operation stereotypes HideProps 0 to show property methods OpParams 3 to show operation parameters HideRel 0 to show relationships SuppCN 0 to show collaboration numbers 2 5 Create Tasks Pane Profiles Defining Tasks Pane profiles is a four part process 1 Define Toolboxes 557 Create any number of stereotype elements that each define a Tasks Pane toolbox page 2 Define Contexts 571 Create any number of stereotype elements that each define a named Context A context might be when a specific diagram type is open or when a specific element type is selected 3 Allocate Contexts 5 to Toolboxes Define the many to many relationships between the Tasks Pane toolboxes and the a
197. ects in the current file corresponds abstract String to Modelsli98iin Repository EnumViews protected Enumerates the Views for a project Returned as an abstract String XML document EnumViewEx string protected Gets a list of Views in the current project ProjectGUID abstract String Parameters e ProjectGUID String the GUID in XML format of the project to get views for protected Exits the current instance of Enterprise Architect this abstract String function is maintained for backward compatibility and Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 275 ExportPackageXMI string protected PackageGUID enumXMIType abstract String XMIType long DiagramXML long Diagramlmage long FormatXML long UseDTD string FileName ExportPackageXMIEx string protected PackageGUID enumXMIType abstract String XMIType long DiagramXML long Diagramlmage long FormatXML long UseDTD string FileName ea ExportPackageXMIFlag Flags should never be called Enterprise Architect automatically exits when you are no longer using any of the provided objects Exports XMI for a specified package Parameters e PackageGUID String the GUID in XML format of the package to be exported XMIType EnumXMIType specifies the XMI type and version information see XM Type Enum 19 for accepted values DiagramXML Long true if XML for diag
198. ed Change ShapeScript Fonts Not possible Can apply a Shapescript without using Stereotypes No 3 4 Example Scripts Below is a selection of example Shape Scripts BASIC SHAPES shape main setfillcolor 255 0 0 R G B rectangle 0 0 90 30 x1 y1 x2 y2 setfillcolor 0 255 0 R G B ellipse 0 30 90 60 x1 y1 x2 y2 setfillcolor 0 0 255 R G B rectangle 0 60 90 90 Pf xl yyl x2 y2 SINGLE CONDITIONAL SHAPE shape main if HasTag Trigger Link Only draw if the object has a Tagged Value Trigger Link Set the fill color for the path setfillcolor 0 0 0 startpath Start to trace out a path moveto 23 40 lineto 23 60 lineto 50 60 lineto 50 76 lineto 76 50 lineto 50 23 lineto 50 40 endpath End tracing out a path Fill the traced path with the fill col fillandstrokepath return MULTI CONDITIONAL SHAPE shape main startpath ellipse 0 0 100 100 endpath fillandstrokepath ellipse 3 3 27 27 1998 2010 Sparx Systems Pty Ltd 78 Shape Scripts Example Scripts if HasTag Trigger None return if HasTag Trigger Error setfillcolor 0 0 0 startpath moveto 23 77 lineto 37 40 lineto 60 47 lineto 77 23 lineto 63 60 lineto 40 53 lineto 23 77 endpath fillandstrokepath return if HasTag Trigger Message recta
199. el 173 MDG_Merge Add In Model 174 MDG_NewClass Add In Model 175 MDG_PostGenerate Add In Model 176 MDG_PostMerge Enterprise Architect Software Developers Kit Index 305 MDG_PostMerge EA_OnRunPackageRule 162 Add In Model 176 EA OnRunParameterRule 164 MDG_PreGenerate EA OnStartValidation 161 Add In Model 177 Model Validation Example 165 MDG_PreMerge Model Views Add In Model 177 Define In MTS File 46 MDG_PreReverse Models Collection 197 Add In Model 178 ModelWatcher MDG_Run_Exe Automation Interface Repository 214 Add In Model 179 MTS File MDG_View Advanced Options 46 Add In Model 179 Create 46 MDGMenus Enum Incorporate Model Search 46 Automation Interface 193 Incorporate Model View 46 Menu Working With 46 Items Define In Add In 124 Multiple Stereotype Metaclass Restrict Application Of 21 Add To Profile 6 Method O a Add And Delete Automation Interface Code Example 288 Automation Interface ElementFeatures Package ObjectType Enum 249 Automation Interface 193 Work With Automation Interface Code Example Open Repository 293 Automation Interface Code Example 284 MethodConstraint Override Automation Interface ElementFeatures Package Default Toolbox In Toolbox Profile 49 251 MethodTag P Automation Interface ElementFeatures Package iz 252 Metric Package Automation Interface Element Package 236 Apt wae Automation Interface Code MigrateToBPMN11 pe Automation Interface 187 Function 271 l Automati
200. el menu For a simple Add In with just a single menu option you can return a string for example Function EA_GetMenultems Repository as EA Repository MenuLocation As String MenuName As String As Variant EA_GetMenultems amp Joe s Add In End Function To define sub menus prefix a parent menu with a dash Parent and sub items are defined as follows Function EA_GetMenultems Repository as EA Repository MenuLocation As String MenuName As String As Variant Select Case MenuName Case Parent Menu Item EA_GetMenultems amp Joe s Add In Case amp Joe s Add In Define Sub Menu Items using the Array notation In this example Diagram and Treeview compose the Joe s Add In sub menu EA_GetMenultems Array amp Diagram amp Treeview Case Else Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Add In Tasks 125 MsgBox Invalid Menu vbCritical End Select End Function Similarly you can define further sub items Function EA_GetMenultems Repository as EA Repository MenuLocation As String MenuName As String As Variant Select Case MenuName Case EA_GetMenultems Joe s Add In Case Joe s Add In EA_GetMenultems Array amp Diagram amp TreeView Case amp Diagram EA_GetMenultems amp Properties Case Else MsgBox Invalid Menu vbCritical End Select End Function To enable or disable menu options by default you can use this metho
201. element in many different ways Enterprise Architect enables you to define custom templates that are associated with given elements and call these templates from existing templates You can even add stereotype overrides to your custom templates For example you might list all of your parameters and their notes in your method notes To create a new custom template follow the steps below 1 Select the Settings Code Generation Templates menu option or press Cirl Shift P The Code Templates Editor tab opens 2 Inthe Language field click on the drop down arrow and select the appropriate language 3 Click on the Add New Custom Template button The Create New Custom Template dialog displays Template Type y Template Name la 4 Inthe Template Type field click on the drop down arrow and select the appropriate element The elements currently supported are e Attribute e Class e Class Base e Class Interface e Class Parameter e Connector e Import e Linked Attribute e Linked Class Base e Linked Class Interface e Namespace e Operation e Parameter Note lt None gt requires special treatment It enables the definition of a function macro that doesn t actually apply to any of the types but must be called as a function to define variables oarameter1 parameter2 and so on for each value passed in 5 Inthe Template Name field type an appropriate name then click on the OK button 6 Onthe
202. elow lt CodeOptions gt lt CodeOption name DefaultExtension gt ext lt CodeOption gt lt CodeOption name Editor gt C Windows inotepad exe lt CodeOption gt lt CodeOptions gt 4 Click on the Next button to proceed You can edit the code option values for source code engineering and for each required language using the appropriate Language Options page of the Options dialog see the Code Engineering Settings section in Code Engineering Using UML Models 2 1 8 Add MDA Transforms When creating an MDG Technology file you can include the MDA Transformations that have been modified in the model To use the Transform Modules section of the MDG Technology Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 301 topic up to and including Step 6 33 where you select the MDA Transforms checkbox The MDG Technology Wizard Transform Modules dialog displays MDG Technology Wizard Transform Modules Select the MDA transform modules to be included in this technology Transform lv MEN 2 Click the checkbox against the template name of each required template that is present in the current model 3 Click on the Next button to proceed Enterprise Architect Software Developers Kit MDG Technologies in SDK Create MDG Technologies 43 2 1 9 Add Images When creating an MDG Technology file you can include the images that have been imported into the m
203. em and add elements to the collection by passing the Object ID as a name to select them ShowDetails Long Read Write Flag to indicate Diagram Details text should be shown 1 Show 0 Hide ShowPackageCont Boolean Read Write Flag to indicate package contents should be shown in the ents current diagram Sonem oscar pesas Fanio sovornar StyleEx String Read Write Advanced style settings Reserved for the use of Sparx Systems String Read Write Information on swimlanes contained in the E Please note that this property is superseded by SwimlaneDef 26 SwimlaneDef Swimlane Read Write Information on swimlanes contained in the diagram Deflzs5 Type String Read only The diagram type See the t_diagramtypes table in the EAP file for more information Read Write The version of the diagram Diagram Methods ApplyGroupLock Boolean Applies a group lock to this diagram object for the specified group on string behalf of the current user aGroupName Throws an exception if the operation fails Use GetLastError to retrieve error information Parameter e aGroupName String the name of the user group for which to set the group lock ApplyUserLock Boolean Applies a user lock to this diagram object for the current user Throws an exception if the operation fails Use GetLastError to retrieve error information GetLastError Returns a string value describing the most recent error that occurred in rel
204. eneric 3 opStereotype operator operator 3 PI 3 3opNames3 3list Parameter separator topTag throws 2 in throws value pointcut aspect advice aspect m Add New Custom Template r Add New Stereotyped Override Get Default Template Save Delete 8 Click on the Save button This stores the new stereotyped template in the EAP file The template is now available from the list of templates and via direct substitution for use 5 2 2 Override Default Templates Enterprise Architect has a set of built in or default code generation templates The Code Templates Editor enables you to modify these default templates hence customizing the way in which Enterprise Architect generates code You can choose to modify any or all of the base templates to achieve your required coding style Any templates that you have overridden are stored in the EAP file When generating code Enterprise Architect first checks whether a template has been modified and if so uses that template Otherwise the Enterprise Architect Software Developers Kit Code Template Framework in SDK The Code Template Editor in SDK 121 appropriate default template is used Procedure To override a default code generation template follow the steps below il 5 6 Select the Configuration Code Generation Templates menu option The Code Templates Edit
205. ent ExceptionHandler ExitPoint ExpansionNode ExpansionRegion GUIElement InteractionFragment Issue Node Note Object Package Parameter Part Port Providedinterface Report Requiredinterface Requirement Screen Sequence State StateNode Synchronization Text TimeLine UMLDiagram UseCase Read Write The version of the element Visibility Element Methods ApplyGroupLock string Boolean aGroupName ApplyUserLock Boolean GetLastError GetLinkedDocument Read Write The Scope of this element within the current package Valid values are Public Private Protected or Package Applies a group lock to the element object for the specified group on behalf of the current user Throws an exception if the operation fails Use GetLastError to retrieve error information Parameter e aGroupName String the name of the user group for which to set the group lock Applies a user lock to the element object for the current user Throws an exception if the operation fails Use GetLastError to retrieve error information Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Returns a string value containing the element s linked document contents in RTF format If the element contains no linked document an empty string is returned GetRelationSet Retu
206. ents Also look at EA_OnOutputltemClicked 133 Syntax EA_OnOutputltemDoubleClicked Repository As EA Repository TabName As String LineText As String ID As Long The EA_OnOutputltemClicked function syntax contains the following elements Ponce ine peon O PAP The ID value specified in the original call to Repository WriteOutput LineText String The text that had been supplied as the String parameter in the original call to Repository WriteOutput Repository EA An EA Repository object representing the currently open Enterprise Repositor Architect model Poll its members to retrieve model data and user i interface status information 19 TabName String IN The name of the tab that the click occurred in Usually this would have been created through Repository AddTab Return Value None 6 4 8 EA_ShowHelp Details The EA_ShowHelp event enables the Add In to show a help topic for a particular menu option When the user has an Add In menu option selected pressing F1 can be delegated to the required Help topic by the Add In and a suitable help message shown This event is raised when the user presses F1 on a menu option that is not a parent menu Also look at EA_GetMenultems 13h Syntax Sub EA_ShowHelp Repository as EA Repository MenuLocation As String MenuName as String ItemName as String The EA_ShowHelp function syntax contains the following elements CO EN CEE String The name of the option ac
207. ents This function is called by Enterprise Architect when the user asks to view a particular code element This enables the Add In to present that element in its own way usually in a code editor Syntax Function MDG_View Repository As EA Repository PackageGuid As String CodelD as String As Long The MDG_View function syntax contains the following elements CE CN Repository EA IN An EA Repository object representing the currently open Repository Enterprise Architect model Poll its members to retrieve model data and user interface status information PackageGuid String IN The GUID identifying the Enterprise Architect package sub tree that is controlled by the Add In CodelD String IN Identifies the code element in the following format lt type gt ElementPart lt type gt ElementPart where each element is proceeded with a token identifying its type namespace 1998 2010 Sparx Systems Pty Ltd 180 Enterprise Architect Add In Model MDG Add Ins CC COTO CTN Class attribute Operation For example if a user has selected the m_Name attribute of Class1 located in namespace Name the class ID would be passed through in the following format Name1 Class1 m_Name Return Value Return a non zero value to indicate that the Add In has processed the request Returning a zero value results in Enterprise Architect employing the standard viewing process which is to launch the associated source f
208. er e FileName String the name of the RTF file to which to save the linked document SetAppearance long Void Sets the visual appearance of the element Scope long Item long Value Parameter e Scope Long Scope of appearance set to modify 0 Local Diagram local appearance 1 Base Default appearance across entire model Item Long Appearance item to modify 0 Background color 1 Font Color 2 Border Color 3 Border Width e Value Long Value to set appearance to Update Boolean Update the current element object after modification or appending a new item If false is returned check the GetLastError function for more information Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 235 7 2 5 4 File public Class A File represents an associated file for an element It is accessed through the Element Files collection Associated table in EAP file t_objectfiles File Attributes A AA FileDate Read Write The file date when entry is created String Read Write The file name can be a logical file or a reference to a web address using http Notes Stig Read Write Notes about the file ObjectType Object Typ Read only Distinguishes objects referenced through a Dispatch interface e 1937 sms sima Reaarwrie The te se File Methods GetLastError Returns a string value describing the most recent error that
209. erateDiagramFromScenario 274 method They specify the type of diagram to generate See the Scenarios section in UML Modeling With Enterprise Architect UML Modeling Tool sdActivity Generate an Activity diagram Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 195 sdActivityWithAction Generate an Activity diagram with an Action sdActivityWithActionPin Generate an Activity diagram with an ActionPin sdActivityWithActivityParameter Generate an Activity diagram with an ActivityParameter 7 2 3 12 ScenarioStep Type Enum The ScenarioStep Type enumeration is used to identify the steps 24h of a scenario and the entity performing the step stSystem Identify that the step is an action performed by the system Identify that the step is an action performed by an actor 7 2 3 13 ScenarioTestType Enum The ScenarioTestType enumeration provides the following enumeration values to the Project GenerateTestFromScenario 27 method They specify the type of test to generate See the Scenarios section in UML Modeling With Enterprise Architect UML Modeling Tool stExternal Generate an external Test Case element stinternal Generate an internal test 7 2 3 14 XMIType Enum The following enumeration values are used in the Project ExportPackageXMI method They enable specification of the XMI export type xmiEADefault xmiRoseDefault xmiEA10 xmiEA11 xmiEA12 xmi
210. etwork drives use the Enterprise Architect Settings MDG Technologies menu option press the Advanced button and add the folder to the Technologies path This deployment method enables you to quickly and easily deploy a technology to all Enterprise O 1998 2010 Sparx Systems Pty Ltd 60 MDG Technologies in SDK Deploy An MDG Technology Architect users on a LAN Upload it to an internet or intranet location use the Enterprise Architect Settings MDG Technologies menu option press the Advanced button and add the URL to the Technologies path This deployment method enables you to quickly and easily deploy a technology to an even wider group of Enterprise Architect users Deploy From an Add in To deploy your technology from an Add In you must write an EA_Onlnitialize Technologies 152 function The following example is written in VB Net Public Function EA_OnlnitializeTechnologies ByVal Repository As EA Repository As Object EA_OnlnitializeTechnologies My Resources MyTechnology End Function Enterprise Architect Software Developers Kit Shape Scripts 61 3 Shape Scripts Introduction Enterprise Architect Shape Scripts enable you to specify custom shapes via a scripting language These custom shapes are drawn instead of the standard UML notation Each script is associated with a particular stereotype and is drawn for every element of that stereotype The following topics describ
211. export the metafile images e Code Templates select the checkbox to export the code templates if they exist 6 Click on the Save button to save the profile to disk For information on importing and using the profile in UML modeling see the Use Profiles topic in Extending UML With Enterprise Architect 1 2 8 1 Save Profile Options When you save a UML Profile you can save it either from the package or from the diagram depending on whether the Profile is e asingle profile spread over multiple diagrams within the same Profile package find the Profile package in the Project Browser right click on it and select the Save Package as UML Profile context menu option which is typically the case for a stereotypes profile e one of multiple profiles within the same Profile package right click anywhere in the background of the Profile diagram and select the Save as Profile context menu option for example when creating multiple toolbox profiles e a single diagram within the Profile Package choose either the Save Package as UML Profile context menu option or the Save as Profile context menu option The two context menu options produce slightly different results You should take these into consideration especially in the third instance where you could choose either option Save From Diagram Save From Package Notes The profile takes the diagram The profile takes the package Package and diagram names are not necessarily the same although
212. f Value below is set to lt memo gt then Notes should contain the actual Tagged Value content ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 19 PropertyGUID Read Write The tag global ID PropertyID Read only The tag local ID Value String Read Write The value assigned to this tag This field has a 255 character limit If the value is greater than 255 characters long set the value to lt memo gt and insert the body of text in the Notes attribute above When reading existing Tagged Values if Value lt memo gt then the developer should read the actual body of text from the Notes attribute TaggedValue Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current TaggedValue object after modification or appending a new item If false is returned check the GetLastError function for more information Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 243 7 2 5 14 Test public Class A Testis a single Test Case applied to an element Tests are added and accessed through the Element Tests collection Associated table in EAP file t_objecttests Test Attributes amviuto te Notes AcceptanceCriteria Read Write The acceptan
213. field that you can fill in through the Model Search XMLResults At completion of the method this should contain the results for the search The results should be an XML String that conforms to the Search Data Format 1291 Return The method must return a value for the results to be displayed Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Add In Search 129 Advanced Usage In addition to the displayed results two additional hidden fields can be passed into the XML that provide special functionality CLASSTYPE Returning a field of CLASSTYPE containing the Object_Type value from the t_object table displays the appropriate icon in the column you place the field CLASSGUID Returning a field of CLASSGUID containing an ea_guid value enables the Model Search to track the object in the Project Browser and open the Properties window for the element by double clicking in the Model Search 6 3 1 XML Format Search Data The XML below provides the format for the SearchData parameter of the RunModel method See the Repositoryl197 topic for more information lt ReportViewData UID MySearchID gt lt The UID attribute enables XML type searches to persist column information That is if you run the search group by column or adjust column widths then close the window and run the search again the format organization changes are retained To avoid persisting column ar
214. for an element in XML format ElementGUID abstract String Parameters e ElementGUID String the GUID in XML format of the element GetElementMetrics string protected Gets files for an element in XML format ElementGUID abstract String Parameters e ElementGUID String the GUID in XML format 1998 2010 Sparx Systems Pty Ltd 278 Enterprise Architect Object Model Reference metoa tome ns GetElementProblems string protected ElementGUID GetElementProperties string protected ElementGUID GetElementRequirements s protected tring ElementGUID GetElementResources string protected ElementGUID GetElementRisks string protected ElementGUID GetElementScenarios string protected ElementGUID GetElementTests string protected ElementGUID GetLastError protected abstract String GetLink string LinkGUID protected abstract String GUIDtoXML string GUID ImportDirectory string abstract String abstract String abstract String abstract String abstract String abstract String abstract String Gets a list of issues problems associated with an element in XML format Parameters e ElementGUID String the GUID in XML format of the element Gets Tagged values for an element in XML format Parameters e ElementGUID String the GUID in XML format of the element Gets a list of requirements for an element in XML format
215. formation that indicates what is displayed in a diagram and how it is shown Associated table in EAP file t_diagramobjects DiagramObjects Attributes preto me ows a pename Te Ferero orne oaee raarcen maaan Long Read Write Read only attribute Holds the connector identifier for the current model Read Write The left position of the element ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 1951 Right Long Read Write The right position of the element Sequence Long Read Write The sequence position when loading into diagram affects Z order The Z order is one based and the lowest value is in the foreground Style Variant Write only reading this value gives undefined results Style information for this object See Setting the Style 2657 below for more information Read Write The top position of the element DiagramObjects Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 269 metod mos es Update Boolean Update the current DiagramObject object after modification or appending a new item If false is returned check the GetLastError function for more information Setting The Style The Sty
216. fresh Dim idx as integer note the repeated calls to package elements GetAt in general you should make this call once and assign to a local variable in the example below Enterprise Architect loads the element required everytime a call is made rather than loading once and keeping a local reference For idx 0 to package elements count 1 Console WriteLine package elements GetAt idx Name If package elements GetAt idx Name Login to Website and _ package elements GetAt idx Type UseCase Then package elements deleteat idx false End If Next End Sub 7 2 10 5 Add a Connector public Object Add a connector and set values Sub ConnectorTest Dim source as object Dim target as object Dim con as object Dim o as object Dim client as object Dim supplier as object use ElementID s to quickly load an element in this example you must find suitable ID s in your model source m_Repository GetElementByID 129 target m_Repository GetElementByID 169 con source Connectors AddNew test link 2 Association again replace ID with a suitable one from your model con SupplierlD 169 If not con Update Then Console WriteLine con GetLastError End If source Connectors Refresh Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 287 Console WriteLine Connector Created o con Constraints AddNew constraint2 type If not o
217. g TagGUID String Notes String Update Boolean GetLastError Strin g us 0 PreConditions Update Boolean GetLastError String 0 TaggedValues Parameters Collection 0 PreConditions Collection 0 PostConditions Collection 0 MethodGUID String TaggedValues Collection 0 MethodiD long Name String Visibility String ReturnType String ReturnisArray Boolean Stereotype String IsStatic Boolean Concurrency Variant Notes String Behaviour String Abstract Boolean IsSynchronized Boolean IsConst Boolean Style String IsPure Boolean Throws String ClassifierlD String Name String Type Variant Default String ParameterGUID String Position Long Parameters IsConst Boolean StyleEx String Code String IsRoot Boolean IsLeaf Boolean IsQuery Boolean StateFlags String Update Boolean GetLastError String 7 2 6 1 Attribute public Class Style String Kind String ClassifieriD String OperationID Long Notes String StyleEx String Update Boolean GetLastError String TagiD Long AttributelD Long Name String Value String Notes String TagGUID String GetLastError String Update Boolean TaggedValues r he eee ee 4 4 Update Boolean GetLastError
218. g PackageGUID string Filename long ImportDiagrams long StripGUID LayoutDiagram string DiagramGUID long LayoutStyle String Parameters e 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 Imports an individual file or binary module into the model in a package per namespace style import Parameters e 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 Note 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 Imports an XMI file at a point in the tree Parameters e 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
219. g dialog Use is prefix for boolean property Get genOptGenRoleNames Source Code Engineering dialog Autogenerate role names when creating code genOptGenUnspecAssocDir Source Code Engineering dialog Do not generate members where Association direction is unspecified checkbox genOptJavaDefaultAttributeType Java Specifications dialog Default attribute type genOptJavaGetPrefix Java Specifications dialog Get Prefix genOptJavaDefaultSourceDirector Java Specifications dialog Default Source Directory y genOptJavaSetPrefix Java Specifications dialog Set Prefix genOptJavaSourceExtension Java Specifications dialog Source code extension genOptPHPDefaultSourceDirector PHP Specifications dialog Default Source Directory y genOptPHPGetPrefix PHP Specifications dialog Get Prefix genOptPHPSetPrefix PHP Specifications dialog Set Prefix Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 97 genOptPHPSourceExtension PHP Specifications dialog Default file extension genOptPHPVersion PHP Specifications dialog PHP Version Source Code Engineering dialog Remove prefixes when generating Get Set properties importFromAggregation T if the Class has an Aggregation connector to a Class in this file F otherwise importFromAssociation T if the Class has an Association connector to a Class in this file F otherwise importFromAtt T if an attribute of a Class
220. g 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 Guid String the GUID of the package to look for Get a pointer to a package using an absolute reference number local 1D This is usually found using the PackagelD property of an package and stored for later use to open a package without using the collection GetAt function Parameters PackagelD Long the ID of the package to locate Return a pointer to the EA Project interface 271 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 Uses the list type to get a pointer to a Reference List object Parameters Type String specifies the list type to get valid list types are Diagram Element Constraint Requirement Connector Status Cardinality Effort Metric Scenario Status and Test Returns the version of a specified MDG Technology resource Parameters o ID String the specified technology ID Returns the set of elements currently selected in the Project Browser as a collection 1998 2010 Sparx Systems Pty Ltd 206 Enterprise Architect Object Model Reference
221. g to the current element and its parent elements String Read Write The element author see the Repository Authors 197 list for more details BaseClasses Collection 21H Read only List of Base Classes for this element presented as a collection for convenience ClassfierlD Deprecated See ClassifierlD ClassifierlD Read Write ElementID of a Classifier associated with this Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 229 CA A Notes O a element that is the base type Only valid for instance type elements such as Object Sequence Complexity String Read Write A complexity value indicating how difficult the element is Can be used for metric reporting and estimation Valid values are 1 for Easy 2 for Medium 3 for Difficult CompositeDiagram Diagram 264 Read only If the element is Composite returns its associated diagram otherwise returns null Connectors Collectionl214 Read only Returns a collection containing the connectors to other elements Collection Read only Collection of Constraint 227 objects ConstraintsEx Collectionl214 Read only Collection of Constraint objects belonging to the current element and its parent elements Read Write The date the element was created CustomProperties Collection 2i Read only List of advanced properties for an element The collection of advanced properties differs depending on element type for example an
222. geGUID 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 the location of the external EAP file or DBMS to extract the Baseline from DoBaselineMerge String Performs a batch merge based on instructions string PackageGUID string contained in an XML file Mergelnstructions You can Baseline string supply an optional connection string if the Baseline is Mergelnstructions string located in another model ConnectString In the Mergelnstructions file each Mergeltem 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 lt Merge gt lt Mergeltem guid XXXXXX gt lt Mergeltem guid XXXXXX gt lt Merge gt Alternatively you can supply a single Mergeitem with a GUID of RestoreAll In this case Enterprise Architect batch processes ALL differences lt Merge gt O 1998 2010 Sparx Systems Pty Ltd 274 Enterprise Architect Object Model Reference lt Mergeltem guid RestoreAll gt lt Merge gt Parameters e PackageGUID String the GUID in XML format of the package to merge the Baseline into Baseline String the GUID of the Baseline in XML form
223. 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 e Guid String the GUID of the diagram to locate GetDiagramByID long Diagram Gets a pointer to a diagram using an absolute reference DiagramID oan 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 e DiagramID Long the ID of the diagram to locate GetElementByGuid string Element Returns a pointer to an element in the repository using the Guid 228 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 e Guid String the GUID of the element to locate GetElementByID long Element Gets a pointer to an element using an absolute reference ElementID 228 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 1998 2010 Sparx Systems Pty Ltd 204 Enterprise Architect Object Model Reference momoa mie es O ee e ElementiD Long the ID of the element to locate GetElementsByQuery
224. grams and other views normally provided by Enterprise Architect Uses for this facility include e Reports and graphs showing summary data of the model e Alternative views of a diagram e Alternative views of the model e Views of external data related to model data e Documentation tools 6 6 1 Create a Custom View A custom view must be designed as an ActiveX custom control and inserted through the automation interface ActiveX custom controls can be created using most well known programming tools including Microsoft Visual Studio NET See the documentation provided by the relevant vendor on how to create a custom control to 1998 2010 Sparx Systems Pty Ltd 170 Enterprise Architect Add In Model Custom Views produce an OCX file Once the custom control has been created and registered on the target system it can be added through the AddTab method of the Repository 197 object While it is possible to call AddTab from any automation client it is likely that you would call it from an Add In and that Add In is defined in the same OCX that provides the custom view Example C code is shown below public class Addin UserControl1 m_MyControl public void EA_Connect EA Repository Rep public object EA_GetMenultems EA Repository Repository string Location string MenuName if MenuName return amp C Control Demo else String ret amp Create amp Show Button re
225. gt lt function_name gt lt prm_1 gt lt prm_n gt Invokes an Enterprise Architect Add In function which can return a result string lt addin_name gt and lt function_name gt specify the names of the Add In and function to be invoked Parameters to the Add In function can be specified via parameters lt prm_1 gt to lt prm_n gt For example result EXEC_ADD_IN MyAddin ProcessOperation classGUID opGUID Any function that is to be called by the EXEC_ADD_IN macro must have two parameters an EA Repository object and a Variant array that contains any additional parameters from the EXEC_ADD_IN call Return type should be Variant For example Public Function ProcessOperation Repository As EA Repository args As Variant As Variant FIND lt src gt lt subString gt Position of the first instance of lt subString gt in lt src gt 1 if none GET_ALIGNMENT Returns a string where all of the text on the current line of output is converted into spaces and tabs JAVADOC_COMMENT lt wrap_length gt Converts the notes for the element currently in scope to javadoc style comments LEFT lt src gt lt count gt The first lt count gt characters of lt src gt Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 105 LENGTH lt src gt Length of lt src gt MID lt src gt lt count gt MID lt src gt lt start gt lt count gt Su
226. h ends elements at both ends of connectors and connectors including the attribute end lt tagName gt is a string representing the specific tag name Examples opTag attribute Use 2 Conditional Substitution This form of the macro mimics the conditional substitution defined for field substitution macros Structure lt macroName gt lt tagName gt lt test gt lt subTrue gt lt subFalse gt Where e lt macroName gt and lt tagName gt are as defined above e lt text denotes that lt text gt is optional e lt test gt is a string representing a possible value for the macro e lt subTrue gt and lt subFalse gt can be a combination of quoted strings and the keyword value Where the value is used it gets replaced with the macro s value in the output Examples opTag opinline inline opTag opinline inline classTag unsafe true unsafe classTag unsafe true unsafe Tagged Value macros use the same naming convention as field substitution macros 5 1 2 4 Function Macros Function macros are a convenient way of manipulating and formatting various element data Each function macro returns a result string There are two primary ways to use the results of function macros e Direct substitution of the returned string into the output such as TO_LOWER attName e Storing the returned string as part of a variable definition such as name TO_LOWER attName
227. h the same name as the MDG Technology in which it is to be included for example SysML 2 Create a stereotype Class element that is named as the custom diagram for example BlockDefinition 3 Create a Class element and name it as one of the Built In Diagram Types 53 prefixed with Diagram_ for example Diagram_Logical for Class diagrams or Diagram_Use Case for Use Case diagrams 4 Give the Diagram_x Class the metaclass stereotype and draw an extends connector from the stereotype to the metaclass 5 Inthe Notes field give the stereotype Class a brief description of what the diagram is used for This description displays in the bottom right hand corner of the New Diagram dialog 6 Give the Diagram_x Class the following attributes as required e alias string Type where Type appears before the word Diagram on the diagram title bar e diagramID string abc where abc is the diagram type that appears in the diagram frame label see the UML Dictionary e toolbox string ToolboxName where ToolboxName is the name of the toolbox profile for the toolbox that opens automatically each time a diagram is opened e frameString string FrameFormatString where FrameFormatString is a string containing substitution macros for defining the frame title with or without additional delimiters such as m acros that can be used are e DGMSTEREO e DGMID e DGMTYPE e DGMALIAS Enterprise Architect Softwar
228. he Code Templates Editor Select the appropriate language from the Language list Select one of the base templates from the Templates list Click on the Add New Stereotyped Override button The New Template Override dialog displays Select Template Stereotype s Class v Feature Z ox cms Select the required Feature and or Class stereotype and click on the OK button The new stereotyped template override displays in Stereotype Overrides list marked as modified Make the required modifications in the Code Templates Editor Click on the Save button This stores the new stereotyped template in the EAP file Enterprise Architect can now use the stereotyped template when generating code for elements of that stereotype Note that Class and feature stereotypes can be combined to provide a further level of specialization for O 1998 2010 Sparx Systems Pty Ltd 122 Code Template Framework in SDK The Code Template Editor in SDK features For example if properties should be generated differently when the Class has a stereotype MyStereotype then both property and MyStereotype should be specified in the New Template Override dialog 5 2 4 Create Custom Language Template Enterprise Architect can forward generate code for languages that it does not specifically support if the appropriate code generation templates are defined for that language This topic outlines the steps require
229. he Select model s dialog when the name is selected e location Contains the path of the XML file that contains the XMI export of the model template package relative to the location of the MDG Technology file If the XMI file is in the same folder as the technology file then this just contains the file name e default Contains either yes indicating that the model template is checked by default or no indicating that the model template is un checked by default e icon Contains an index to Enterprise Architect s base icons list To show the appropriate view icon use one of the following values 29 Use Case 30 Dynamic 31 Class 32 Component 33 Deployment 34 Simple e filter If you have a large number of model templates you can group them on the Select model s dialog by giving all the model templates in the same group the same filter name The filter name given appears in the Select from list box in the Select model s dialog 2 8 Deploy An MDG Technology An MDG Technology can be deployed in one of two ways as a file or from an Add In Deploy From a File To deploy your technology as a file you have a number of choices e Copy it to a folder named MDGTechnologies which you must create under your Enterprise Architect installation directory by default this is C Program Files Sparx Systems EA When you restart Enterprise Architect your MDG Technology is deployed e Copy it to any folder in your file system including n
230. he contents of a file are changed Enterprise Architect passes FileContents as a non empty string New files created as a result of code generation are also sent through this mechanism enabling Add Ins to add new files to the linked project s file list When new files are created Enterprise Architect passes FileContents as an empty string When a non zero is returned by this function the Add In has successfully written the contents of the file A zero value for the return indicates to Enterprise Architect that the file must be saved Also look at MDG PreGenerate 17 Syntax Function MDG_PostGenerate Repository As EA Repository PackageGuid As String FilePath As String FileContents As String As Long The MDG_PostGenerate function syntax contains the following elements EST IT FileContents A string containing the proposed contents of the file FilePath The path of the file Enterprise Architect intends to overwrite PackageGui String IN The GUID identifying the Enterprise Architect package sub tree d that is controlled by the Add In Repository EA Repository IN An EA Repository object representing the currently open 19 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return value depends on the type of event that this function is responding to see Details above This function is required to handle two separate and distinct cases 6 7 1 9 MDGPosiMerge
231. he contents of the Profile page of the Toolbox display 3 Drag an Enumeration item from the toolbox onto the diagram If the Properties dialog does not display double click on the element on the diagram 4 Inthe Name field type the name of the new Enumeration 5 Click on the Details tab and click on the Attributes button The Attributes Properties dialog displays Enterprise Architect Software Developers Kit Developing Profiles Create Profiles 15 General Detail Constraints Tagged Values Green e e enum Initial In the Name field type the name of the Enumeration attribute In the Type field click on the drop down arrow and select the appropriate type In the Initial field type the initial value of the attribute Click on the Save button and repeat steps 6 to 9 for additional attributes When you are finished click on the Close button IS O RASO a O Right click on the Stereotype element and select the Attributes context menu option The Attribute Properties dialog displays for the stereotype 12 In the Name field type a name for the attribute 13 In the Type field type the name of the Enumeration element 14 In the Initial field type the name of the first enumeration attribute you defined 15 Click on the Save and Close buttons You have now generated a drop down list for setting the value of the tag
232. he development of your client software your program might terminate unexpectedly and leave EA exe running in such a state that it is unable to support further interface calls If your program terminates abnormally ensure that Enterprise Architect is not left running in the background see the Windows Task Manager Process tab e A handle to a currently running instance of Enterprise Architect can be obtained through the use of a GetObject call For more information refer to the reference page for the Appl190 object Accessing your Enterprise Architect model via the App object enables querying the current User Interface status such as using GetContextltem on the Repository 171 object to detect the current selection by the user allowing for rapid prototyping and testing Enterprise Architect Not Closing If your automation controller was written using the NET framework Enterprise Architect does not close even after you release all your references to it To force the release of the COM pointers call the memory management functions as shown below GC Collect GC WaitForPendingFinalizers There are additional concerns when controlling a running instance of Enterprise Architect that loads Add Ins see the Tricks and Traps 1261 topic for details 7 1 2 1 Call from Enterprise Architect Enterprise Architect can be set up to call an external application You can pass parameters on the current position selected in the Project Browser to
233. he file to save the diagram into Type Long the file type e lf type 0 then it is a metafile e If type 1 then it uses the file type from the name extension that is omp jpg gif png tga Reloads the current project This is a convenient method to refresh the current loaded project in case of outside changes to the EAP file Runs a named RTF report Parameters e PackageGUID String the GUID in XML format of the package to run the report on TemplateName String the RTF report template to use If the PackageGUID has a stereotype of MasterDocument the template is not required FileName String the file name to store the generated report in Runs an HTML report same as Documentation HTML Documentation when you right click on a package in the Project Browser Parameters PackageGUID String the GUID in XML format of the package to run the report on ExportPath String the file name to store the generated report in ImageFormat String Style String Extension String 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 Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 283 SaveDiagramimageToFile s tring Filename protected abstract String protected abstract Void ShowWindo
234. iD Long Name String Type String Notes String Update Boolean GetLastError String Connectors 0 ana TaggedValues 0 End String Cardinality String Visibility String Role String RoleType String Constraints Collection 0 TaggedValues Collection 0 ConnectoriD Long ConnectorGUID String DiagramiD Long BaseClass String ClientEnd ConnectorEnd SupplierEnd RoleNote String ElementGUID String Name String PropertyGUID String Direction String Aggregation String Tag String Notes String Ordering Long 1 is Value String Qualifier String Constraint String IsNavigable Boolean IsChangeable String Type String subtype String ClientID Long SupplierlD Long SequenceNo Long Virtualinheritance String 1 GetLastError String IsRoot Boolean Update Boolean IsLeaf Boolean IsSpec Boolean RouteStyle Long EventFlags String StyleEx String GetLastError String Update Boolean Containment String 2 q Update Boolean GetLastError String TagiD Long ConnectoriD Long Name String Value String Notes String TaggedValues TagGUID String Update Boolean GetLastError String 7 2 7 1 ConnectorConstraint public Class A ConnectorConstraint holds information about special conditions that apply to a connector It is accessed
235. ialog Scenario tab Scenario testClass The Testing window tab the type of test defined Unit Integration System Acceptance Scenario Field substitution macros can be used in one of two ways Use 1 Direct Substitution This form directly substitutes the corresponding value of the element in scope into the output Structure lt macroName gt 1998 2010 Sparx Systems Pty Ltd 102 Code Template Framework in SDK Code Template Syntax Where lt macroName gt can be any of the macros listed above Examples e className e opName e attName Use 2 Conditional Substitution 5 1 2 3 This form of the macro enables alternative substitutions to be made depending on the macro s value Structure lt macroName gt lt test gt lt subTrue gt lt subFalse gt Where e lt text gt denotes that lt text gt is optional e lt test gt is a string representing a possible value for the macro e lt subTrue gt and lt subFalse gt can be a combination of quoted strings and the keyword value where the value is used it is replaced with the macro s value in the output Examples e classAbstract T pure e opStereotype operator operator e paramDefault value The above three examples output nothing if the condition fails In this case the false condition can be omitted resulting in the following usage Examples e classAbstra
236. ilable using the automation model The properties are purposely undocumented because of their obscure nature and because they are subject to change as progressive enhancements are made to them RouteStyle Read Write The route style Read Write The SequenceNo of the connector Long Read Write The x coordinate of the connector s start point Note Connector end points are specified in Cartesian coordinates with the origin to the top left of the screen StartPointY Long Read Write The y coordinate of the connector s start point Note Connector end points are specified in Cartesian coordinates with the origin to the top left of the screen StateFlags String Read Write Structure to hold a variety of flags concerned with State signaling on messages the list delimited by semi colons Stereotype Read Write Sets or gets the stereotype for this connector end StereotypeEx String Read Write All the applied stereotypes of the connector in a comma separated list StyleEx Read Write Advanced style settings Reserved for the use of Sparx Systems Subtype Read Write A possible subtype to refine the meaning of the connector SupplierEnd ConnectorEn Read only A pointer to the ConnectorEnd object representing the target d 260 end of the relationship SupplierlD Long Read Write ElementiD of the element at the target end of this connector TaggedValues Collection Read only Collection of ConnectorTag objects TransitionActio String Read W
237. ile Enterprise Architect Software Developers Kit Enterprise Architect Object Model 181 7 Enterprise Architect Object Model OLE E Automation pS a Introduction Automation provides a way for other applications to access the information in an Enterprise Architect model using Windows OLE Automation ActiveX Typically this involves scripting clients such as MS Word or Visual Basic or using scripts created within Enterprise Architect using the Scripter window see Using Enterprise Architect UML Modeling Too The Automation Interface provides a way of accessing the internals of Enterprise Architect models Examples of things you can do using the Automation Interface include e Perform repetitive tasks such as update the version number for all elements in a model e Generate code from a State Machine diagram e Produce custom reports e Perform ad hoc queries Connecting to the Automation Interface All development environments capable of generating ActiveX Com clients should be able to connect to the Enterprise Architect Automation Interface This guide provides detailed instructions on connecting to the interface 18H using Microsoft Visual Basic 6 0 Borland Delphi 7 0 Microsoft C and Java There are also more detailed steps on how to set up Visual Basic 183 the principles are applicable to other languages Examples and Tips Instruction on how to use the Automation Interface is provided by mea
238. ile menu option The MDG Technology Creation Wizard screen displays Enterprise Architect Software Developers Kit MDG Technologies in SDK Create MDG Technologies 31 Create new MDG Technology file The Model Driven Generator MDG Technologies allow for a logical collection of resources pertaining to a specific technology to be bundled into one centralized location in Enterprise Architect With MDG Technologies the user has the option of granular importation of UML Profiles UML Pattems Code templates and Language types to be contained in a single easy to access area contained in the Enterprise Architect Resources Window This wizard will guide you through the process of creating an MDG Technology file 2 Click on the Next button to proceed The MDG Technology Wizard prompts you to e Create an MDG Technology File by creating a new MDG Technology Selection MTS file e Create an MDG Technology File using an existing MTS file e Not use any MTS file MDG Technology Wizard Use an MTS file Specify the name and path of the MDG Technology Selections MTS file to use You can open an existing MTS file and modify your previous customizations or you can choose to create a new MTS file You can also choose not to use an MTS file at all for the creation of this Dont use an MTS file for this technology Create a new MTS file O Open an existing MTS file Name and path of MTS to open Browse
239. in the Tagged Values window 1 2 6 Add Shape Scripts To add a Shape Script 6 to a stereotype in a UML Profile follow the steps below 1 On the Profile Package child diagram select a Stereotype element 2 Right click on the element and select the Attributes context menu option 3 Inthe Attributes Properties dialog in the Name field type _image 1998 2010 Sparx Systems Pty Ltd 16 Developing Profiles Create Profiles E Derived F Static LJ Property E Const s ooo putos 9 EE New copy Seve Delete Name Type Initial Value 24 image int 4 Click on the button next to the Initial field The Shape Editor 64 dialog displays 5 Enter the Shape Script in the Shape Editor dialog and click on the OK and Close buttons The Stereotype element now resembles the example below metaciass Class extends ar _image int lt Image type EA 2Q gt Enterprise Architect Software Developers Kit Developing Profiles Create Profiles 17 Note If you are creating a Shape Script for an Association Class see The UML Dictionary be aware that the Shape Script is applied to both the Class part and the Association part Therefore you might have to include logic in the shape main that tests the type of the element so that you can give separate drawing instructions for Class and for Association Such logic is not necessa
240. ing or altering the meaning display appearance and syntax of a model element Different model elements have different stereotypes associated with them For more information on the use of Profiles in Enterprise Architect see the UML Profiles topic in Extending UML With Enterprise Architect For information on developing your own Profiles see the following topics e Custom Stereotypes 341 e Create Profiles 54 e Quick Linker 257 e Toolbox Profiles 477 e Diagram Profiles 5 e Task Pane Profiles 54 gt 1 1 Custom Stereotypes UML supports a large number of stereotypes which are an inbuilt mechanism for logically extending or altering the meaning physical appearance and syntax of a model element Different model elements have different stereotypes associated with them For more information on the use of stereotypes in Enterprise Architect see the UML Stereotypes topic in Extending UML With Enterprise Architect In Enterprise Architect you can create new stereotypes with their own custom appearance The stereotypes can be altered to make use of metafiles image files and customized colors or you can make use of the Enterprise Architect Shape Script to make new element shapes to determine the shape and dimensions of the element To add your own custom stereotypes follow the steps below 1 From the main menu select Settings UML The UML Types dialog displays defaulted to the Stereotypes tab O 1998 2010 Sparx Syste
241. inked to the toolbox profile To create a toolbox profile follow the steps below 1 Create a diagram in a profile package Give it a name by which you can refer to it later such as MyClassDiagram In the Notes field for the diagram give it an alias and a description in the following format Alias MyClass Notes Structural elements for class diagrams 2 On the diagram create a Class name it ToolboxPage and give it the metaclass stereotype 3 Create a stereotype element for each of the toolbox pages to create within your toolbox such as MyClassElements and MyClassRelationships Set their Alias to the text to display in the title bar of each toolbox page such as My Class Elements and My Class Relationships respectively Use the Notes field to define the tool tip for each toolbox page that is Elements for Class Diagrams and Relationships for Class Diagrams Use the extends connector to set the stereotype elements to extend ToolboxPage See also Toolbox Page Attributes 487 4 Inthe stereotype elements create an attribute for each toolbox item The name of the attribute should be the name of the element or connector to be dropped including namespace for example UML Package UML Class and UML Interface The toolbox items display in the same order as the attributes in the Class so make use of the attribute ordering buttons to define the order of your toolbox 1998 2010 Sparx Systems Pty Ltd 48 MDG
242. ion and the Initial value do not set the other values 4 Click on the Save button and Close button 1 2 3 3 Use the Tagged Value Connector In a Profile you can use the Tagged Value connector to define a Tagged Value that has as its value the name of an element containing the stereotype pointed to You select the Tagged Value connector from the Profile pages of the Enterprise Architect UML Toolbox The following diagram demonstrates how you might use the connector It shows a saved and imported profile that defines two stereotypes Collection and Node The Collection stereotype has a Tagged Value connector with the target role named rootNode pointing to the Node stereotype 1998 2010 Sparx Systems Pty Ltd 12 Developing Profiles Create Profiles ametaclass Class extends extends Collection 14 rootNode taggedValue In the Tagged Values window for the connector against rootNode you click on the selection button This displays the Select lt ltem gt dialog through which you locate the elements in the current model with the Node stereotype You can then select one of these elements as the value of the tag See the Work with Elements section in UML Modeling With Enterprise Architect UML Modeling Tool 1 2 4 Define Stereotype Constraints Defining constraints for stereotypes uses the same procedure as defining constraints for any Class To define
243. ion Attributes Detail dialog Attribute is a Collection checkbox attOrderedMultiplicity Attributes Detail dialog Ordered Multiplicity checkbox attProperty Attributes dialog Property checkbox attQualType The attribute type qualified by the namespace path if generating namespaces and the classifier path dot delimited If the attribute classifier has not been set is equivalent to the attType macro attScope Attributes dialog Scope attStatic Attributes dialog Static checkbox attlnitial Attributes dialog Initial Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 91 classBaseName Type Hierarchy dialog Class Name for use where no connector exists between child and base Classes classBaseScope The scope of the inheritance as reverse engineered For use where no connector exists between child and base Classes classBaseVirtual The virtual property of the inheritance as reverse engineered For use where no connector exists between child and base Classes classComplexity Class dialog Complexity classCreated The date and time the Class was created classGUID The unique GUID for the current Class classHasConstructor Looks at the list of methods in the current object and depending on the conventions of the current language returns T if one is a default constructor Typically used with the genOptGenConstructor 9 macro classHasCopyConstructor L
244. ions cero AN a a a ean 18 Supported ADU ES raaa aaraa AEE a RE Sae raa Ea ARAE non nnnnnnnnnnnnnonnnna non nnnn nena nona non aa E EAR 19 Define a Stereotype as a Metatype 21 Define Multiple Stereotype LOVE ee ee eecesecceseeeeeeeeeseeeeesseceaeceeeaeeaesseesaeesaecseesaeseaesaeeeaeseeeteeeeaees 21 Define Creation of Instance eee ceceesesseseceeeeceseeeeeesceeaeeseecseceaecseeeaeeeaeseesaeeaecseseaeeeeesaeesaeseneseeeaees 22 Create Composite Elements eiiioanisia ri ia 23 Define Child Diagram Typ8S oooconccccccnoconcconccnononnnonnnnn conc conc no nono cnn cnn nr cnn n nen nn cnn ren nnn nan crnn crec 23 Stereotype Profiles we 24 QUICK ds 25 Quick Linker Definition ForMat ocooconnccccnnonacinonanccananancnnnnna non nonncn cnn n nn rca nor nc ran n cnn ran nn nn nan rra nan rca nannnccnnnns 25 Quick Linker Example cita 27 Hide Default Quick Linker SettingS cccccnccnconnonconconconconcancnncnnonncnncnncnncnnnnonnnnnnnnnnnnnnnnnnnnnnnnnnennnnnnnnnnnnno 28 Quick Linker Object NAMCSis sic 5 c 5 eecksenesdeneacdeacacchaccdesazecetadedertdenbedehangduteosececadsaqeadsadsodnnaasdeiaedecierdevtes 29 MDG Technologies in SDK Create MDG Technologies Adda Profle iee Becawe ten sents G a che cpetbeds none a a e aE ae Adda PAN iii E id E atea Add a Diagram Profile oooocccocncnocononnnonanononncononononnonnnnnnnnnnnnnnnonnnnnnnnnn cnn nn aaea ede aeia Adda Toolbox Profile 200 A AAA AAA AAA Add
245. ise Architect user interface Add Ins are ActiveX COM objects that expose public Dispatch methods They have several advantages over stand alone automation clients e Add Ins can define Enterprise Architect menus and sub menus e Add Ins receive notifications about various Enterprise Architect user interface events including menu clicks and file changes e Add Ins can and should be written as in process DLL components This provides lower call overhead and better integration into the Enterprise Architect environment e Because a current version of Enterprise Architect is already running there is no requirement to start a second copy of Enterprise Architect via the automation interface e Because the Add In receives object handles associated with the currently running copy of Enterprise Architect more information is available about the current user s activity for example which diagram objects are selected e You are not required to do anything other than to install the Add In to make it usable that is you do not have to configure Add Ins to run on your systems Because Enterprise Architect is constantly evolving in response to customer requests the Add In interface is flexible e The Add In interface does not have its own version rather it is identified by the version of Enterprise Architect it first appeared in for example the current version of the Enterprise Architect Add In interface is version 2 1 e When creating your Add In
246. ith this element for code 1998 2010 Sparx Systems Pty Ltd 230 Enterprise Architect Object Model Reference jatribute type notes generation and synchronization purposes Can include macro expansion tags for local conversion to full path String Read Write Links to other Classes discovered at code reversing time Parents and Implements connectors only GenType String Read Write The code generation type for example Java C C VBNet Visual Basic Delphi Header1 Variant Read Write A user defined string for inclusion as header in the source files generated Read Write Same as for Header1 but used in the CPP source file Boolean Read Write Boolean value indicating whether the element is active or not 1 True 0 False IsLeaf Boolean Read Write Boolean value indicating whether the element is in leaf node or not 1 True 0 False Boolean Read Write Boolean value indicating whether the element is new or not 1 True 0 False Boolean Read Write Boolean value indicating whether the element is a specification or not 1 True 0 False Collectionl219 Read only Collection of Issue objects Locked Boolean Read Write Indicates if the element has been locked against further change MetaType String Read only The element s domain specific meta type as defined by an applied stereotype from an MDG Technology Collection 21H Read only Collection of Method obje
247. itializeDFSIn Crossing Reduction Option IsCrossReduceAggressive Layout Options Direction IsLayoutDirectionUp IsLayoutDirectionDown IsLayoutDirectionLeft IsLayoutDirectionRight 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 shall use Default value 20 ColumnSpacing Long the per element column spacing the Layout process shall 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 LoadControlledPackage Loads a package that has been marked and string PackageGUID configured as controlled The filename details are stored in the package control data Parameters e PackageGUID String the GUID in XML format of the package to load Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 281 LoadDiagram string protected Loads a diagram by its GUID DiagramGUID o Parameter e DiagramGUID String the GUID in XML format of the diagram to load if you retrieve the GUID using the Diagram interface use the GUIDioXML 278 function to convert it to XM
248. ject An example of how to open an Enterprise Architect repository in VB Net Public Class AutomationExample class level variable for Repository Public m_Repository As Object Public Sub Run try create the repository object m_Repository CreateObject EA Repository open an EAP file m_Repository OpenFile F Test EAAuto EAP use the Repository in any way required DumpModel close the repository and tidy up m_Repository Exit m_Repository Nothing catch e as exception Console WriteLine e End try End Sub end Class 7 2 10 2 Iterate Through a EAP File public Object Assume repository has already been opened Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 285 Start at the model level Sub DumpModel Dim idx as Integer For idx 0 to m_Repository Models Count 1 DumpPackage m_Repository Models GetAt idx Next End Sub output package name then element contents then process child packages Sub DumpPackage Indent as String Package as Object Dim idx as Integer Console WriteLine Indent Package Name DumpElements Indent Package For idx 0 to Package Packages Count 1 DumpPackage Indent Package Packages GetAt idx Next End Sub dump element name Sub DumpElements Indent as String Package as Object Dim idx as Integer For idx 0 to Package Elements Count 1 Console WriteLine Indent Package Elements GetAt
249. k pair with timing constraints and percent complete indicators Use this to manage the work associated with delivering an Element Associated table in EAP file _objectresources Resource Attributes amvibuto tye motes O pa Read Write Time already expended on the task in hours days or other units DateEnd Read Write Expected end date DateStart Read Write Date to start work or other units ame E CE CON CN CET 1937 interface CODI fome CENAS Resource Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Resource object after modification or appending a new item If false is returned check the GetLastError function for more information Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 239 7 2 5 9 Risk public Class A Risk object represents a named risk associated with an element and is used for project management purposes Accessed through the Element Risks collection Associated table in EAP file t_objectrisks Risk Attributes janwbute type Notes O O Name Sing Readrwrite The risk Notes string Read Write Further notes describing the risk ObjectType Oki jectType Read only Distinguishes objects referenced through a Dispatch interface
250. kage aaa ProjectSSUES in ia dada PrOJOCROSQUICS soria AAA IA Property TYPE ii AAA an igen aaa Referente iii A ao Stereotype sara i a yeh aaa AEA ie ail E N a nin a RAS Tasko iia AAA AAA da IA da Kerm O NN NN Element iaa Costa ad dd ie sein A A e Effort Element File Issue Maintenance Metric atrio lapa ad Requirement ROSSO iii a e aeaa re e ana aredi aare aaa ae a aE E a AOIN Risk IA E E EEE ARS E ela uate A NN A AN COMO iii AA TAI VAS tii is e a ieee Sisk AAS TESEI Add atada Eamon Foarside olla aso canica ceiba opel Attribute A A ode AttributeConStra diia AA Aida Attribute TA iarsoin AAA AA AAA Custom Properties iii A O taa EmbeddedElements Method ici end iit ali aon dain teenies Manas Method Constraint wsere cteviebcanrcetttinccnesnecsns na devotes AA o nd Method TAG e223 nna a a a Wa eee ae atan N ead AA AS Daroca ai cada Parita in id E E AA E E A NANO TERMOS A A A EIA CONNOR A A E E A ENE ConnectorGonstraN eae esee ii AAA 256 CONE Aa a a Monia 257 ConnectorEnd ips A a AA aE a a a ie eS 260 Connector Tagesson aa s 262 RoleTag Diari aii Diagram DiagramLinKS umi a 267 DidQramObjects Annari aa aa ida HA AY 268 SwimlaneDef Swimlanesx cisne AAA a Aaa 270 SIM Mi ide 271 O 1998 2010 Sparx Systems Pty Ltd Vi Contents A O EA 271 Project _ Code Samples Open the Repository c cuicos ates appara Aa 284 literate Through a EAP File vc di 284 Add and Ma
251. l Issue Indicates a problem or risk associated with the system as a whole Accessed using the 1998 2010 Sparx Systems Pty Ltd 220 Enterprise Architect Object Model Reference Repository Issues collection Associated table in EAP file t_issues Projectlssues Attributes Attribute Type motes Cd ne owe reso eres o CO CA TN meo E TT CON CN RV ObjectType Oki jectType Read only Distinguishes objects referenced through a Dispatch interface 19 COIN CT pasa Owes CEN CT EN Projectlssues Methods emoa yoo o AAA GetLastError String Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Issue object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 4 11 ProjectResource public Class A Project Resource is a named person who is available to work on the current project in any capacity Accessed using the Repository Resources collection Associated table in EAP file t_ resources Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 221 ProjectResource Attributes mew e CN em fom eo pose eran peeo pe fom peme O y EOS pes fom CECI ObjectType ObjectTypel193 Read only Distinguishes objects
252. le 0 60 90 90 R G B x1 y1 x2 y2 R G B x1 y1 x2 y2 R G B x1 y1 x2 y2 Preview of main men Select the Shape Script version Import Import a Shape Script from a text file Export Export a Shape Script to a text file Next Shape Rotate though the multiple shape definitions Refresh Parse your script and display the result in the Preview window 3 3 Write Scripts This topic is a detailed reference for writing Exit from the Shape Editor don t forget to save your script from the Stereotypes tab See Getting Started 6 Shape Scripts 61 For an introduction to writing Shape Scripts see the Getting Starteal 6 and Example Scripts 77 topics See the following reference topics for more detailed information on shape scripting e Syntax grammar 65 e Shape attributes 6 e Drawing methods es e Color queries 724 e Conditional branching 724 e Query methods 721 e Display Item properties 72 e Sub shapes 757 e Reserved names 787 Miscellaneous 76 3 3 1 Syntax Grammar Grammar symbols e zero or more e one or more 1998 2010 Sparx Systems Pty Ltd 66 Shape Scripts Write Scripts or e terminator lt ShapeDeclaration gt lt ShapeBody gt lt ShapeType gt lt ShapeName gt shape decoration lt ReservedShapeNames lt stringliteral gt See Reserved Names 7s for fulled reserved shape listing
253. le attribute is used for setting the appearance of a DiagramObject lt is set with a string value in the format BCol n BFol n LCol n LWth n where e BCol Background Color e BFol Font Color e LCol Line Color e LWth Line Width The color value is a decimal representation of the hex RGB value where Red FF Green FF00 and Blue FF000O0 For example DiagObj Style BCol 35723 BFol 9342520 LCol 9342520 LWth 1 The following code snippet shows how you might change the style settings for all of the objects in the current diagram in this case changing everything to red For Each aDiagObj In aDiag DiagramObjects aDiagObj Style BCol 255 BFol 9342520 LCol 9342520 LWth 1 aDiagObj Update aRepos ReloadDiagram aDiagObj DiagramID Next 7 2 8 4 SwimlaneDef A SwimlaneDef object makes available attributes relating to a single row or column in a list of swimlanes Attribute Type Notes LineWidth Long Read Write Width of line in pixels used to draw swimlanes Valid values 1 2 or 3 Locked Boolean Read Write If set to true disables user modification of the swimlanes via the diagram ObjectType ro jectType Read only Distinguishes objects referenced through a Dispatch interface 19 Read Write Indication of whether the swimlanes are vertical or horizontal ShowlnTitleBar Read Write Enables vertical swimlane titles to be shown in title bar 1998 2010 Sparx Systems Pty Ltd 270 Enterprise Architec
254. lection of elements that belong to this Tah package Read Write Extended information about the package IsControlled Boolean Read Write Indicates if the package has been marked as Controlled IsModel Boolean Read only Indicates if the package is a model or a package IsNamespace Boolean Read Write True is package is a Namespace root Use 0 and 1 to set False and True IsProtected Boolean Read Write Indicates if the package has been marked as Protected IsVersionControlled Boolean Read Indicates whether or not this package is under version control LastLoadDate Read Write The date XML was last loaded for the package COSO CO CTI CIS CIN CCT ObjectType ObjectType Read only Distinguishes objects referenced through a 195 Dispatch interface String Read Write The package owner when using controlled packages PackageGUID Read only The global Package ID Valid across models PackagelD Long Read only The local Package ID number Valid only in this model file Packages Collection Read only A collection of contained packages that can be 21h walked through ParentID Long Read Write The ID of the package that is the parent of this one 0 indicates this package is a model that is it has no parent TreePos Long Read Write The relative position in the tree compared to other packages use to sort packages UMLVersion Read Write The UML version for XMI export purposes UseDTD Read Write Indicates if a DTD is
255. lement Package 240 ScenarioStep Automation Interface Element Package 241 ScenarioStepType Enum Automation Interface 195 ScenarioTestType Enum Automation Interface 195 Script Add To MDG Technology 43 SDK Enterprise Architect 2 Search Add In 128 Search Data Parameter Add In Search 129 Shape lt LabellD gt 76 Attributes 66 Decoration 76 Editor 64 Label 76 Main 76 Source 76 Target 76 Shape Attributes Shape Scripts 66 Shape Editor 64 Shape Scripts Add To Profile 15 Arithmetical Operations 76 Assign To Stereotype 61 Basic Shapes 77 Change Font Of Text 76 Cloud Path 77 1998 2010 Sparx Systems Pty Ltd 308 Index Shape Scripts Set Default Appearance Of Objects In Profile Color Queries 72 17 Comments 76 Tagged Values In Profile 8 Conditional Branching 72 Tags For Supported Attributes 10 Connector 77 Tags Define 8 Create 61 Structured Tagged Value Type 81 Custom Shapes 61 Structured Tagged Values Display Element Properties 72 Create 83 Double Line 77 StyleEx Drawing Methods 68 Diagram Profile Attribute Values 53 Editable Field 77 Submenu Example Shape Scripts 77 Hidden Create In Toolbox Profile 48 Filled Arrow 77 Subshape Fonts 76 Example 75 Getting Started 61 In Shape Scripts 75 Introduction 61 Substitution Looping 76 Conditional 90 Miscellaneous 76 Direct 90 Multiple Condition 77 Macro 72 Override Element Appearance 61 Supported Attribute Properties Connector 72 Create Composite Elements 23
256. lement corresponds to a UML stereotype which is an extension mechanism for varying the behavior and type of a model element Use the Repository Stereotypes collection to add new elements and delete existing ones Associated table in EAP file t_stereotypes Stereotype Attributes atributo tye motes C CisdC AppliesTo String Read Write A reference to the stereotype Base Class that is which element it applies to MetafileLoadPat Read Write Path to an associated metafile The automation interface h does not yet support loading metafiles To do this you must use the Stereotype tab of the UML Types dialog in Enterprise Architect Notes Sting Read Write Notes about the stereotype String Read Write The stereotype name Appears in the Stereotype drop list for elements that match the AppliesTo attribute ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch StereotypeGUID String Read Write Unique identifier for stereotype generally set and maintained by Enterprise Architect Style Read Write Additional style specifier for stereotype VisualType String Read Write Indicates an inbuilt visual style associated with a stereotype Not currently implemented Stereotype Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Upd
257. lier D DiagramID A long value corresponding to Connector Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 143 CTN CT CN pp armo data and user interface status information Repository EA Repositor An EA Repository object representing the currently open 19 Enterprise Architect model Poll its members to retrieve model Return Value Return True to enable addition of the new connector to the model Return False to disable addition of the new connector 6 5 7 3 EA_OnPreNewDiagram Details EA_OnPreNewDiagram notifies Add Ins that a new diagram is about to be created lt enables Add Ins to permit or deny creation of the new diagram The notification is provided immediately before the diagram is created so that the Add In can disable addition of the diagram Also look at EA_OnPostNewDiagram 48 Syntax Function EA_OnPreNewDiagram Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreNewDiagram function syntax contains the following elements CCC CO Contains the following EventProperty Objects for the diagram A to be created 21 E Type A string value corresponding to Diagram Type ParentID A long value corresponding to Diagram ParentID PackagelD A long value corresponding to Diagram PackagelD An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model
258. lists the EASL collections for each of the EASL objects as retrieved by the EASL _GET 109 code generation macro Action SubActions The sub actions of the Action Behavior Classifier Construct Node IncomingEdges The Node s incoming edges O 1998 2010 Sparx Systems Pty Ltd 112 Code Template Framework in SDK Code Template Syntax OutgoingEdges The Node s outgoing edges SubNodes The sub nodes of the Node State StateMachine AllFinalStates The State Machine s final States States Transition Trigger TriggeredTransitions The triggered transitions associated with the Trigger Vertex DerivedOutgoingTransitions The Vertex s derived outgoing transitions after traversing the pseudo nodes IncomingTransitions The Vertex s incoming transitions OutgoingTransitions The Vertex s outgoing transitions Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 113 5 1 2 6 2 EASL Properties This topic lists the EASL properties for each of the EASL objects as retrieved by the EASL _GET 109 code generation macro Action Argument The ID of the Argument s associated parameter The default value of the argument Behavior CallEvent The operation of the CallEvent O 1998 2010 Sparx Systems Pty Ltd 114 Code Template Framework in SDK Code Template Syntax
259. lization InformationFlow Instantiation InterruptFlow Manifest Nesting NoteLink ObjectFlow Package Realization Sequence StateFlow UseCase 1998 2010 Sparx Systems Pty Ltd 258 Enterprise Architect Object Model Reference Associated table in EAP file t connector Connector Attributes CE Notes O alias string Read Write An optional alias for this connector ClientEnd ConnectorEn Read only A pointer to the ConnectorEnd object representing the source a 260 end of the relationship ClientlD Long Read Write ElementID of the element at the source end of this connector Cc olor Long Read Write Sets the color of the connector ConnectorGUID Variant Read only A globally unique ID for the current connector System generated ConnectorlD Long Read only Local identifier for the current connector System generated Constraints Collection Read only Collection of constraint 2271 objects CustomProperti Collection 211 Read only Returns a collection of advanced properties associated with es an element in the form of CustomProperty 2461 objects DiagramiD Long Read Write The DiagramID of the connector String Read Write Connector direction Can be set to one of the following Unspecified Bi Directional Source gt Destination Destination gt Source Long Read Write The x coordinate of the connector s end point Note Connector end points are specified in Cartesian coordinates
260. lue t Name Next If element Attributes GetAt idx Name m_Tootle Then Console WriteLine delete attribute element Attributes DeleteAt idx false End If Next catch e as exception Console WriteLine element Attributes GetLastError Console WriteLine e End try End Sub 7 2 10 12 Work With Methods public Object An example of working with the Methods collection of an element and with Method collections Sub MethooLifeCycle Dim element as object Dim method as object Dim t as object Dim idx as Integer Dim idx2 as integer try element m_Repository GetElementByIlD 129 For idx 0 to element Methods Count 1 method element Methods GetAt idx Console WriteLine method Name t method PreConditions AddNew TestConstraint something If t Update false Then Console WriteLine PreConditions t GetLastError End if method PreConditions Refresh 1998 2010 Sparx Systems Pty Ltd 294 Enterprise Architect Object Model Reference For idx2 0 to method PreConditions Count 1 t method PreConditions GetAt idx2 Console WriteLine PreConditions t Name If t Name TestConstraint Then method PreConditions DeleteAt idx2 false End If Next t method PostConditions AddNew TestConstraint something If t Update false Then COnsole WriteLine PostConditions t GetLastError End if method PostConditions Refresh For idx2 0 to method PostConditi
261. ly Returns a unique ID for the project PropertyTypes Collection 21h Read only Collection of Property Types 22h available to the Repository Resources Collection 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 Collectionl214 Read only The Stereotypes z2 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 147 or EA_OnPostNewConnector 147 broadcast events to control whether Enterprise Architect should suppress showing the default Properties dialogs to the user when an element or connector is created Collection Read only A list of system tasks to do list Each entry is a Task 223 Item you can modify delete and add new tasks Collection Read only The project Glossary Each Terml22 object is an entry in the Glossary Add modify and delete Terms to maintain the Glossary Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 199 Repository Methods ActivateDiagram long Activates an already open diagram that is makes it the DiagramID active tab in the main Enterprise Architect user interface Parameters e DiagramlD Long the ID of the diagram to make active Activ
262. m If false is returned check the GetLastError function for more information 7 2 5 6 Metric public Class A Metric is a named item with a weighting that can be associated with an element for purposes of building metrics about the model Accessed through the Element Metrics collection Associated table in EAP file t_objectmetrics Metric Attributes Atribute Type Noes Name Sting Read Write The name of the metric Notes Sting Read Write Notes about this metric ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch 1937 interface Read Write The metric type Weight Long Read Write A user defined weighting for estimation or metric purposes Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 237 Metric Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Metric object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 5 7 Requirement public Class An Element Requirement object holds information about the responsibilities of an element in the context of the model Accessed using the Element Requirements collection Associated table in EAP file t_objectre
263. m has been closed Also look at EA _OnPostOpenDiagram 137 Syntax Function EA_OnPostCloseDiagram Repository As EA Repository DiagramID As Integer The EA_OnPostCloseDiagram function syntax contains the following elements Peano ype preson pesepien o E DiagramiD for Contains the Diagram ID of the diagram that was closed Repository EA An EA Repository object representing the Enterprise Architect Repositor model about to be closed Poll its members to retrieve model data 7 and user interface status information Return Value None 6 5 5 EA_OnPostOpenDiagram Details EA_OnPostOpenDiagram notifies Add Ins that a diagram has been opened Also look at EA_OnPostCloseDiagram 137 Syntax Function EA_OnPostOpenDiagram Repository As EA Repository DiagramID As Integer The EA_OnPostOpenDiagram function syntax contains the following elements Panos pe oreo estos O i DiagramiD Contains the Diagram ID of the diagram that was opened Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value None O 1998 2010 Sparx Systems Pty Ltd 138 Enterprise Architect Add In Model Broadcast Events 6 5 6 Pre Deletion Events 6 5 6 1 Enterprise Architect Add Ins can respond to requests to delete elements attributes methods connectors diagrams pack
264. mScenari o string ElementGUID EnumScenarioDiagramType DiagramType long OverwriteExistingDiagram GeneratePackage string Package GUID string ExtraOptions GenerateTestFromScenario string ElementGUID EnumScenarioTestType TestType UseDTD Long true if a DTD should be used FileName String the filename to output to Flags ea ExportPackageXMIFlag 193 whether or not to include package content below the first level currently only supported for xmiEA Default Generates the code for a single Class Parameters e ElementGUID String the GUID in XML format of the element to generate e ExtraOptions String enables extra options to be given to the command currently unused Generates various diagrams from the Structured Specification of an element Parameters e ElementGUID String the GUID in XML format of the element containing the Structured Specification DiagramType EnumScenarioDiagramType the type of diagram to generate see ScenarioDiagramType Enum 19 for accepted values OverwriteExistingDiagram Long determines whether to overwrite the existing diagram or synchronize the existing elements with the scenario steps 0 Delete existing diagram and elements and create new diagram and elements 1 Synchronize existing elements with scenario steps and preserve diagram layout 2 Synchronize existing elements with scenario steps and re cast diagram layout 3 Do not generate diagram
265. me f the second parameter propertyvalue is provided the property propertyname must be present and the value of the property has to be equal to propertyvalue string for the method to return true propertyvalue See Display Item Properties 727 for a list of valid values for propertyname 3 3 7 Display Item Properties The commands print printin and printwrapped all take a string parameter representing the text to be printed Element and connector properties can be added to the text using the substitution macro propertyname Enterprise Architect Software Developers Kit Shape Scripts Write Scripts 73 For example printin name 4NAME In addition to the properties listed below Tagged Values can also be displayed by prefixing the Tagged Value name with TAG For example print TAG condition You can also test against and display an element s custom properties in the same way as you do the named properties For example if hasproperty Name Value and print Name Properties Visible to Shape Scripts Properties for Element Shape Scripts addin value returned from an Add In alias author cardinality classifier classifier alias classifier metatype classifier stereotype classifier type complexity concurrency datecreated datemodified diagram mdgtype diagram name diagram stereotype diagram type haslinkeddocument isabstract isactive iscomposite isembedded isinp
266. ments Userlnterface WSDL XMLSchema The following elements all preceded with the namespace UML can be extended or redefined in Enterprise Architect Toolbox pages The text in red indicates the label name displayed in the default Enterprise Architect Toolbox pages where this differs in any way from the UML statement text When these profile elements are incorporated into an MDG Toolbox page they enable synchronization of the Tagged Values and Constraints of all elements created from them see Extending UML With Enterprise Architect You can also extend connectors 51 Action Activity ActivityFinal Final Activitylnitial Initial ActivityParameter e InteractionState State Continuation e Interface e Issue e Junction e Lifeline ActivityPartition Partition ActivityRegion Region Actor Artifact AssociationElement Association Boundary for Use Cases CentralBufferNode Central Buffer Node Change Choice Class e MergeNode Merge MessageEndPoint Endpoint or Message Endpoint MessageLabel Message Label Metaclass Node Object ObjectBoundary Boundary ObjectControl Control ObjectEntity Entity Package Enterprise Architect Software Developers Kit MDG Technologies in SDK Customize Toolbox Profiles 51 e Collaboration e PackagingComponent e CollaborationOccurrence e Part e Comment Note e Port e Component e Primitive e Constraint e Process
267. met default values are used and the DiagramLink is not in use DiagramObjects Collection Read only A collection of references to DiagramObjects 268 A 214 DiagramObject is an instance of an element in a diagram and includes size and display characteristics ExtendedStyle Read Write An extended style attribute Highlightimports Boolean Read Write Flag to indicate elements from other packages should be highlighted IsLocked Read Write Flag indicating whether this diagram is locked or not MDG Technology Nave tne _ Fesoie Tredayanrane iy nots E ET ObjectType ObjectTyp Read only Distinguishes objects referenced through a Dispatch interface e 19 Read Write Page orientation P for Portrait or L for Landscape PackagelD Read Write An ID of the package that this diagram belongs to ParentID Read Write An optional ID of an element that owns this diagram for 1998 2010 Sparx Systems Pty Ltd 266 Enterprise Architect Object Model Reference Atributo Tyee notes Sd Pf example a Sequence diagram owned by a Use Case Scale Long Read Write The zoom scale default is 100 SelectedConnector Connector Read Write The currently selected connector on this diagram Null if 2577 there is no currently selected diagram SelectedObjects Collection Read only Gets a collection representing the currently selected elements on the diagram Can remove objects from this collection to deselect th
268. mple more than one ModelSearch For each inserted line e In the file attribute enter the filename of the Model Search XML file or Model View XML file Save the MTS file Update the MDG Technology Again select the Tools Generate MDG Technology File menu option but this time on the second page select Open an Existing MTS file and specify the file path of the MTS file you have updated Click on lt Next gt until the wizard is finished Your MDG Technology file is updated 2 3 Customize Toolbox Profiles The following is a road map of how to create a set of custom toolboxes for Enterprise Architect 1 Create a set of Toolbox Profiles 474 that contain the definitions that Enterprise Architect requires to create the toolboxes 2 Create a MTS file 30 containing instructions on how to build your MDG Technology Use this MTS file to build your MDG Technology 3 Add some finishing touches e Create hidden sub menus 487 e Override Enterprise Architect s default toolboxes 494 e Change the default icons for toolbox items 497 2 3 1 Create Toolbox Profiles You can create multiple toolbox profiles within an MDG Technology Each toolbox profile contains definitions that determine what appears in the Enterprise Architect UML Toolbox when a specific Toolbox page is open either by selecting from the More tools option in the Enterprise Architect UML Toolbox window or by opening or creating a diagram of the type that is l
269. ms Pty Ltd 4 Developing Profiles Custom Stereotypes Stereotypes Tagged Value Types Cardinalty Values Stereotype Stereotype Applies To Notes amp Group name access dependency Public contents of target are Bose Ch Activator generalization Activator Activator class Notes 4 Activity callbehavior Activity advice operation advice analysis syst model Contains analysis classes e Arow class UML Profile Notes artifact artifact artifact New Save Delete asp page class A Microsoft active server page aspect class aspect Basic Shapes class UML Profile Notes Ovenide Appearance become message Target is same as source but D None bind dependency Source instantiates target te Metafile ih eee Book class Book Shape Script boundary sequence boundary boundary screen boundary boundary object boundary Default Col Pre Fil boundary class Specifies an element that is j za te boundary attribute boundary a business usecase business business collaboration business business actor actor business actor Font af business bo object business boundary Reset business entity usecase business entity business entity object business entity business use usecase business use case a 2 Type or select a Stereotype name 3 Select a Base Class from the drop down list 4 To associate a Metafile with this stereotype click on the Metafile radio button and the Assign button
270. n Select the files to be included as Profiles in this technology Directory Y Dev Builds Addins BPMN BPMN 1 1 Available Files Selected Files BPMN Stereotypes xml Diagram Profile xml ToolboxProfile xml gt gt 2 Inthe Directory field navigate to the directory containing the required Profile or Profiles The Profile files are automatically listed in the Available Files panel 3 To select each required Profile individually highlight the Profile in the Available Files list and click on the gt button The file name displays in the Selected Files list Alternatively to select all available Profiles click on the gt gt button Notes e DO NOT select diagram profiles or toolbox profiles on this dialog this would generate conflicting commands in the MTS file e Make sure you do include your stereotypes profile 24 4 Click on the Next button to proceed 2 1 2 Add a Pattern When creating an MDG Technology file you can include patterns see Extending UML With Enterprise Architect To use the Patterns section of the MDG Technology Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 307 topic up to and including Step 6 33 where you select the Patterns checkbox The MDG Technology Wizard Pattern files selection dialog displays 1998 2010 Sparx Systems Pty Ltd 36 MDG Technologies in SDK Create MDG Technologies MDG Technol
271. n Interface Package Automation Interface e Logical diagram Automation Interface Package Automation Interface Connectors comer fwe fe Nesting Connector Overview source gt target Contained Element Containing Element Nesting Repository Overview source gt target Contained Element Containing Element Nesting Diagram Overview source gt target Contained Element Containing Element Nesting Element Overview source gt target Contained Element Containing Element Nesting Project Interface Overview source gt target Contained Element Containing Element Nesting ElementFeatures Overview source gt target Contained Element Containing Element 7 2 2 App The App object represents a running instance of Enterprise Architect Its object provides access to the Automation Interface Attribute type Notes S Read only Provides a handle to the Project Interface Repository Repository Read only Provides a handle to the Repository object Read Write Whether or not the application is visible GetObject Support The App object is creatable and a handle can be obtained by creating one In addition clients can use the equivalent of Visual Basic s GetObject to obtain a reference to a currently running instance of Enterprise Architect Use this method to more quickly test changes to Add Ins and external clients as the Enterprise Architect application and data files do not have to be constantly re loaded For example Dim
272. n Value None 6 7 1 2 MDGConnect Details MDG_Connect enables the Add In to handle user driven request to connect a model branch to an external application This function is called when the user attempts to connect a particular Enterprise Architect package to an as yet unspecified external project This event enables the Add In 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 SHGetFolderPath CSIDL_APPDATA AddinName The PackageGuid parameter is the same identifier as required for most events relating to the MDG Add In Therefore it is recommended that the connection details be indexed using the PackageGuid value 1998 2010 Sparx Systems Pty Ltd 172 Enterprise Architect Add In Model MDG Add Ins The PackagelD parameter is provided to aid fast retrieval of package details from Enterprise Architect should this be required Also look at MDG Disconnectl172 Syntax Function MDG_Connect Repository As EA Repository PackagelD as Long PackageGuid As String As Long The MD
273. n a comma separated list O 1998 2010 Sparx Systems Pty Ltd 246 Enterprise Architect Object Model Reference Attribute E Notes O Style Read Write Contains the Alias property for this attribute StyleEx Read Write Advanced style settings Reserved for the use of Sparx Systems TaggedValues Collection Read only A collection of AttributeTag objects Use to access and manage 21h of type Tagged Values associated with this attribute AttributeTag 24 TaggedValuesE Collection Read only Collection of TaggedValue objects belonging to the current 2th of type attribute and the TaggedValuesEx property of its classifier Tagged Valu e 24 Read Write The attribute type by name also see ClassifierID UpperBound Read Write A value for the collection upper bound Visibility Read Write The scope of the attribute Can be Private Protected Public or Package Attribute Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Updates the current attribute object after modifying or appending a new item If false is returned check the GetLastError function for more information 7 2 6 2 AttributeConstraint public Class An AttributeConstraintis a constraint associated with the current Attribute Associated table in EAP file t_att
274. n creation and e Appears as Block not Class in many other contexts throughout Enterprise Architect 1 2 9 2 Define Multiple Stereotype Level The _ strictness attribute is applied to a stereotype element It defines to what level multiple stereotypes can be applied to an element The type of the attribute is StereotypeStricinessKind and it can have one of four values e profile which states that an element of this type cannot be given more than one different stereotype from the same profile e technology which states that an element of this type cannot be given more than one different stereotype from the same technology e all which states that an element of this type cannot have multiple stereotypes at all or e none which is the default Enterprise Architect behaviour and states that there are no restrictions on the use of multiple stereotypes The following example is from SysML and shows that a flowPort cannot have any other stereotype applied to it O 1998 2010 Sparx Systems Pty Ltd 22 Developing Profiles Create Profiles ametacisss Port Behavior Boolean false Service Boolean true extends _strctness StereotypeStnctnessKind all 1 2 9 3 Define Creation of Instance The _instanceType attribute is applied to a stereotype element and defines what kind of element is created as an instance of this element type The value corresponds to the metatype given to a stereotype u
275. n the Next button to proceed 2 1 7 Add Code Modules When creating an MDG Technology file you can include code modules To use the code modules section of the MDG Technology Types Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 301 topic up to and including Step 6 33 where you select the Code Modules checkbox The MDG Technology Wizard Code Modules dialog displays Enterprise Architect Software Developers Kit MDG Technologies in SDK Create MDG Technologies 41 2 MDG Technology Wizard Code Modules Select the code modules to be included in this technology Product Data Types Code Templates Visual Basic VBNet PHP Java Delphi C c Click on the checkboxes Product Data Types and Code Templates for each of the required Code Modules Note The code modules listed are those defined in your current project These could be the Enterprise Architect default languages or those you have defined yourself using code templates and the Code Template Editor see Code Engineering Using UML Models Before you can set up a code template for the new language in the editor you must define at least one data type for the language see the Data Types topic in UML Model Management Once the MDG Technology file is created it can be loaded into your current model and into other models To select any code options for a module click on the
276. nage Packages ciciesicccscsuscccteececcvessccueceevsncvocsrvorstussecesccedducevitersvedeiventosconsenenednecatenedees 285 Add and Manage Elements 286 Adda COnne Cll civic ie date Id 286 Add and Manage DiagraMS coconnccnccnnccccccnnnonnonannannnrornnnn conc cnn crecen 287 Add and Delete Features iii id 288 Element Extras aida diia 288 REPOSILOFY EXIT viii A AAA A ennaa dt 290 Stereotypes AA A AAA AR LAI 292 Work With AtiriDUteS cui oca 292 Work WI MENO Saara aaa at aratat aeta dde tidad e 293 Index 295 Enterprise Architect Software Developers Kit Foreword 1 Foreword This user guide describes the facilities of the Software Developers Kit which enables you to customize and extend the facilities of Enterprise Architect O 1998 2010 Sparx Systems Pty Ltd SDK for Enterprise Architect Introduction Welcome to the Enterprise Architect Software Developers Kit SDK This is a special section of the Enterprise Architect User Guide covering the more advanced aspects of extending and customizing Enterprise Architect In describing aspects of extending Enterprise Architect it is expected that you are familiar with the concepts introduced in the main body of the Enterprise Architect User Guide Wherever appropriate cross references to these concepts are provided in the text Contents e UML Profiles 3 incorporating UML Stereotypes 3 e MDG Technologies 307 e Shape Scripts 61 e
277. ncn nro narrar 148 EA OnPostNewAtiribUte cuidate 149 EA lt OnPostNewMethd cios iii 149 EA OnPostNewPackage civccociimcct cra IPR 150 MS AAA OOOO 151 O s sc cs esti cect ati a a E cev nati tine E Seen EEE 151 Technology AE aE TE EAE E A A E E A E S 152 EA OninitializeTECchnoOlOJ SS woxiirmorinainnica ii ide 152 EA_OnPreActivateTechnology occcocoonconcconccocnnanccnnnnnccnononncnn nro cnn nano conc narran A 152 EA OnPostActivate Technology iisen iia cd 153 EA_OnPreDeleteTechnology 153 EA OnDeleteTechnolOgy coccion Da PRA 154 EA Onlmport Technologyn aaa a A ered dlAn ers 155 A 155 EA_OnConttextltemCOnanged ceccssceseecsecsseceseceeeeseeeaeeeeeeaeeaeeseeeaeeseesaeeaecaeecaeseaeseeeeseaeeneeeaeeeas 155 EA_OnContextltemDoubleClicked 156 EA_OnNotifyContextltemModified 157 Compartment EVS Seene ekina e aE ESEE EEEE EENEN aa e EEEE ENERE 158 1998 2010 Sparx Systems Pty Ltd IV Contents EA_QueryAvailableCompartMents oconncciccnnccncnnoconoccnnnnocnnnc con cnn ccoo cnn cnc rre rana rra 158 EA_GetCompartmentData Model Validation BroadCasts scccseccsecsecceecceecseeeucteeceuceeeeeeseeseeeegeseeeeseseuetseseuenaeeeueeeeeeseeeseesegeegeeeeetees EA Oninitialize Ser RUles ccsorari so OA AE Ea daa EA OnStarValidatiON iii zest cate ai e e aseptic ha eaaa aS a au ara ee EA OnEnoValidation iii aan aca EA_OnRunElementRule EA OnRunPackageRule e sccce acai sane paca deiee aden a nien
278. nd Import Reference Data options on the Tools menu See the Reference Data topic in UML Model Management 1 2 Create Profiles This topic describes how to create profiles and profile items These creation tasks include creating the profile stereotypes defining the metaclasses they apply to and defining Tagged Values and constraints This topic also describes how to export a profile for use in UML modeling To create a UML Profile follow the steps below Create a Profile Package 5 Add Stereotypes and Metaclasses 6 Define Tagged Values for Stereotypes 8 Define Constraints for Stereotypes 12 Add Enumerations 14 Add Shape Scripts 15 Set Default Appearancel 17 Export the Profile 17 ON OA PRON 1 2 1 Create a Profile Package In Enterprise Architect you must create a UML Profile in a Package that has the stereotype profile To create a Profile Package follow the steps below 1 Open or create a Package diagram 2 Open the Profile page of the Enterprise Architect UML Toolbox More tools Profile 1998 2010 Sparx Systems Pty Ltd 6 Developing Profiles Create Profiles NO oO PR 9 Profile E Profile lt gt Stereotype O Metaclass Enumeration Profile Relationships A Extension Generalize Fi Application 7 Tagged Value Fi Redefinition Drag the Profile item onto the Class diagram The New Model Package dialog displays In the Package Name field t
279. ne Child Type Supported Attributes Profile Attributes PData and StyleEx Profiles 52 Save Profile Types Built In Types Custom Diagram Package Automation Interface 263 Diagram Automation Interface 264 DiagramLinks Automation Interface DiagramObjects Automation Interface Swimlane Automation Interface 271 SwimlaneDef Automation Interface Diagram Type Add To MDG Technology 36 DiagramLinks Automation Interface Diagram Package DiagramObjects Automation Interface Diagram Package Direct Substitution Field Substitution Macros Code Template Syntax 59 59 264 23 53 18 53 52 267 268 269 270 267 268 90 Disable Add Ins 128 Display Connector Properties Shape Scripts 72 Element Properties Shape Scripts 72 Drawing Methods Shape Scripts 68 EA Connect Add In Event 130 EA Disconnect Add In Event 130 EA FileClose Broadcast Events Add In Model 136 EA FileNew Broadcast Events Add In Model 136 EA FileOpen Broadcast Events Add In Model 135 EA_GetCompartmentData Compartment Events Add In Model 159 Enterprise Architect Software Developers Kit Index EA GetMenultems Add In Event 131 EA GetMenuState Add In Event 131 EA MenuClick Add In Event 132 EA _OnContextltemChanged Context Item Events Add In Model 155 EA OnContextltemDoubleClicked Context Item Events Add In Model 156 EA _OnDeleteTechnology Technology Events Add In Model 154 EA OnEndValidation
280. nector Properties dialog Source Role tab Allow Duplicates checkbox connectorSourceDerivedUnion Connector Properties dialog Source Role tab DerivedUnion checkbox connectorSourceElem A set of macros that access a property of the element at the source end of a connector The asterisk is a wildcard that corresponds to any class substitution macro in this list for example connectorSourceElemAlias classAlias connectorSourceElemAuthor classAuthor connectorSourceElemType The element type of the connector source element Separate from the e cds macros because there is no classType substitution macro connectorSourceMemberType Connector Properties dialog Source Role tab Member Type connectorSourceMultiplicity Connector Properties dialog Source Role tab Multiplicity connectorSourceNavigability Connector Properties dialog Source Role tab Navigability 1998 2010 Sparx Systems Pty Ltd 94 Code Template Framework in SDK Code Template Syntax Class dialog Constraints tab ordering hand up down keys Program Version Located in an Enterprise Architect dialog by selecting Help About EA filelmports Code Gen dialog Imports For supported languages this also includes dependencies derived from associations filePath The full path of the file being generated filePathImpl The full path of the implementation file for this generation if applicable Enterprise Architect Software Develo
281. nector types Attribute Operation and OperationParameter BaseStereotype BaseStereotype S1 S2 Restricts the stereotypes that this tag belongs to where S1 and S2 are the allowed stereotypes 4 2 Create Structured Tagged Values To create your own Tagged Value based on a predefined structured Tagged Value Typel st follow the steps below 1 Select the Settings UML menu option The UML Types dialog displays Select the Tagged Value Types tab Stereotypes Tagged Value Types Cardinality Values Tag Name Handicap Description Spin Control Detail Type Spin a LowerBound 0 UpperBound 250 Cien Sse Eos Defined Tag Types Type Description a Activity a Assignments Assignments Author Retums Authors of the Model Categories Categories Datafield Database field go ki InMessage InputPropertyMaps InputPropertyMaps ORules ORules a y l m aj gt C 2 Click on the New button 3 Inthe Tag Name field type an appropriate Tagged Value name 1998 2010 Sparx Systems Pty Ltd 84 Tagged Value Types Create Structured Tagged Values 4 Inthe Description field type the purpose of the Tagged Value if required 5 In the Detail field copy and paste or type the syntax of the predefined structured Tagged Value Type In the example above which is used in the definition of a field to enable a user to set a sports handicap the predefined
282. ng Readiwite The method name Notes Sting Read Write Descriptive notes about the method ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch Parameters Collectionl21H Read only The Parameters collection for the current method Use to add and access parameter objects for the current method ParentID Long Read only Returns the ElementID of the element that this method belongs to Long Read Write Specifies the position of the method within the set of operations defined for a Class PostConditions Collection 21 Read only PostConditions constraints as they apply to this method Returns a il object of type post PreConditions Collection 21 Read only PreConditions constraints as they apply to this method Returns a MethodConstraint object of type pre ReturnlsArray Read Write Flag to indicate the return value is an array ReturnType String Read Write Return type for the method can be a primitive data type or a Class or Interface type StateFlags Read Write Some flags as applied to methods in State elements Stereotype Read Write The method stereotype optional StereotypeEx String Read Write All the applied stereotypes of the method in a comma separated list Style Read Write Contains the Alias property for this method StyleEx Read Write Advanced style settings Reserved for the use of Sparx Systems TaggedValues Collection 21 Read only TaggedValues collection for
283. ng our new entry in the process For idx 0 to m_Repository Stereotypes Count 1 COnsole Writeline m_Repository Stereotypes GetAt idx Name If m_Repository Stereotypes GetAt idx Name funky then m_Repository Stereotypes DeleteAt idx false Console WriteLine Delete element End if Next End Sub 7 2 10 11 Work With Attributes public Object An example of working with attributes Sub AttributeLifecycle Dim element as object Dim o as object Dim t as object Dim idx as Integer Dim idx2 as integer try element m_Repository GetElementBylD 129 For idx 0 to element Attributes Count 1 Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 293 Console WriteLine attribute element Attributes GetAt idx Name O element Attributes GetAt idx t 0 Constraints AddNew gt 123 Precision t Update o Constraints Refresh For idx2 0 to o Constraints Count 1 t 0 Constraints GetAt idx2 Console WriteLine Constraint t Name If t Name gt 123 Then o Constraints DeleteAt idx2 false End if Next For idx2 0 to 0 TaggedValues Count 1 t 0 TaggedValues GetAt idx2 If t Name Type2 Then Console WriteLine deleteing o TaggedValues DeleteAt idx2 true End if Next t 0 TaggedValues AddNew Type2 Number t Update o TaggedValues Refresh For idx2 0 to 0 TaggedValues Count 1 t 0 TaggedValues GetAt idx2 Console WriteLine Tagged Va
284. ngle 0 0 100 100 EndPath FillAndStrokePath Connector Example shape main draw a dashed line noshadow true setlinestyle DASH moveto 0 0 lineto 100 0 shape source draw a circle at the source end q New Connector rotatable true Activator startpath A ellipse 0 6 12 6 A endpath fillandstrokepath FluxGenerator shape target draw an arrowhead at the target end rotatable true startpath moveto 0 0 lineto 16 6 O 1998 2010 Sparx Systems Pty Ltd 80 Shape Scripts Example Scripts lineto 16 6 endpath fillandstrokepath Double Line shape main noshadow t rue moveto 0 10 lineto 100 10 moveto 0 10 Double lineto 100 10 Enterprise Architect Software Developers Kit Tagged Value Types 81 4 Tagged Value Types Enterprise Architect provides a number of predefined Tagged Value Types that enable you to create your own e Tagged Values that are structured 81 with a specific format with or without tag filters 824 or e Tagged Values that return values from the various reference data 84 tables You can also use a masking parameter to create your own customized masked Tagged Value Type 85 Note You can transport Tagged Value Type definitions between models using the Export Reference Data and Import Reference Data options on the Tools menu Tagged Value Type
285. ngle 22 22 78 78 moveto 22 22 lineto 50 50 lineto 78 22 return SUB SHAPES shape main rectangle 0 0 100 100 addsubshape red 10 addsubshape blue 30 addsubshape green 50 addsubshape red 100 shape red setfillcolor 200 50 100 rectangle 0 0 100 100 shape blue setfillcolor 100 50 200 rectangle 0 0 100 100 shape green setfillcolor 50 200 100 rectangle 0 0 100 100 Editable Field Shape shape main rectangle 0 0 100 100 name Class5 addsubshape namecompartment 100 20 stereotype Editable addsubshape stereotypecompartment 100 40 Field Shape shape namecompartment h_align center editablefield name rectangle 0 0 100 100 println name name Enterprise Architect Software Developers Kit Shape Scripts Example Scripts 79 shape stereotypecompartment h_align center editablefield stereotype rectangle 0 0 100 100 println stereotype stereotype Return Statement Shape shape main if hasTag alternatenotation false retumStstemente Attenuator draw ea s inbuild glyph drawnativeshape exit script with the return statement tags f return altematenotation false alternate notation commands EEE rectangle 0 0 100 100 Cloud Path Example Shape shape main class Shape Scripts o StartCloudPath Recta
286. nguishes objects referenced through a Dispatch interface 19 Pos tom Read Write The position of the Extension in the Extensions list Scenariol 35 Read only The scenario that is executed as an alternative path for this Extension Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 241 ScenarioExtension Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current ScenarioExtension object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 5 12 ScenarioStep ScenarioStep Attributes Collection of Read only A collection of ScenarioExtension objects that specify how ScenarioExtens the scenario is extended from this step The arguments to AddNewl21 ion 2407 should match the name and GUID of the alternative scenario being linked to Level String Read only The number of this Step as shown in the scenario editor This is derived from the value of Pos Read Write The GUID of a Use Case that is relevant to this step LinkedElemen Element z28 Read only The actual element specified by Link if any t ObjectType ObjectTypelt93 Read only Distinguishes objects referenced through a Dispatch interface Pos tom
287. nitialization attributes section of the script in other words before any of the methods are called Valid values for this attribute are LeftRight Shapes with leftright layout position subshapes side by side with the first added on the left and subsequent subshapes to the right TopDown TopDown places subshapes in a vertical arrangement with the first shape added to the top and subsequent shape added below Border Border layout requires an additional argument to the addsubshape method to specify which region of the containing shape the subshape is to occupy N E S Wor CENTER Each region can only be occupied by one subshape A subshape that is assigned to the E or W region must have its preferredwidth attribute specified in its declaration Similarly subshapes added to N or S must have their preferredheight attribute set In this case the values for these attributes are treated as static lengths and do not scale glyphs For example shape main layouttype topdown setfillcolor 0 0 255 rectangle 0 0 100 100 addsubshape sub 50 100 20 0 addsubshape sub 50 100 30 100 addsubshape sub 50 100 40 200 addsubshape sub 50 100 50 300 shape sub setfillcolor 0 255 0 ellipse 0 0 100 100 The above script provides the following shape 1998 2010 Sparx Systems Pty Ltd 76 Shape Scripts Write Scripts 3 3 9 Reserved Names Elements Elements such as Class State or
288. nker definition is a Comma Separated Value CSV format file It is best manipulated in a spreadsheet which should be set up to save the CSV file as comma separated text without quotation marks around text fields To add a Quick Linker definition file to a profile or technology simply place a DocumentArtifact element onto the Profile diagram Give it the name QuickLink then double click on it Open your CSV file in a text editor such as Notepad and copy and paste the contents into the DocumentArtifact element The definitions are saved with the profile and are processed and applied when the profile is imported The same applies if a profile is included within a technology with the proviso that the QuickLink element must be in the same profile as the link stereotype definitions This means that a technology could have a set of Quick Link definitions for each profile 1 3 1 Quick Linker Definition Format A Quick Linker definition is a text file consisting of records terminated by new line characters Each record must consist of 23 comma separated fields as defined by the table below The values of each field must not be in quotes A Quick Linker definition can include comments all lines that begin with are ignored by Enterprise Architect Each record of the Quick Linker definition represents a single entry on the Quick Linker menu Some fields define the menu command some fields can be thought of as filters with the entry being ignored if
289. ns of sample code See pointers to the samples 184 and other available resources 1861 Also consult the extensive Reference Section 186 Calling Executables from Enterprise Architect Enterprise Architect can be set up to call an external application You can pass parameters on the current position selected in the Project Browser to the application being called For instructions go to the Call from Enterprise Architectl1851 topic A more sophisticated method is to create Add Ins 123 which are discussed in a separate topic 7 1 Using the Automation Interface This section provides instructions on how to connect to and use the Automation Interface including e Connecting to the Interface 18h e Set References In Visual Basic 18 e Examples and Tips 184 7 1 1 Connect to the Interface All development environments capable of generating ActiveX Com clients should be able to connect to the Enterprise Architect Automation Interface By way of example the following sections describe how to connect using several such tools The procedure might vary slightly with different versions of these products O 1998 2010 Sparx Systems Pty Ltd 182 Enterprise Architect Object Model Using the Automation Interface Microsoft Visual Basic 6 0 ls 2 3 Create a new project Select the Project References menu option Select Enterprise Architect Object Model 2 0 from the list If this does not appear go to the comman
290. nseeseecsecneecsesesesseseasenseaes 66 Drawing MEAO E S a 68 Color QUERIES Ad nr 72 Conditional Branching i idivisioraanaiait ti tes dist hashed Is ane et r Eal EA 72 Query Methods eee cinco ener 72 Display Item Propertie Snan insiren ENEE E a E TEN 72 SUN 75 Reserved Names iii Die enaviceticbovebseweaybetverdiess 76 Miscellaneous a ann etida A A A AA AA 76 Example CES rd ada 77 Tagged Valle Types ii dicas 81 Predefined Structured Types 81 Create Structured Tagged Values cscsscsessesessessensseesseeseeseeesenesensseesensseaesesseneseesenesensneesseeseeeseeseneseneenes 83 Predefined Reference Data Types ccs cssssssseesneessnessseeeeeeesseesseneesnessenesssneeseneeseeesseeseseeaseessneeeeneessaeeeaes 84 Create Reference Data Tagged Values cssssscesseesesseesseeseeesesenesensensseeeseaesesseneseeseneneesneesseeseeeseeseneneneenes 85 Create Custom Tagged Value Type ssssscsesssersessesseesseeseeeseeesesseneseesensseneneeeseaseneseeseneseesneeseeeaeesseesenenensenes 86 Code Template Framework in SDK s cssccsscssesssssecsceesessaesaeessessneseesaeeaceesessaesaeesansaseas 88 Code Template Symtax cies e ae eTe a a aaa a E a bee sadeucvensecsesenessersteeaaseccensevsceveaeecestecgecsacde 88 Literal Text a a A e e a ea meen ce E Ea 88 NUETE RO e TAA AAE NA 89 Template Substitution Macros 89 Field Substitution Macro Se e A A aa San aaa aiae eis ie 90 Tagged Val e MaCrOS steenen pei ii 102 Fun
291. ntal 1 Vertical Note that there are many more Types than indicated in the above examples Tablespace Read Write Associated tablespace for a Table element Tag String Read Write Corresponds to the Keywords field in the Enterprise Architect user interface See the General Settings topic in UML Modeling with Enterprise Architect UML Modeling Tool TaggedValues Collectionl214 Read only Returns a collection of TaggedValue 2421 objects of type TaggedValue 2427 TaggedValuesEx Collectionl21H Read only Returns a collection of TaggedValuel242 objects of type belonging to the current element and the elements specialized TaggedValue or realized by the current element 2427 Collection Read only Collection of Test 243 objects for current element Read Write Sets or gets the tree position Type String Read Write The element type such as Class Component Note that Type is case sensitive inside Enterprise Architect and should be provided with an initial capital proper case Valid types are Action InteractionOccurrence Activity InteractionState ActivityPartition Interface ActivityRegion InterruptibleActivityRegion Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 233 Actor Artifact Association Boundary Change Class Collaboration Component Constraint Decision DeploymentSpecification DiagramFrame EmbeddedElement Entity EntryPoint Ev
292. ntax contains the following elements renew al Pre Contains the following EventProperty Objects for the connector a to be deleted 21 E e ConnectorID A long value corresponding to Connector ConnectorlD Repositor EA Repository 197 An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True to enable deletion of the connector from the model Return False to disable deletion of the connector 6 5 6 5 EA_OnPreDeleteDiagram Details EA_OnPreDeleteDiagram notifies Add Ins that a diagram is to be deleted from the model It enables Add Ins to permit or deny deletion of the diagram This event occurs when a user attempts to permanently delete a diagram from the Project Browser The notification is provided immediately before the diagram is deleted so that the Add In can disable deletion of the diagram Syntax Function EA_OnPreDeleteDiagram Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreDeleteDiagram function syntax contains the following elements Poonam peee oO Contains the following EventProperty Objects for the connector A to be deleted 21 i e DiagramID A long value corresponding to Diagram DiagramIiD Repositor EA Repository An EA Repository object representing the currently open y 1977 Enterprise Architect model Poll its members to retrieve
293. nterface status information Return Value Return True to notify Enterprise Architect that the double click event has been handled by an Add In Return False to enable Enterprise Architect to continue processing the event 6 5 13 3 EA_OnNotifyContextltemModified Details EA_OnNotifyContextltemModified notifies Add Ins that the current context item has been modified This event occurs when a user has modified the context item Add Ins that require knowledge of when an item has been modified can subscribe to this broadcast function Also look at EA_OnContextltemChangedl155 and EA_OnContextltemDoubleClicked 1561 Syntax Sub EA_OnNotifyContextltemModified Repository As EA Repository GUID As String ot as EA ObjectType The EA_OnNotifyContextltemModified function syntax contains the following elements CC CE owsinon o o oo ooo String IN Contains the GUID of the new context item This value corresponds to the following properties depending on the value of the ot parameter e ot ObjectType GUID value otElement Element ElementGUID otPackage Package PackageGUID otDiagram Diagram DiagramGUID otAttribute Attribute AttributeGUID otMethod Method MethodGUID otConnector Connector ConnectorGUID 1998 2010 Sparx Systems Pty Ltd 158 Enterprise Architect Add In Model Broadcast Events CE CE EN fot EA ObjectType Specifies the type of the new context item Repository EA Repository An EA
294. odel To use the Image Selection section of the MDG Technology Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 301 topic up to and including Step 6 33 where you select the Images checkbox The MDG Technology Wizard Image Selection dialog displays MDG Technology Wizard Image Selection Select the images to be included in this technology Available Images aaaa bmp Image 1491 AcV1 emf Image 155 Image 198 _ AcVcustom emf _ Image223 av 1 emf Image223 7 av2 emt Image223 SoS Acquisition avcustom emf Image227 Programme Experimental bmp Image227 Image1071 Image229 Image1274 Image236 Image 1335 Image239 Image 1355 Image240 2 For each required model image available in the current model select the checkbox next to the image name A preview of each image displays on the right of the dialog as you select the checkbox 3 Click on the Next button to proceed 2 1 10 Add Scripts When creating an MDG Technology file you can include scripts that you have created in the model see Using Enterprise Architect UML Modeling Too Note This facility is available in the Corporate Business and Software Engineering Systems Engineering and Ultimate editions of Enterprise Architect To use the Script Selection section of the MDG Technology Wizard follow the steps below 1 Follow the step
295. odel otAttributeConstraint otConnector otAttribute Tag otDiagram otMethodConstraint otRequirement otMethodTag otScenario otConnectorConstraint otConstraint otConnectorTag otTaggedValue otProjectResource otFile otReference 1998 2010 Sparx Systems Pty Ltd 194 Enterprise Architect Object Model Reference 7 2 3 9 otEffort otRoleTag otMetric otCustomProperty otlssue otPartition otRisk otTransition otTest otEventProperty otDiagramObject otEventProperties otDiagramLink otPropertyType otResource otProperties otConnectorEnd otProperty otAttribute otSwimlaneDef otMethod otSwimlanes otParameter otSwimlane PropType Enum The PropType enumeration gives the automation programmer an indication of what sort of data is going to be stored by this property ptArray An array containing values of any type A string being an entry in the semi colon separated list specified in the validation field of the Property ptFloatingPoint 4 or 8 byte floating point value ptinteger 16 bit or 32 bit signed integer ptString Unicode string 7 2 3 10 ReloadType Enum This enumeration represents values returned from the GetReloadltem and PeekReloadltem methods of the ModelWatcher Class It has four possible values which define the type of change that was made to a model Method Notes CdS 7 2 3 11 ScenarioDiagramType Enum The ScenarioDiagramType enumeration provides the following enumeration values to the Project Gen
296. oe B then m_Repository authors DeleteAt idx false Console WriteLine Delete Authors End if Next o m_Repository Clients AddNew Joe Sphere Client If 0 Update false Then Console WriteLine o GetLastError End if O nothing m_Repository Clients Refresh For idx 0 to m_Repository Clients Count 1 COnsole Writeline m_Repository Clients GetAt idx Name If m_Repository Clients GetAt idx Name Joe Sphere then O 1998 2010 Sparx Systems Pty Ltd 292 Enterprise Architect Object Model Reference m_Repository Clients DeleteAt idx false Console WriteLine Delete Clients End if Next o m_Repository Resources AddNew Joe Worker Resource If 0 Update false Then Console WriteLine o GetLastError End if O nothing m_Repository Resources Refresh For idx 0 to m_Repository Resources Count 1 COnsole Writeline m_Repository Resources GetAt idx Name If m_Repository Resources GetAt idx Name Joe Worker then m_Repository Resources DeleteAt idx false Console WriteLine Delete Resources End if Next End Sub 7 2 10 10 Stereotypes public Object Sub TestStereotypes Dim o as object Dim idx as integer add a new stereotype to the Stereotypes collection o m_Repository Stereotypes AddNew funky class If 0 Update false Then Console WriteLine o GetLastError End if O nothing make sure you refresh m_Repository Stereotypes Refresh then iterate through deleti
297. ofile package right click anywhere in the background of the Profile diagram and select the Save as Profile context menu option e asingle diagram within the Profile package choose either the Save Package as UML Profile context menu option or the Save as Profile context menu option Note The two menu options give slightly different results See Save Profile Options 187 2 The Save UML Profile dialog displays 1998 2010 Sparx Systems Pty Ltd 18 Developing Profiles Create Profiles Profile Name Timing Filename C Users chester Documents Miniclass xml Profile Type XMI UML 2 0 Notes Y Element Size v Altemate Image Color and Appearance Y Code Templates E Geet Ge 3 Click on the Browse button and select the export destination for the XML Profile file If necessary edit the profile filename but do not delete the xml extension 4 Inthe Profile Type field click on the drop down arrow and select XMI UML 2 0 Note The drop down list is not available unless the package has the lt lt profile gt gt stereotype 5 Set the required export options for all stereotypes defined in the profile e Element Size select the checkbox to export the element size attributes e Color and Appearance 17 select the checkbox to export the color background border and font and appearance border thickness attributes e Alternate Image select the checkbox to
298. ogy Wizard Pattem files selection Select the files to be included as Pattems in this technology Directory Y Dev Roy are Available Files wkdl xml wi 2 xml 2 In the Directory field navigate to the directory containing the required pattern or patterns The pattern files are automatically listed in the Available Files panel 3 To select each required pattern individually highlight the pattern in the Available Files list and click on the gt button The file name displays in the Selected Files list Alternatively to select all available patterns click on the gt gt button 4 Click on the Next button to proceed 2 1 3 Add a Diagram Profile When creating an MDG Technology file you can include a diagram profile that you have defined 527 To use the diagram profiles section of the MDG Technology Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 301 topic up to and including Step 6 33 where you select the Diagram Types checkbox The MDG Technology Wizard Diagram Types dialog displays Enterprise Architect Software Developers Kit MDG Technologies in SDK Create MDG Technologies 37 MDG Technology Wizard Diagram Types Select the files to be included as Diagram definitions in this technology Directory Y Dev Builds Addins BPMN BPMN 1 1 Available Files Selected Files BPMN Stereotypes xml a Diagram Profile xml es
299. ollowing blank spaces again indicate space defined by the template option and the remaining characters are defined by the d character which represents the enableable characters as digits or spaces The hyphen is present in the final output splitting up the digits With the Template configuration option the syntax defines the template of the masked option by occupying the blank spaces that are present in the Mask option The template is used to ensure that this information is Enterprise Architect Software Developers Kit Tagged Value Types Create Custom Tagged Value Type 87 present with every use of this custom Tagged Value The underscored values indicate the area that is to be occupied by data input by the user as defined in the Mask option Tagged Value Types Tag Name MemberZip Description Zip Code Detail Type Custom a Mask cc ddddd dddd Template State _ Zip Ses Defined Tag Types Type Description a lORules lORules MemberZip Zip Code Message E OutMessage u 1998 2010 Sparx Systems Pty Ltd 88 Code Template Framework in SDK 5 Code Template Framework in SDK The Code Template Framework CTF is used during forward engineering of UML models It is introduced in Code Engineering Using UML Models This section of the SDK discusses how you customize the way in which Enterprise Architect generates source code using the Code Templat
300. om Called by automation controllers to ensure that Add Ins Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 201 created in NET do not linger after all controller references to Enterprise Architect have been cleared CloseDiagram long Closes a diagram in the current list of diagrams that DiagramID Enterprise Architect has open Parameters e DiagramlD Long the ID of the diagram to close CloseFile A Closes any open file CreateModel Boolean Creates a new eap model file based on the standard CreateModelType CreateType Enterprise Architect Base model or a shortcut eap based string FilePath long on a provided SQL connection ParentWnd Returns true when the new file is created otherwise returns false Parameters e CreateType CreateModelType 192 Specify whether to make a new copy of the EABase eap model or create a eap file shortcut to a DBMS repository The latter option requires a dialog to be opened for the user to provide SQL connection details FilePath String Destination for new eap file ParentWnd Long Window handle to act as the parent for the SQL connection dialog Only required when using cnEAPFromSQL Repository CreateOutputTab string Creates a tab in the Output window See also ClearOutput Name 206 EnsureOutput Visible 20 WriteOutput 209 Parameters e Name String the name of the tab to create DeletePerspecti
301. om Diagram 18 Save From Package 18 Stereotypes 3 Work With 5 Use Element Extras Automation Interface Code Example 288 Use Repository Extras Automation Interface Code Example 290 Validation Of Model Configure For MDG Technology 58 Variable Definitions Code Template Syntax 117 Definitions Examples 117 References Code Template Syntax 117 References Examples 117 VB Set Up In Automation Interface 183 Visual Basic Connect To Automation Interface 181 Set Up In Automation Interface 183 W Work With Attributes Automation Interface Code Example 292 Methods Automation Interface Code Example 293 X XMIType Enum Automation Interface 195 1998 2010 Sparx Systems Pty Ltd Enterprise Architect Software Developers Kit www sparxsystems com
302. ommended anyway you must release them here In addition NET users must call memory management functions as shown below GC Collect GC WaitForPendingFinalizers Also look at EA_Connect 13h Syntax Sub EA_Disconnect Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Add In Events 131 Return Value None 6 4 3 EA_GetMenultems Details The EA_GetMenultems event enables the Add In to provide the Enterprise Architect user interface with additional Add In menu options in various context and main menus When a user selects an Add In menu option an event is raised and passed back to the Add In that originally defined that menu option This event is raised just before Enterprise Architect has to show particular menu options to the user and its use is described in the Define Menu Items 124 topic Also look at e EA MenuClick 132 e EA GetMenuStatel13h Syntax Function EA_GetMenultems Repository As EA Repository MenuLocation As String MenuName As String As Variant The EA_GetMenultems function syntax has the following elements Ponce ve orep O aa String String representing the part of the user interface that brought up the menu Can be TreeView MainMenu or Diagram String The name of the parent menu for which sub items are to be defined In the case of the top level menu it is an empty string EA Repository An EA Repository object representing the curren
303. on Interface Repository 215 MiscData 228 Model Profile 5 ode Automation Interface 187 FAVO Prog SA Templates Incorporate In Technolo 59 Parameter p i p gy Automation Interface ElementFeatures Package Model Search 252 Access Prom Add In 128 Partitions Collection Define In MTS File 46 Automation Interface ElementFeatures Package Model Validation 253 Define Configuration For MDG Technology 58 Pattern Model Validation Broadcasts Add To MDG Technology 35 Add In Model 160 PDATA EA OnEndValidation 161 EA OnlnitializeUserRules 160 EA OnRunAttributeRule 163 EA OnRunConnectorRule 163 EA _OnRunDiagramRule 162 EA OnRunElementRule 162 EA OnRunMethodRule 164 Diagram Profile Attribute Values 53 Element Attribute In MiscData Object Model 228 PI Macro Code Template Syntax Post New Events Add In Model 106 146 1998 2010 Sparx Systems Pty Ltd 306 Index Post New Events EA OnPostNewAttribute 149 EA OnPostNewConnector 147 EA_OnPostNewDiagram 148 EA _OnPostNewDiagramObject 148 EA OnPostNewElement 147 EA OnPostNewMethod 149 EA _OnPostNewPackage 150 Predefined Tag Type Assign To Stereotype 9 Define 9 Predefined Tagged Value Type Filters 81 Reference Data 84 Structured 81 Syntax 81 84 Pre Deletion Events Add In Model 138 EA OnPreDeleteAttribute 138 EA OnPreDeleteConnector 139 EA _OnPreDeleteDiagram 140 EA OnPreDeleteElement 138 EA OnPreDeleteMethod 139 EA _OnPreDeletePackage 141 Pre New Events Ad
304. ons Count 1 t method PostConditions GetAt idx2 Console WriteLine PostConditions t Name If t Name TestConstraint Then method PostConditions DeleteAt idx2 false End If Next t method TaggedValues AddNew TestTaggedValue something If t Update false Then COnsole WriteLine Tagged Values t GetLastError End if For idx2 0 to method TaggedValues Count 1 t method TaggedValues GetAt idx2 Console WriteLine Tagged Value t Name If t Name TestTaggedValue Then method TaggedValues DeleteAt idx2 false End If Next t method Parameters AddNew TestParam string If t Update false Then Console WriteLine Parameters t GetLastError End if method Parameters Refresh For idx2 0 to method Parameters Count 1 t method Parameters GetAt idx2 Console WriteLine Parameter t Name If t Name TestParam Then method Parameters DeleteAt idx2 false End If Next method nothing Next catch e as exception Console WriteLine element Methods GetLastError Console WriteLine e End try End Sub Enterprise Architect Software Developers Kit Index 295 Enable 128 n d ex Events 129 Holding State Information 126 Manage 128 Manager 128 A Pre 2004 126 Re entrancy 126 NET Run Functions From Tasks Pane 56 Search 128 Search Data 129 A Tasks 124 Visual Basic Issues 126 Garbage Collect Exit Method 197 Add Add In Event Code Mod
305. ontrolResynchPkgSt atuses boolean ClearSettings WriteOutput string Name Saves an open diagram Assumes the diagram is open in the main user interface Tab list Parameters e DiagramlD Long the ID of the diagram to save Shows a help topic as a view Parameters e Topic String specifies the help topic 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 e Item Object the object to highlight Shows hides the contents of a specified technology or profile in the Enterprise Architect UML Toolbox To show hide a profile in the Toolbox specify the profile s ID value in the Profile parameter and set the Technology parameter to a null string To show hide a technology in the Toolbox specify the technology s ID in the Technology parameter and set the Profile parameter to a null string Parameters Technology String the ID of the technology Profile String the ID of the profile Show Boolean if true show the technology or profile if false hide the technology or profile Shows or hides Enterprise Architect Parameters e Show Long Enables execution of a SQL select statement against the current repository Returns an XML formatted string value of the resulting recordset Parameters e SQL String contains the SQL Select statement Synchronizes the
306. ooks at the list of methods in the current object and depending on the conventions of the current language returns T if one is a copy constructor Typically used with the genOptGenCopyConstructor 9 macro classHasDestructor Looks at the list of methods in the current object and depending on the conventions of the current language returns T if one is a destructor Typically used with the genOpiGenDestructor 9 macro 1998 2010 Sparx Systems Pty Ltd 92 Code Template Framework in SDK Code Template Syntax separated by double colons connectorDestAllowDuplicates Connector Properties dialog Target Role tab Allow Duplicates checkbox connectorDestElem A set of macros that access a property of the element at the target end of a connector The asterisk is a wildcard that corresponds to any class substitution macro in this list for example connectorDestElemAlias classAlias connectorDestElemAuthor classAuthor connectorDestElemType The element type of the connector destination element Separate from the o macros because there is no classType substitution macro connectorDestMemberType Connector Properties dialog Target Role tab Member Type connectorDestMultiplicity Connector Properties dialog Target Role tab Multiplicity Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 93 connectorSourceAllowDuplicates Con
307. open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True to enable addition of the new method to the model Return False to disable addition of the new method 6 5 7 7 EA_OnPreNewPackage Details EA_OnPreNewPackage notifies Add Ins that a new package is about to be created in the model It enables Add Ins to permit or deny creation of the new package This event occurs when a user drags a new package from the Enterprise Architect UML Toolbox or Resources window onto a diagram or by selecting the New Package icon from the Project Browser The notification is provided immediately before the package is created so that the Add In can disable addition of the package Also look at EA_OnPostNewPackage 150 Syntax Function EA_OnPreNewPackage Repository As EA Repository Info As EA EventProperties As Boolean 1998 2010 Sparx Systems Pty Ltd 146 Enterprise Architect Add In Model Broadcast Events The EA_OnPreNewPackage function syntax contains the following elements pepe CC Contains the following EventProperty Objects for the package a to be created 21 Stereotype A string value corresponding to Package Stereotype ParentID A long value corresponding to Package ParentID DiagramID A long value corresponding to the ID of the diagram to which the package is being added Repository EA Repositor An EA Repositor
308. or End if element Tests Refresh For idx 0 to element Tests Count 1 O element Tests GetAt idx Console WriteLine o Name If 0 Name TestPlan Then If bDel Then element Tests Delete idx End if Next Defect O element Issues AddNew Broken Defect If not o Update Then Console WriteLine Issues error 0 GetLastError End if element Issues Refresh For idx 0 to element Issues Count 1 O element Issues GetAt idx Console WriteLine o Name If o Name Broken Then If bDel Then element Issues Delete idx End if Next Change O element Issues AddNew Change Change If not o Update Then Console WriteLine Issues error o GetLastError End if element Issues Refresh For idx 0 to element Issues Count 1 O element Issues GetAt idx Console WriteLine o Name If o Name Change Then If bDel Then element Issues Delete idx End if Next catch e as exception Console WriteLine element Methods GetLastError Console WriteLine e End try End Sub 7 2 10 9 Repository Extras public Object Examples of how to access repository collections for system level information Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 291 Sub RepositoryExtras Dim o as object Dim idx as integer issues o m_Repository Issues AddNew Problem Type If 0 Update false Then Console WriteLine o GetLastError End if
309. or displays Select the appropriate language from the Language list Select one of the base templates from the Templates list If the base template has stereotyped overrides you can select one of these from the Stereotype Overrides list In the Code Templates Editor make the required modifications Click on the Save button This stores the modified version of the template to the EAP file The template is marked as modified When generating code Enterprise Architect now uses the overridden template instead of the default template 5 2 3 Add New Stereotyped Templates Sometimes it is useful to define a specific code generation template for use with elements of a given stereotype This enables different code to be generated for elements depending on their stereotype Enterprise Architect provides some default templates which have been specialized for commonly used stereotypes in supported languages For example the Operation Body template for C has been specialized for the property stereotype so that it automatically generates its constituent get and set methods Users can override the default stereotyped templates as described in the previous topic Additionally users can define templates for their own stereotypes as described below Add a New Stereotyped Template To override a default code generation template follow the steps below i No ga 8 Select the Configuration Code Generation Templates menu option to open t
310. ory path as a string value 1998 2010 Sparx Systems Pty Ltd 82 Tagged Value Types Predefined Structured Types Type Enum Enables definition of a comma separated list where Values Val1 Val2 Val3 Val1 Val2 and Val3 represent values in the list and Default Val2 Default represents the default value of the list Type File Enables input of a filename from a file browser dialog Default Val The named file can be launched in its default application You can set a default file as a string containing the file path and file name Float Decimal Double Type Float Enable entry of a Float Decimal or Double value Type Decimal These types all map to the same type of data Type Double Default Val Integer Type Integer Enables entry of an Integer value and a default Default Val Type Memo Enables input of large and complex Tagged Values You can set a default for any or all of these RefGUID Type RefGUID Enables the Tagged Value to reference an element Values Type1 Type2 from the model by specifying the element s GUID Stereotypes Stereotype where Type1 and Type2 specify one or more allowed 1 diagram objects such as Class Component Attribute or Operation and Stereotype1 represents an allowed stereotype Set the classifier see UML Modeling With Enterprise Architect UML Modeling Too attribute or operation see the UML Dictionary for a Tagged Value of this type by clicking on the
311. ovides a high level overview of the Automation Interface for accessing manipulating modifying and creating Enterprise Architect UML elements The top level object is the Repository which contains collections for a variety of system level objects as well as the main Models collection that provides access to the UML elements diagrams and packages within the project In general the Role names applied at the Target end of associations indicate the name of the Collection that is used to access instances of that object Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 189 Repositoy posin Parameter Pe Parameters INET E sl oe ny e TaggedValues a Soenarios 1 Models o Attributes 0 pana Package J os E Y Y 1 Le 1 1 Constraints oisremonjeas Disgramojea GF constraint _ _ oe Disgrams 0 es ges E ya Internal Links e Logical diagram Automation Interface Package Automation Interface e Logical diagram Automation Interface Package Automation Interface e Logical diagram Automation Interface Package Automation Interface 1998 2010 Sparx Systems Pty Ltd 19 Enterprise Architect Object Model Reference e Logical diagram Automation Interface Package Automation Interface e Logical diagram Automation Interface Package Automation Interface e Logical diagram Automatio
312. pacelmpl Operation OperationBody OperationBodyImpl OperationDeclaration OperationDeclarationImpl OperationImpl OperationNotes Parameter O 1998 2010 Sparx Systems Pty Ltd 90 Code Template Framework in SDK Code Template Syntax 5 1 2 2 Field Substitution Macros The field substitution macros provide access to data in the model In particular they are used to access data fields from e Packages e Classes e Attributes e Operations e Parameters Field substitution macros are named according to Camel casing By convention the macro is prefixed with an abbreviated form of the corresponding model element For example attribute related macros begin with att as in the attName macro to access the name of the attribute in scope The following table lists each of the field substitution macros with a description of the result Note Macros that represent checkboxes return a value of T if the box is selected Otherwise the value is empty attConst Attributes dialog Const checkbox attContainerType Attributes Detail dialog Container Type attGUID The unique GUID for the current attribute attContainment Attributes dialog Containment attlsEnumLiteral Attributes dialog Is Literal checkbox attLength Column dialog Length attName Attributes dialog Name attNotes Attributes dialog Notes attDerived Attributes dialog Derived checkbox attLowerBound Attributes Detail dialog Lower Bound attCollect
313. pecial thanks to Publisher All the people who have contributed suggestions examples bug Sparx Systems reports and assistance in the development of Enterprise Architect The task of developing and maintaining this tool has been greatly Managing Editor enhanced by their contribution Geoffrey Sparks Technical Editors Geoffrey Sparks Salvatore Mancarella Neil Capey Contents l Table of Contents Foreword 1 SDK for Enterprise Architect 2 Developing Profiles Custom Stereotypes 3 Create Protesis 5 Create a Profile Packages miccional 5 Add Stereotypes and Metaclasses cccccsscsccssessessssenscsscnscnscsscsscsecececsscsecsecseeseessessessessesnesnecseeseeaaeas 6 Define Stereotype Tagged ValuES cccccccnccnconooncanonnnanonnnanonnonnonnnnnonnnnnnnnnnnnnnnnnnnnnnnnnnnnnn peeraa a EnEn 8 With Predefined Tag TYpES 0iorcariica da ii dia dedica 9 With Supported Attributes w mmoconomiii ar o e alanis 10 Use the Tagged Value Connectors sccar aeae e ardada de aeiaai 11 Define Stereotype Constraints ccccccccccccsscsscsscsscsscsscsscsecsecssessesseseesensenececnesecsecsecsecsseseeseessessesseaees 12 Add Enumeration Element cccceeeeceeeeeeeeeeeeaeeeeeeaaeeeeeaeeeeceaaeeseeaaeeeeseaeeeeseaeesseceeeesenaeeessneeeseeeaeees 14 Add Shape Scriptsici icc la sii a ee os 15 Set Defa ltAppearanco i s icere ieii dicci n 17 Exporta UML Profilo i0ii Ae 17 Save Profile Opt
314. pers Kit Code Template Framework in SDK Code Template Syntax 95 genOptCGenMethodNotesInHead C Specifications dialog Method Notes In Header er genOptCSynchNotes C Specifications dialog Synchronize Notes in Generation genOptCSynchCFile C Specifications dialog Synchronise Implementation file in Generation genOptCOperationRefParamNam C Specifications dialog Reference Parameter Name e genOptCConstructorName C Specifications dialog Default Constructor Name genOptCPPDefaultSourceDirector C Specifications dialog Default Source Directory y genOptCPPGenMethodNotesInHe C Specifications dialog Method Notes In Header checkbox ader genOptCPPGenMethodNotesInBo C Specifications dialog Method Notes In Body checkbox dy genOptCPPGetPrefix C Specifications dialog Get Prefix C Specifications dialog Default file extension 1998 2010 Sparx Systems Pty Ltd 96 Code Template Framework in SDK Code Template Syntax genOptDefaultCopyConstructorSc Object Lifetimes dialog Default Copy Constructor Visibility genOptDefaultDatabase Code Editors dialog Default Database genOptDefaultDestructorScope Object Lifetimes dialog Default Destructor Constructor Visibility Properties checkbox genOptGenlmplementedinterface Attribute Operations Specifications dialog Generate methods for Ops implemented interfaces checkbox genOptGenPrefixBoolProperties Source Code Engineerin
315. plate substitution macros correspond to Base templates see Code Engineering Using UML Models These macros result in the execution of the named template By convention template macros are named according to Pascal casing Structure lt TemplateName gt where lt TemplateName gt can be one of the templates listed below When a template is referenced from within another template it is generated with respect to the elements currently in scope The specific template is selected based on the stereotypes of the elements in scope As noted previously there is an implicit hierarchy among the various templates Some care should be taken in order to preserve a sensible hierarchy of template references For example it does not make sense to use the ClassInherits macro within any of the attribute or operation templates Conversely the Operation and Attribute templates are designed for use within the ClassBody template The CTF contains the following template substitution macros e AttributeDeclaration e AttributeNotes e Attribute e Class e Classimpl e ClassBase e ClassBody e ClassBodylmpl e ClassDeclaration e ClassDeclarationlmpl e ClassInherits e ClassInterface e ClassNotes ClassParameter File Filelmpl ImportSection ImportSectionImpl InnerClass InnerClassImpl LinkedAttribute LinkedAttributeNotes LinkedAttributeDeclaration LinkedClassBase LinkedClassInterface Namespace NamespaceBody NamespaceDeclaration Names
316. ple 165 for a detailed example of use of this method Parameters e Categoryld String should be passed the return value from the DefineRuleCategory 272 method ErrorType EA EnumMVErrorType depending on the severity of the error being validated can be e mveErrorCritical e mveError e mvWarning or 1998 2010 Sparx Systems Pty Ltd 282 Enterprise Architect Object Model Reference momoa type notes O e mvinformation e ErrorMessage String contains an error string PutDiagramimageOnClipboard protected string DiagramGUID long abstract Type Boolean PutDiagramimageToFile s tring Diagram GUID string FileName long Type protected abstract Boolean ReloadProject protected abstract Boolean protected abstract Void RunReport string PackageGUID string TemplateName string Filename RunHTMLReport string PackageGUID string ExportPath string ImageFormat string Style string Extension SaveControlledPackage s tring PackageGUID Copies an image of the specified diagram to the clipboard Parameters e DiagramGUID String the GUID in XML format of the diagram to copy Type Long the file type e If Type 0 then it is a metafile e If Type 1 then it is a Device Independent Bitmap 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 t
317. press the shapes shadow from being rendered Valid values true or false default false orientation string Applies to decoration shapes only Determines where the decoration is positioned within the containing element glyph Valid values NW N NE E SE S SW W preferredHeight Used by border layoutType north and south Used in drawing the source and target shapes for connectors to determine how wide the line is preferredWidth a Used by border layoutType east and west Used by leftright layoutType shapes where scalable is false to determine how much space they occupy for layout purposes For example rightAnchorOffset 10 0 move embedded element left 10 pixels from the right edge rotatable Set to false to prevent rotation of the shape This attribute is only rightAnchorOffset int int When creating a Shape Script for an embedded element such as a Port use this attribute to offset the shape from the right edge of its parent O 1998 2010 Sparx Systems Pty Ltd 68 Shape Scripts Write Scripts applicable to the source and target shapes for lines glyphs Valid values true or false default true scalable string Set to false to stop the shape from being relatively sized to the associated diagram glyph Valid values true or false default true topAnchorOffset int int When creating a Shape Script for an embedded element such as a Port use this attribute to offset the shape from th
318. prise Architect and as such requires access to a specific set of events all to do with generation synchronization and general processes concerned with converting models to code and code to models e MDG BuildProjectl17h e MDG Connectli7h e MDG Disconnectl172 Enterprise Architect Software Developers Kit Enterprise Architect Add In Model MDG Add Ins 171 e MDG GetConnectedPackages 173 e MDG GetProperty 173 e MDG Mergel17 e MDG NewClass 175 e MDG PostGenerate 176 e MDG PostMergel176 e MDG PreGeneratel77 e MDG PreMergel17 e MDG PreReversel17 e MDG RunExel175 e MDG View 175 6 7 1 1 MDGBuild Project Details MDG_BuildProject enables the Add In to handle file changes caused by generation This function is called in response to a user selecting the Add Ins Build Project menu option Respond to this event by compiling the project source files into a running application Also look at MDG_RunExel179 Syntax Sub MDG_BuildProject Repository As EA Repository PackageGuid As String The MDG_BuildProject function syntax contains the following elements Pera e preto Joeerpion o PackageGuid String IN The GUID identifying the Enterprise Architect package sub tree that is controlled by the Add In Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Retur
319. prise Architect Object Model Reference Abstract Sting ActionFiegs Sting Alles Sting Attibutes Collection 0_ AtibutesEx Collection 09 Author Sting Clessifien Long CtassifierNeme Sting CiessifierType Sting Complexity Sting Constaints Collection 0_ ConsteintsEx Collection 0 9 Creates Debe Dificuity Sting ESorts Collection 0_ Files Collection 0_ Genfle Sting Genlinks Sting GenType Sting tspec Boolean issues Collection 0_ Locked Bcciean Methods Collection 0 3 MethodsEx Collection 0 9 Mebics Collection 0 3 Modifies Dete Multiplicity Sting Package Long Persistence Sting Phase Verent Pricaty Sting Requirements Collection 0 9 RequirementsEx Collection 0 9 Resources Collection 0_ Risks Collection 0_ Scenartos Collection 09 Stereotype Swing StyieEx Sting SubType Long Teblespece Sting Teg Sting TeggedValves Collection 0 9 TegpedvaluesEx Collection 0 3 Tests Collection 0_ Type Sting Version Sting Visibility Sting PORT MOLE ROH MIO COUR A IO RTS TOO CTO A A AO AA AA COOH CNTR MOS AAA AAA FINAS RARA A A A a E n Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 227 7 2 5 1 Constraint public Class A Constraint is a condition imposed on an element Constraints are accessed through the Element Constraints collection Associated table
320. project to open e Username String the user login ID e Password String the user password 1998 2010 Sparx Systems Pty Ltd 208 Enterprise Architect Object Model Reference RefreshModelView long PackagelD RefreshOpenDiagrams boolean FullReload ReloadDiagram long DiagramID RemoveOutputTab string Name RunModelSearch string sQueryName string sSearchTerm string sSearchOptions string sSearchData SaveAllDiagrams SaveAuditLogs string Boolean FilePath object StartDateTime object EndDateTime Reloads a package or the entire model updating the user interface Parameters e PackagelD Long the ID of the package to reload if O the entire model is reloaded if a valid package ID only that package is reloaded Refreshes the diagram contents for all diagrams open in Enterprise Architect Parameters e FullReload Boolean if false the displayed contents of elements and connectors are refreshed in each diagram if true each of the diagrams is completely reloaded from the repository 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 e DiagramlD Long the ID of the diagram to be reloaded Removes a specified tab from the Output window Parameters e Name String the name of the tab to be removed Runs a search
321. quires Requirement Attributes Atribute Tyee Read Write Estimated difficulty to implement Read Write Date requirement last updated name Sing Rea e r O CN E Pest utr sos abo ouronens OO ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 198 ParentlD Read only The ElementID of the element to which this requirement applies Read Write Assigned priority of the requirement RequirementiD Read only A local ID for this requirement Stability String Read Write Estimated stability of the requirement This is an indication of the probability of the requirement or understanding of the requirement changing High stability indicates a low probability of the requirement changing status String Read Write Current status of the requirement Read Write Requirement type Requirement Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error 1998 2010 Sparx Systems Pty Ltd 238 Enterprise Architect Object Model Reference Method Type Notes DENNIS IEA CEN Update Boolean Update the current Requirement object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 5 8 Resource public Class An Element Resource is a named person tas
322. r TaggedValues collection Associated table in EAP file t_connectortag ConnectorTag Attributes Atribute type Noss ConnectorlD Read Write The local ID of the associated connector Name stmg Reaciwte The tag or name String Read Write Further descriptive notes about this tag If Value below is set to lt memo gt then Notes should contain the actual Tagged Value content ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch 1937 interface TagGUID Read Write A globally unique ID for this Tagged Value TaglD Read only A local ID to identify the Tagged Value Value String Read Write The value assigned to this tag This field has a 255 character limit If the value is greater than 255 characters long set the value to lt memo gt and insert the body of text in the Notes attribute above When reading existing Tagged Values if Value lt memo gt then the developer should read the actual body of text from the Notes attribute ConnectorTag Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current ConnectorTag object after modification or appending a new item If false is returned check the GetLastError function for more information Enterprise Architect Software Developers Kit Ente
323. r details MVR7F0001 is one of Enterprise Architect s built in rule sets These validation options are applied when you activate the appropriate technology The global default technology has all rules turned on 2 7 Incorporate Model Templates Enterprise Architect has a number of Model Templates see Using Enterprise Architect UML Modeling Tool that can be added into a model either on creation of the model or at any time by right clicking on a package in the Project Browser and selecting the Add Add a New Model using Wizard context menu option see UML Model Management You can create your own templates and include them in your MDG Technology The first step is to create a template package and save it to the MTS file Open your MTS file in a text editor and copy and paste the following lt ModelTemplates gt block at the top level inside the lt MDG Selections gt block lt ModelTemplates gt lt Model name Template Name description This is the description location MyTemplatePackage xml default yes icon 34 filter Filter Name gt lt ModelTemplates gt You can include as many lt ModelTemplates gt blocks as you have model templates The attributes have the following meanings e Model name The name of the model template as shown in the Select model s dialog which displays when you create a new model or when you execute the Add a New Model using Wizard menu option e description The text that is displayed in t
324. r of this type New Link Stereotype If set and Create Link also set results in the creation of a connector with this stereotype New Link Direction Can be directed always creates an association from source to target from always creates an association from target to source undirected always creates an association with unspecified direction bidirectional always creates a bi directional association or to creates either a directed or undirected association depending on the value of the Association Direction option Note Not all of the above work with all connector types for example you cannot create a bi directional Generalization New Link Caption If a new connector is being created but not a new element then this is the text that appears on the context menu L New Link amp Element If a new connector AND a new element are being created then this is the Caption text that appears on the context menu EN Create Link If set to TRUE results in creation of a new connector otherwise should be left blank Create Element If set to TRUE the row is ignored unless a connector is being dragged onto an empty piece of diagram and results in creation of a new element otherwise should be left blank This overrides the values of Target Element Type and Target Stereotype Filter Disallow Self Should be set to TRUE if self connectors are invalid for this kind of connector connector otherwise should be left blank Exclusi
325. ram type 23 the child diagram created is a Package diagram The following example from BPMN shows that a BusinessProcess element is always created as a Composite element with a BPMN custom child diagram _defaultDiagramType string BPMN BPMN _mskeComposite boolean true extends BusinessProcess 1 2 9 5 Define Child Diagram Types The _defaultDiagramType attribute is applied to a metaclass element not a stereotype element lt defines the type of diagram created when an element is made composite 23 This attribute can take as its name any of the inbuilt diagram types of Enterprise Architect these are listed below Alternatively if a custom diagram type is required it should be prefixed with the diagram profile name and The following examples show a BusinessProcess Activity that when made a composite element automatically creates an Analysis diagram and a block stereotype that creates a SysML InternalBlock custom diagram O 1998 2010 Sparx Systems Pty Ltd 24 Developing Profiles Create Profiles a metaciass gt ES amp X Activity Cue _defaultDisgramType string Extended Analysis defsultDiegramType string SysML IntemalBlock extends extends BusinessProcess You can also use the _defaultDiagramType attribute for packages extending the Package metaclass Values For _defaultDiagramType The following initial values should be used to refer
326. rams is required accepted values 0 Do not export diagrams 1 Export diagrams 2 Export diagrams along with alternate 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 Exports XMI for a specified package with a flag to determine whether the export includes package content below the first level See the Controlled Packages section in UML Model Management Parameters e PackageGUID String the GUID in XML format of the package to be exported XMIType EnumXMIType specifies the XMI type and version information see XM Type Enum 19 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 alternate 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 1998 2010 Sparx Systems Pty Ltd 276 Enterprise Architect Object Model Reference Boolean GenerateClass string ElementGUID string ExtraOptions GenerateDiagramFro
327. rangements leave the attribute value blank or remove it altogether Use this section to declare all possible fields columns that appear in Enterprise Architect s search window that are used below in lt Rows gt The order of the columns of information to be appended here must match the order that the search run in Enterprise Architect would normally display Furthermore if you append results onto a custom SQL Search then the order used in your Custom SQL must match the order used below gt lt Fields gt lt Field name gt lt Field name gt lt Field name gt lt Field name gt lt Fields gt lt Rows gt lt Row gt lt Field name value gt lt Field name value gt lt Field name value gt lt Field name value gt lt Row gt lt Row gt lt Field name value gt lt Field name value gt lt Field name value gt lt Field name value gt lt Row gt lt Row gt lt Field name value gt lt Field name value gt lt Field name value gt lt Field name value gt lt Row gt lt Rows gt lt ReportViewData gt 6 4 Add In Events All Enterprise Architect Add Ins can choose to respond to the following general Add In events e EA Connectl136 e EA Disconnectl1361 e EA GetMenultemsli3h 1998 2010 Sparx Systems Pty Ltd 130 Enterprise Architect Add In Model Add in Events e EA
328. reMerge 177 MDG Events MDG_PreReverse 178 MDG Events MDG_RunExe 179 MDG Events MDG_View 179 Model Validation Broadcasts 160 Model Validation Broadcasts EA OnEndValidation 161 Model Validation Broadcasts EA OnlnitializeUserRules 160 Model Validation Broadcasts EA OnRunAttributeRule 163 Model Validation Broadcasts EA OnRunConnectorRule 163 Model Validation Broadcasts EA _OnRunDiagramRule 162 Model Validation Broadcasts EA OnRunElementRule 162 Model Validation Broadcasts EA OnRunMethodRule 164 Model Validation Broadcasts EA _OnRunPackageRule 162 Model Validation Broadcasts EA OnRunParameterRule 164 Model Validation Broadcasts EA OnStartValidation 161 Enterprise Architect Software Developers Kit Index 297 Add In Model Model Validation Example 165 Post New Events 146 Post New Events EA_OnPostNewaAttribute 149 Post New Events EA OnPostNewConnector 147 Post New Events EA_OnPostNewDiagram 148 Post New Events EA _OnPostNewDiagramObject 148 Post New Events EA_OnPostNewElement 147 Post New Events EA OnPostNewMethod 149 Post New Events EA_OnPostNewPackage 150 Pre Deletion Events 138 Pre Deletion Events EA_OnPreDeleteAttribute 138 Pre Deletion Events EA_OnPreDeleteConnector 139 Pre Deletion Events EA_OnPreDeleteDiagram 140 Pre Deletion Events EA_OnPreDeleteElement 138 Pre Deletion Events EA_OnPreDeleteMethod 139 Pre Deletion Events EA_OnPreDeleteP
329. rface status information Return Value Return True if the attribute has been updated during this notification Return False otherwise 6 5 9 6 EA_OnPostNewMethod Details EA_OnPostNewMethod notifies Add Ins that a new method has been created on a diagram lt enables Add Ins to modify the method upon creation This event occurs when a user creates a new method on an element by either drag dropping from the Project Browser using the method s Properties dialog or using the in place editor on the diagram The notification is 1998 2010 Sparx Systems Pty Ltd 150 Enterprise Architect Add In Model Broadcast Events provided immediately after the method is created Set Repository SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs Also look at EA_OnPreNewMethod 145 Syntax Function EA_OnPostNewMethod Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPostNewMethod function syntax contains the following elements Peon oe osname Contains the following EventProperty objects for the new awe method 21 er e MethodlD A long value corresponding to Method MethodID Repository EA Repository 197 An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True if the method has been updated during this notifica
330. ributeconstraints AttributeConstraint Attributes CE type CC AttributelD Read Write ID of the attribute this constraint applies to ame Sting reaciwte The constraint Notes String Read Write Descriptive notes about constraint ObjectType ObjectTypel931 Read only Distinguishes objects referenced through a Dispatch interface Read Write Type of constraint Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 247 AttributeConstraint Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current AttributeConstraint object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 6 3 AttributeTag public Class An Attribute Tag represents a Tagged Value associated with an attribute Associated table in EAP file t_attributetag AttributeTag Attributes Attribute tye AttributelD Read Write Local ID of attribute associated with this Tagged Value String Read Write Further descriptive notes about this tag If Value below is set to lt memo gt then Notes should contain the actual Tagged Value content ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch TagGUID Read Wri
331. ring sGUID As String oType As EA ObjectType As Variant If Repository Is Nothing Then Exit Function End If Dim sCompartmentData As String Dim oXML As MSXML2 DOMDocument Dim Nodes As MSXML2 IXMLDOMNogdeL ist Dim Node1 As MSXML2 IXMLDOMNode Dim Node As MSXML2 IXMLDOMNode Dim sData As String sCompartmentData Set oXML New MSXML2 DOMDocument sData On Error GoTo ERR_GetCompartmentData oXML loadXML Repository GetTreeXMLByGUID sGUID Set Node1 oXML selectSingleNode Modelltem If Node1 Is Nothing Then Exit Function End If sCompartmentData sCompartmentData Name sCompartment sCompartmentData sCompartmentData OwnerGUID sGUID sCompartmentData sCompartmentData Options SkiplfOnDiagram amp _eq_ 1 amp _sc_ Select Case sCompartment Case parts 1998 2010 Sparx Systems Pty Ltd 160 Enterprise Architect Add In Model Broadcast Events Set Nodes Node1 selectNodes Modelltem OMetatype Part For Each Node In Nodes sData sData Data amp _eq_ Node Attributes getNamedltem Name nodeValue amp _sc_ sData sData GUID amp _eq_ Node Attributes getNamedltem GUID nodeValue 8_sc_ Next Case ports Set Nodes Node1 selectNodes Modelltem Metatype Port For Each Node In Nodes sData sData Data amp _eq_ Node Attributes getNamedltem Name nodeValue amp _sc_ sData sData GUID amp _eq_ Node Attributes get
332. ring value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Parameter object after modifying or appending a new item If false is returned check the GetLastError function for more information 7 2 6 10 Partitions public Collection A collection of internal element partitions regions This is commonly seen in Activity State Boundary Diagram Frame and similar elements see the UML Dictionary Not all elements support partitions This collection contains a set of Partition elements The set is read write information is not saved until the host element is saved so ensure that you call the Element Save method after making changes to a Partition 1998 2010 Sparx Systems Pty Ltd 254 Enterprise Architect Object Model Reference Partition Attributes Past wo Mewes AAA String Read Write The partition name can represent a condition or constraint in some cases Note string Read Write A free text note associated with this partition ObjectType Obi jectType Read only Distinguishes objects referenced through a Dispatch interface 19 Read Write An optional operator value that specifies the partition type Size Sting Read Write Vertical or horizontal width of partition in pixels 7 2 6 11 Properties Properties Properties Attributes amvipu
333. rite See the Transition topic in the UML Dictionary for n appropriate values TransitionEvent Read Write See the Transition topic in the UML Dictionary for O 1998 2010 Sparx Systems Pty Ltd 260 Enterprise Architect Object Model Reference Atributo Type Notes TransitionGuard String Read Write See the Transition topic in the UML Dictionary for appropriate values Type String Read Write Connector type Valid types are held in the t_connectortypes table in the EAP file Virtuallnheritanc Read Write For Generalization indicates if inheritance is virtual e width Long Read Write Specifies the width of the connector Connector Methods GetLastError MiscData long String EN 7 2 7 3 ConnectorEnd public Class Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Read only This low level property provides information about the contents of the PDatax fields These database fields are not documented and developers must gain understanding of these fields through their own endeavors to use this property MiscData is zero based therefore e MiscData 0 corresponds to PData1 e MiscData 1 to PData2 Parameters e Index long the zero based index of the PData field to access Update the current ConnectorObject after modification or appending a new item If fal
334. rm Attributes CA Notes Meaning String Read Write The description of the term its meaning ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 19 Read Write The glossary item name Read only A local ID number to identify the term in the model Read Write The type this term applies to for example business or technical Term Methods GetLastError j Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current Term object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 5 Element public Package The Element package contains information about an element and its associated extended properties such as testing and project management information An element is the basic item in an Enterprise Architect model Classes Use Cases and Components are all different types of UML element The diagram below illustrates the relationships between an element and its associated extended information The related information is accessed through the collections owned by the element for example Scenarios and Tests It also includes a full description of the element object the basic model structural unit O 1998 2010 Sparx Systems Pty Ltd 226 Enter
335. rning the Baseline CreateBaselineEx string Boolean Creates a Baseline of a specified package with a flag PackageGUID string Version to exclude package contents below the first level string Notes EA See Baseline UML Models CreateBaselineFlag Flags 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 Flags EA CreateBaselineFlag 192 whether or not to exclude package contents below the first level DefineRule string CategorylD String Defines the individual rules that can be performed EA EnumMVErrorType during model validation It must be called once for ErrorType string each rule from the E A_OninitializeUserRules 166 ErrorMessage broadcast handler The return value is a Ruleld which can be used for reference purposes when an individual rule is executed by Enterprise Architect during model validation See Model Validation Examplel1651 for a detailed example of use of this method Parameters e Categoryld String should be passed the return value from the DefineRuleCategory 272 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 PublishResultl28 call DefineRule
336. rns a string containing a comma separated list of 1998 2010 Sparx Systems Pty Ltd 234 Enterprise Architect Object Model Reference EnumRelationSetType ElementlDs of directly and indirectly related elements based Type on the given type See EnumRelationSetTypel19 Recurses using the same relation type on all elements it finds retrieving all dependencies and sub dependencies of the current element for example Object depends on Objeci2 which depends on Object3 Therefore this method returns Object2 and Object3 To obtain only the direct relationships of the element use the Connector 255 collection instead GetStereotypeList Returns a comma separated list of stereotypes allied to this element LoadLinkedDocument Boolean Loads the RTF document from the specified file into the string Filename element s linked document Parameter e FileName String the name of the file from which to load the RTF document Refresh Void Refreshes the element features in the Project Browser Usually called after adding or deleting attributes or methods when the user interface is required to be updated as well ReleaseUserLock Boolean Releases a user lock or group lock on the element object Throws an exception if the operation fails Use GetLastError to retrieve error information SaveLinkedDocument Boolean Saves the linked document for this element to the specified string Filename RTF file Paramet
337. ros to generate code from behavioral models These are e EASL_GET and e EASLList EASL_GET The EASL_GET macro is used to retrieve a property or a collection of an EASL object The EASL objects and the properties and collections for each object are identified in the EASL Collections 11h and EASL Properties 1131 topics Syntax result EASL_GET lt lt Property gt gt lt lt Owner ID gt gt lt lt Name gt gt where e lt lt Property gt gt is either Property or Collection e lt lt OwnerlD gt gt is the ID of the owner object for which the property collection is to be retrieved e lt lt Name gt gt is the name of the property or Collection being accessed e result is the returned value this is if not a valid property Example sPropName EASL_GET Property context Name EASLList The EASLList macro is used to render each object in an EASL collection using the appropriate template 1998 2010 Sparx Systems Pty Ltd 110 Code Template Framework in SDK Code Template Syntax Syntax result EASLList lt lt TemplateName gt gt separator lt lt Separator gt gt indent lt lt indent gt gt Oowner lt lt OwnedlD gt gt collection lt lt CollectionName gt gt option1 lt lt OPTION1 gt gt option2 lt lt OPTION2 gt gt optionN lt lt OPTIONN gt gt where e lt lt TemplateName gt gt is the name of any behavioral model template 110 or cu
338. rprise Architect Object Model Reference 263 7 2 7 5 RoleTag public Class This interface provides access to the association Role Tagged Values Each connector end has a RoleTag collection that can be accessed to add delete and access the RoleTags In code you create something that resembles the following where con is a Connector Object Code fragment for accessing a RoleTag in VB NET client con ClientEnd client Role m_client client Update tag client TaggedValues AddNew tag value tag Update tag client TaggedValues AddNew tag2 value2 tag Update client TaggedValues Refresh For idx 0 To client TaggedValues Count 1 tag client TaggedValues GetAt idx Console WriteLine tag Tag client TaggedValues DeleteAt idx False Next tag Nothing RoleTag Attributes Attribute type Notes O BaseClass String Read Write Indicates the role end set to ASSOCIATION_SOURCE or ASSOCIATION_TARGET ElementGuID String Read Write GUID of the connector with which this role tag is associated RoleTag Methods Returns a string value describing the most recent error that occurred in 0 relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the RoleTag after changes or on initial creation If false is returned check the GetLastError function for more information 7 2 8 Diagram public Package The Diagram pa
339. rs Kit Developing Profiles Create Profiles 25 each package create profile diagrams defining all the stereotypes in the namespace You can use multiple diagrams to do this but do not use nested packages Give the profile package a description in the Notes field e g MDG Technology for BPMN When all of the stereotypes are defined make sure that every stereotype extends at least one Metaclass right click on the profile package in the Project Browser and select the Save Package as UML Profile context menu option then proceed as usual 1 3 Quick Linker Introduction The Quick Linker provides a simple and fast way to create new elements and connectors on a diagram When an element is selected in a diagram the Quick Linker icon is displayed in the upper right corner of a element Simply clicking and dragging the icon enables you to create new connectors and elements The philosophy behind the built in Quick Linker definitions has always been to provide not a complete list of valid or legal connections but a short and convenient list of the commonest connections for the given context As part of a UML Profile you can add to or replace the built in Quick Linker definitions the following sections of this document explain how e Quick Linker Definition Format 25 e Quick Linker Example 277 e Hide Default Quick Linker Settings 28 e Quick Linker Object Names 297 Customized Quick Linker Settings A Quick Li
340. rs to retrieve model data and user interface status information Return Value Return True to enable addition of the object to the model Return False to disable addition of the object 6 5 7 5 EA_OnPreNewAttribute Details EA_OnPreNewAitribute notifies Add Ins that a new attribute is about to be created on an element lt enables Add Ins to permit or deny creation of the new attribute This event occurs when a user creates a new attribute on an element by either drag dropping from the Project Browser using the Attributes Properties dialog or using the in place editor on the diagram The notification is provided immediately before the attribute is created so that the Add In can disable addition of the attribute Also look at EA_OnPostNewAttributel 145 Syntax Function EA_OnPreNewaAttribute Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreNewAttribute function syntax contains the following elements CN CC Contains the following EventProperty Objects for the attribute a to be created 21 Type A string value corresponding to Attribute Type Stereotype A string value corresponding to Attribute Stereotype ParentID A long value corresponding to Attribute ParentID ClassifierID A long value corresponding to Attribute Classifier D Repository EA Repositor An EA Repository object representing the currently open 19A Enterprise Architect model Poll its members to retrieve model data and u
341. rto Draws a bezier curve and updates the pen position int controlpoint1x int controlpointiy int controlpoint2x int controlpoint2y int endpointx int endpointy defSize int width int height Sets the default size of the element This can appear in IF and ELSE clauses with different values in each and causes the element to be resized automatically each time the values change For example if HasTag horizontal true defSize 100 20 rectangle 0 0 100 100 else defSize 20 100 rectangle 0 0 100 100 The above example sets the shape to the specified default size each time the Tagged Value horizontal is changed When this is set Alt Z also resizes the shape to the defined dimensions Note The minimum value for both int width and int height is 10 drawnativeshape Causes Enterprise Architect to render the shape using its usual non Shapescript notation Subsequent drawing commands are super imposed over the native notation This method is only enabled for element Shape Scripts line Shape Scripts are not supported ellipse Draws an ellipse with extents defined by left top right and bottom int left int top int right int bottom endpath Ends the sequence of drawing commands that define a path fillandstrokepath Fills the previously defined path with the current fill color then draws its outline with the current pen fillpath Fills the previously defined path with the current fill
342. ry As EA Repository sLocation As String As String The EA_OnRetrieveModelTemplate function syntax contains the following elements CN CN Repository EA An EA Repository object representing the currently open Enterprise Repositor Architect model Poll its members to retrieve model data and user i interface status information 19 sLocation String IN The name of the template requested This should match the location attribute in the lt ModelTemplates gt section of an MDG Technology File For more information see the Incorporate Model Templates in a Technology topic Return Value Return a string containing the XMI export of the model that is being used as a template Example Public Function EA_OnRetrieveModelTemplate ByRef Rep As EA Repository ByRef sLocation As String As String Dim sTemplate As String Select Case sLocation Case Templates Template1 xml sTemplate My Resources Template1 Case Templates Template2 xml sTemplate My Resources Template2 Case Templates Template3 xml sTemplate My Resources Template3 Case Else MsgBox Path for 8 sLocation amp not found sTemplate End Select EA_OnRetrieveModelTemplate sTemplate End Function 6 6 Custom Views Enterprise Architect enables custom windows to be inserted as tabs in the Diagram View that appears at the center of the Enterprise Architect frame Creating a custom view 169 enables you to easily and quickly tab between a custom interface and dia
343. ry in the e shape source or shape target which are ignored by Classes or the e decoration shapes which are ignored by Associations 1 2 7 Set Default Appearance You can define the appearance of stereotyped elements and connectors as you create or edit the stereotypes 35 using the Override Appearance and Default Colors panels of the UML Types dialog However an easier way is to review your completed profile diagram and set the default appearance of the elements and connectors in place Simply click on the required element or connector and press F4 then define the background font and border colors and border thickness as appropriate on the Default Appearance dialog See the Work with Elements section in UML Modeling With Enterprise Architect UML Modeling Tool When you save the profile 177 containing the stereotyped elements and connectors make sure that you select the Color and Appearance checkbox on the Save UML Profile dialog 1 2 8 Export a UML Profile Once you have created a Profile and defined the elements and metaclasses you can save export the Profile to disk for future UML models To save a Profile follow the steps below 1 If your profile is e a single profile spread over multiple diagrams within the same Profile package find the Profile package in the Project Browser window right click on it and select the Save Package as UML Profile context menu option e one of multiple profiles within the same Pr
344. ry r new EA RepositoryClass r OpenFile c eatest eap Copy the file SSJavaCOM dll from the Java API subdirectory of your installed directory usually Program Files Sparx Systems EA into any location within the Windows PATH For example the windows system32 Enterprise Architect Software Developers Kit Enterprise Architect Object Model Using the Automation Interface 183 directory 2 Copy the eaapi jar file from the Java API subdirectory of your installed directory usually Program Files Sparx Systems EA to a location in the Java CLASSPATH or where the Java class loader can find it at run time 3 All of the Classes described in the documentation are in the package org sparx See the general library documentation 1861 for their use The following example creates and opens a repository object public void OpenRepository org sparx Repository r new org sparx Repository r OpenFile c eatest eap 7 1 1 1 Set References In Visual Basic This topic describes how to use the Enterprise Architect ActiveX interface with Visual Basic VB Use is ensured for Visual Basic version 6 This might vary slightly with versions other than version 6 It is assumed that you have accessed VB through a Microsoft Application such as VB 6 0 MS Word or MS Access If the code is not called from within Word the Word VB reference must also be set On creating a new VB project set a reference to an Enterpri
345. s e Register an Add In developed in house or brought in see the Register Add In topic in Getting Started with Enterprise Architect e The Add In Manager 128 6 1 1 Create Add Ins Before you start you must have an application development tool that is capable of creating ActiveX COM objects supporting the IDispatch interface such as e Borland Delphi e Microsoft Visual Basic e Microsoft Visual Studio Net You should consider how to define menu items 124 To help with this you could review some examples of Automation Interfaces this web page provides examples of code used to create Add Ins for Enterprise Architect Create an Add In An Enterprise Architect Add In can be created in four steps 1 Use a development tool to create an ActiveX COM DLL project Visual Basic users for example choose File Create New Project ActiveX DLL 2 Connect to the interface using the syntax appropriate to the language as detailed in the Connecting to the Interface tsh topic 3 Create a COM Class and implement each of the general Add In Events 129 applicable to your Add In You only have to define methods for events to respond to 4 Add a registry key that identifies your Add In to Enterprise Architect as described in the Deploying Add Ins 1251 topic 6 1 1 1 Define Menu Items Menu items are defined by responding to the GetMenultems event The first time this event is called MenuName is an empty string representing the top lev
346. s Type Enum Effort types that have been defined for the Enterprise List EffortTypes Architect model MaintenanceType Type Enum Maintenance types that have been defined for the List MaintenanceTypes Enterprise Architect model ObjectTypes Type Enum Object types that have been defined for the Enterprise List ObjectTypes Architect model Phases Type Enum Phases that have been defined for the Enterprise Architect List Phases model ProblemTypes Type Enum Problem types that have been defined for the Enterprise List ProblemTypes Architect model RoleTypes Type Enum Role types that have been defined for the Enterprise List RoleTypes Architect model RequirementType Type Enum Requirement types that have been defined for the List RequirementTypes Enterprise Architect model Type Enum Resources that have been defined for the Enterprise Enterprise Architect Software Developers Kit Tagged Value Types Predefined Reference Data Types 85 Tagged Value Drop Down List Returned Type RiskTypes Type Enum Risk types that have been defined for the Enterprise List RiskTypes Architect model RTFTemplates Type Enum RTF Templates that have been defined for the Enterprise List RTFTemplates Architect model ScenarioTypes TestTypes Type Enum List ScenarioTypes Type Enum List TestTypes 4 4 Create Reference Data Tagged Values Scenario types that have been defined for the Enterprise Archite
347. s are exported as Property Types See UML Model Management 4 1 Predefined Structured Types This table details the predefined structured Tagged Value types along with the syntax used to create the initial values for their use You use these to create your own structured Tagged Values 83 Note Tagged Value Type and Format entries are case sensitive Boolean Type Boolean Enables input of True or False either of which can be Default Val the default value Classifier Type Classifier Deprecated Use RefGUID and RefGUIDList Values Type1 Type2 Stereotypes Stereotype 1 Returns the name of a user selected element from the model where Type1 and Type2 specify one or more allowed element types and Stereotype1 represents an allowed stereotype Type Color Enables input of a color value from a color chooser Default Val menu where the value is the decimal integer translation of the color s Hex RGB value For example the RGB for Red is FF and the decimal value is 255 Const Type Const Enables creation of a read only constant value Default Val Custom Type Custom Enables you to create your own template for predefined types more information is provided in the Create Custom Tagged Value Typel 86 topic DateTime Type DateTime Enables input of the date and time for the Tagged Value from a calendar menu Directory Type Directory Enables entry of a directory path from a browser Deraultaval You can set a default direct
348. s in the Create MDG Technologies 301 topic up to and including Step 6 33 where you select the Scripts checkbox The MDG Technology Wizard Scripts dialog displays 1998 2010 Sparx Systems Pty Ltd 44 MDG Technologies in SDK Create MDG Technologies MDG Technology Wizard Scripts Select the scripts to be included in this technology Language M Java Script JavaScript 2 For each required script available in the current model select the checkbox next to the script name 3 Click on the Next button to proceed 2 1 11 Add RTF Report Templates When creating an MDG Technology file you can include user defined RTF Report templates To use the report templates section of the MDG Technology Wizard follow the steps below 1 Follow the steps in the Create MDG Technologies 301 topic up to and including Step 6 33 where you select the RTF Templates checkbox The MDG Technology Wizard RTF Report Templates dialog displays Enterprise Architect Software Developers Kit MDG Technologies in SDK Create MDG Technologies 45 MDG Technology Wizard RTF Report Templates Select the RTF report templates to be included in this technology Balanced Score Card Base Template copy Basic Template _ basic template with tags build_resolved CodeReport Template Elements by Build image_test Nesting Test protected text style
349. s particular menu option String The name of the option actually clicked for example Create a New Invoice MenuLocation String String representing the part of the user interface that brought up the menu Can be TreeView MainMenu or Diagram String The name of the parent menu for which sub items must be defined In the case of the top level menu it is an empty string Repository An EA Repository object representing the currently open a Enterprise Architect model Poll its members to retrieve model 197 data and user interface status information Return Value None 6 4 5 EA_MenuClick Details EA_MenuClick events are received by an Add In in response to user selection of a menu option The event is raised when the user clicks on a particular menu option When a user clicks on one of your non parent menu options your Add In receives a MenuClick event defined as follows Sub EA_MenuClick Repository As EA Repository ByVal MenuName As String ByVal ItemName As String The code below illustrates an example of use If MenuName amp Diagram And ItemName amp Properties then MsgBox Repository GetCurrentDiagram Name vbInformation Else MsgBox Not Implemented vbCritical End If Notice that your code can directly access Enterprise Architect data and UI elements using Repository 1961 methods Also look at EA_GetMenultems 13h Syntax Sub EA_MenuClick Repository As EA Repository MenuLocation As String MenuName As
350. s ve Code Template Syntax 106 Transition 111 Create Trigger 111 Add In 124 TENER 2 Custom Tagged Values 86 Color Query O 1998 2010 Sparx Systems Pty Ltd 300 Index Create Custom View Add In Model 169 Hidden Submenu In Toolbox Profile Masked Tagged Values 86 MDG Technologies 30 Profiles 5 Reference Data Tagged Values Structured Tagged Values 83 Tasks Pane Profiles 54 Toolbox Profile For MDG Technology 47 UML Profiles 5 CreateBaselineFlag Enum 48 85 Automation Interface 192 CreateModelType Enum Automation Interface 192 CTF InSDK 88 Custom Diagram Types 52 Stereotypes 3 Custom Language Create Templates For In Code Template Editor 122 Custom Tagged Values Create 86 Custom View Add In Model 169 CustomProperties Collection Automation Interface ElementFeatures Package 248 D Datatype Automation Interface Repository 213 Default Templates 120 Default Appearance Set For Profile Stereotype Objects 17 Default Templates Override in Code Template Editor 120 Default Toolbox Override In Profile Define Stereotype As Metatype 21 49 Stereotype Constraints 12 Tasks Pane Contexts 57 Tasks Pane Toolbox 55 Validation Configuration For MDG Technology 58 Define Menu Items Create Add In 124 Deploy Add In 125 MDG Technology From Add In MDG Technology From File Diagram Add And Manage Automation Interface Code Example 287 Automation Interface Diagram Package Defi
351. script Shuts down Enterprise Architect immediately Used by NET programmers where the garbage collector does not immediately release all referenced COM objects GetActivePerspective Deprecated no longer in use GetAttributeByGuid string Attribute Guid 2447 GetAttributeByID string Id GetConnectorByGuid string Connector Guid GetContextltem object Item ObjectTyp ctT GetContexiltemType e En 2577 GetConnectorByID long Connector ConnectorlD 257 elto Obje 1951 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 e Guid String the GUID of the attribute to locate Returns a pointer to an attribute in the repository located by its ID This is usually found using the AttributelD property of an attribute Parameters e ld String the ID of the attribute to locate 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 e Guid String the GUID of the connector to locate Searches the repository for a connector with a specific ID Parameters e ConnectorlD Long the ID of the connector to locate Sets a pointer to an item in context within Enterprise Architect Also returns the corresponding ObjectType For additional information about Contextltems and the supported ObjectTypes
352. se Architect Type Library and a Word Type Library Follow the steps below 1 Select the Tools References menu option The following dialog displays Available References Y Visual Basic For Applications Cancel Y Visual Basic runtime objects and procedures Y Visual Basic objects and procedures v OLE Automation Browse Y Microsoft Word 10 0 Object Library el Microsoft Project 9 0 Object Library 145 Helper COM Component 1 0 Type Library Priority 145 RADIUS Protocol 1 0 Type Library 3D FTP Transfer Engine COM Object y 1 VideoSoft YSFlexGrid 7 0 Light Acrobat Access 2 0 Type Library AcrolEHelper 1 0 Type Library a Artive DS TS Extension Dil _ Ad ia leemmnnanennssesssiniUhsemssnnsemistia a Enterprise Architect Object Model 2 02 A Help elet Location C Program Files Sparx Systems EA E4 TLB Language Standard 2 Select the Enterprise Architect Object Model 2 10 checkbox from the list 3 Do the same for VB or VB Word select the checkbox for the Microsoft Word 10 0 Object Library 4 Click on the OK button Note If Enterprise Architect Object Model 2 10 does not appear in the list go to the command line and manually re enter Enterprise Architect using the following e To unregister Enterprise Architect ea exe unregister e To register Enterprise Architect ea exe register Visual Basic 5 6 users should also note that the version number of the Enterprise Architect interface is stored in
353. se is returned check the GetLastError function for more information A ConnectorEnd contains information about a single end of a connector A ConnectorEnd is accessed from the connector as either the ClientEnd or SupplierEnd Associated table in EAP file derived from t_connector ConnectorEnd Attributes Pato ea Rates Aggregation Long Read Write Aggregation as it applies to this end Valid values are 0 None 1 Shared 2 Composite Alias String Read Write An optional alias for this connector end AllowDuplicates Read Write For multiplicities greater than 1 indicates that duplicate Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 261 jatribute tye Notes OOOO Co DerivedUnion Boolean Read Write Indicates the value of this role derived from the union of all roles that subset this String Read only The end this ConnectorEnd object applies to Client or Supplier IsChangeable String Read Write Flag indicating whether this end is changeable or not Values frozen addOnly or none IsNavigable Read Write Flag indicating this end is navigable from the other end Navigable String Read Write Indicates whether this role of an association is navigable from the opposite classifier Three values are valid Navigable Non Navigable and Unspecified ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch 1937 interface Read
354. ser interface status information Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 145 Return Value Return True to enable addition of the new attribute to the model Return False to disable addition of the new attribute 6 5 7 6 EA_OnPreNewMethod Details EA_OnPreNewMethod notifies Add Ins that a new method is about to be created on an element lt enables Add Ins to permit or deny creation of the new method This event occurs when a user creates a new method on an element by either drag dropping from the Project Browser using the method Properties dialog or using the in place editor on the diagram The notification is provided immediately before the method is created so that the Add In can disable addition of the method Also look at EA _OnPostNewMethodl4 Syntax Function EA_OnPreNewMethod Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreNewMethod function syntax contains the following elements CN CC Contains the following EventProperty Objects for the method to E be created 21 EN ReturnType A string value corresponding to Method ReturnType Stereotype A string value corresponding to Method Stereotype ParentID A long value corresponding to Method Parent D ClassifierID A long value corresponding to Method ClassifierID Repository EA Repository 197 An EA Repository object representing the currently
355. sing the _metatype attribute It is shown on the Paste Element dialog see the Work with Diagrams section in UML Modeling With Enterprise Architect UML Modeling Tool and is translated if it matches an Enterprise Architect element type The _instanceMode attribute is applied to a stereotype element and controls the text in the Paste Element dialog after being translated Valid values are instance and property with the default being instance The _instanceOwner attribute is applied to a stereotype element and controls the text in the Paste Element dialog It is translated if it matches an Enterprise Architect element type The default value is Element The following example from SysML shows that when an instance of a Block is created it is created as a BlockProperty element ametscisss Class extends _instanceMode string property _instanceType sting BlockProperty Enterprise Architect Software Developers Kit Developing Profiles Create Profiles 23 1 2 9 4 Create Composite Elements The _makeComposite attribute is applied to a metaclass element not a stereotype element It defines whether an element is always made composite when created Notes e A stereotyped package is not by default created with a child diagram so you should use the _makeComposite attribute to ensure the child diagram is created e Unless you also use the _defaultDiagramType attribute to define the child diag
356. ssociated with attribute or method types It typically is related to either code engineering or database modeling Datatypes also indicate which language or database system they relate to Accessed using the Repository Datatypes collection Associated table in EAP file t_datatypes Datatype Attributes CA Notes O DatatypelD Long Read Write Instance ID for this datatype within the current model System maintained CON A ETT CSC tow ETE String Read Write The datatype name such as integer This appears in the related drop down datatype lists where appropriate ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch 1937 interface Product Sting Read Write The datatype product such as Java C Oracle Size tom Read Write The datatype size Type String Read Write The type can be DDL for database datatype or Code for language datatypes UserDefined Long Read Write Indicates if datatype is a user defined type or system generated Datatypes distributed with Enterprise Architect are all system generated Datatypes created in the Datatype dialog are marked 1 true Datatype Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Updates the current Datatype object after modification or appending a new item 1998 2010
357. stom template 1 e lt lt Separator gt gt is a list separator such as n e lt lt indent gt gt is any indentation to be applied to the result e lt lt owner gt gt is the ID of the object that contains the required collection e lt lt CollectionName gt gt is the name of the required collection e lt lt OPTION1 gt lt lt OPTION99 gt gt are miscellaneous options that might be passed on the template each option is given as an additional input parameter to the template e result is the resultant value this is if not a valid collection Example sStates EASLList State separator n indent t owner StateMachineGUID collection States option sOption Behavioral Model Templates e Action e Action Assignment e Action Break e Action Call e Action Create e Action Destroy e Action If e Action Loop e Action Opaque e Action Parallel e Action RaiseEvent e Action RaiseException e Action Switch e Behavior e Behavior Body e Behavior Declaration e Behavior Parameter e Call Argument e Guard e Property Object e Property Declaration e Property Notes e State e State CallBack e State Enumerate e State EnumeratedName e StateMachine e StateMachine HistoryVar e Transition e Transition Effect e Trigger Enterprise Architect Software Developers Kit Code Template Framework in SDK Code Template Syntax 111 5 1 2 6 1 EASL Collections This topic
358. straints of all elements created from them see Extending UML With Enterprise Architect Toolbox Page Attributes The following attributes can be added to a stereotype Class that extends the ToolboxPage metaclass e ImagesOnly if you give a toolbox page an attribute named imagesOnly with Initial Value set to true the toolbox page displays without the text labels next to the icons e isCommon if you give a toolbox page an attribute named sCommon with Initial Value set to true the toolbox page is common to all defined toolboxes while your technology is active the page is initially displayed as collapsed e isCollapsed if you give a toolbox page an attribute named sCollapsed with Initial Value set to true the toolbox page is initially minimized e Icon see Icons for Toolbox Items 495 isHidden see Create Hidden Sub Menus 487 2 3 2 Create Hidden Sub Menus To create a sub menu create an additional stereotype element in the same toolbox profile and give it an attribute named isHidden with Initial Value of true Define the toolbox item attributes as before In the parent stereotype element create an attribute with the identical name to the sub menu element The sub menu element can have an alias This technique is very useful for disambiguating stereotypes that can be applied to multiple metaclasses In the example below the MyStereo stereotype can be applied to either a Class or an Interface On dragging and dropping on
359. syntax contains the following elements Prana owe CT CN Repository EA An EA Repository object representing the currently open Repositor Enterprise Architect model Poll its members to retrieve model s data and user interface status information 19 PackageGui String IN The GUID identifying the Enterprise Architect package sub tree d that is controlled by the Add In FilePaths String array IN An array of filepaths pointed to the files that are to be reverse engineered Enterprise Architect Software Developers Kit Enterprise Architect Add In Model MDG Add ins 179 Return Value None 6 7 1 13 MDGRunExe Details MDG_RunExe enables the Add In to run the target application This function is called when the user selects the Add Ins Run Exe menu option Respond to this event by launching the compiled application Also look at MDG BuildProject 17 Syntax Sub MDG_RunExe Repository As EA Repository PackageGuid As String The MDG_RunExe function syntax contains the following elements CN CC Repository An EA Repository object representing the currently open Repository Enterprise Architect model Poll its members to retrieve model data and user interface status information O String The GUID identifying the Enterprise Architect package sub tree that is controlled by the Add In Return Value None 6 7 1 14 MDGView Details MDG_ View enables the Add In to display user specified code elem
360. t MDG Technologies in SDK Create MDG Technologies 33 5 Complete the fields on this screen as follows Technology Type the name of the MDG Technology Type or select the path and filename of the MDG Technology File the file extension for this file is xml Do Type a reference for the MDG Technology File up to 12 characters long Type the version number of the MDG Technology File Optional Type or select the path and file name of the graphics file containing the technology icon The icon is a 16x16 bitmap image that is shown in the list of technologies on the left of the MDG Technologies dialog Optional Type or select the path and file name of the graphics file containing the technology logo The logo is a 64x64 bitmap image that is shown in the display pane on the top right corner of the MDG Technologies dialog Optional If you have any website product information that might be helpful for users of this Technology type or paste the URL in this field Optional If you have any web based or other support facility that might be helpful for users of this Technology type or paste the contact address in this field Type a short explanation of the functionality of the MDG Technology 6 Click on the Next button The MDG Technology Wizard Contents screen displays MDG Technology Wizard Contents Select the information to be included in your technology Metamodel Code v Profiles Code Modules
361. t EA_Onlnitialize Technologies My Resources MyTechnology End Function 6 5 12 2 EA_OnPreActivate Technology Details EA_OnPreActivate Technology notifies Add Ins that an MDG Technology resource is about to be activated in the model This event occurs when a user selects to activate an MDG Technology resource in the model by clicking on the Set Active button on the MDG Technologies dialog see Extending UML With Enterprise Architect or by selecting the technology in the list box in the Default Tools toolbar see Using Enterprise Architect UML Modeling Too The notification is provided immediately after the user attempts to activate the MDG Technology so that the Add In can permit or disable activation of the Technology Also look at EA_OnPostActivate Technology 153 Syntax Function EA_OnPreActivateTechnology Repository As EA Repository Info As EA EventProperties As Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 153 Boolean The EA_OnPreActivate Technology function syntax contains the following elements COC CCT CT EA EventProperties Contains the following EventProperty objects for the MDG 214 Technology to be activated e TechnologyID A string value corresponding to the MDG Technology ID Repository 4 Repositoryl19 An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model da
362. t Object Model Reference jasoute ve fates Swimlanes Read Write A list of individual swimlanes 270 7 2 8 5 Swimlanes A Swimlanes object is attached to a diagram s SwimlaneDef 263 object and provides a mechanism to access individual swimlanes Swimlanes Attributes Attribute type Notes Read Write Gives the number of swimlanes ObjectType 193 ObjectType Read only Distinguishes objects referenced through a Dispatch interface Swimlanes Methods Add string Title Swimlane 27 Adds a new swimlane to the end of the list Returns a swimlane object long Width representing the newly added entry Parameters e Title String The title text that appears at the top of the swimlane Can be the same as an existing swimlane title e Width Long The width of the swimlane in pixels Delete object Deletes a selected swimlane Index If the string matches more than one entry only the first entry is deleted Parameter e Index Object Either a string representing the title text or an integer representing the zero based index of the swimlane to delete DeleteAll Removes all swimlanes Insert long Swimlane 274 Inserts a swimlane at a specific position Returns a swimlane object Index string representing the newly added entry Title long Width Parameters Index Long The zero based index of the existing Swimlane before which this new entry is inserted Title String The title
363. t Package 239 ScenarioDiagramType Enum 194 ScenarioExtension Element Package 240 ScenarioStep Element Package 241 ScenarioStepType Enum 195 ScenarioTestType Enum 195 Set Up Visual Basic 183 Swimlane Diagram Package 271 SwimlaneDef Diagram Package 269 Swimlanes Diagram Package 270 TaggedValue Element Package 242 Test Element Package 243 Transitions Collection ElementFeatures Package 255 Using 181 VB GetObject Support 190 XMIType Enum 195 Available Resources Automation Interface 186 B Behavioral Model Templates 109 Branching Macros Code Template Syntax 106 Broadcast Event Add In Model 135 EA FileClose 136 EA FileNew 136 EA FileOpen 135 EA_OnPostCloseDiagram 137 EA OnPosilnitialized 151 EA_OnPostOpenDiagram 137 EA OnPostTransform 151 Enterprise Architect Software Developers Kit Index 299 Broadcast Event Shape Scripts 72 EA_OnPreExitinstance 146 COM Object EA _OnRetrieveModelTemplate 168 NET Garbage Collect Exit Method 197 Built In Compartment Events Diagram Types 53 Add In Model 158 EA_GetCompartmentData 159 C EA_QueryAvailableCompartments 158 Composite Elements Metaclass Create With Supported Attributes Call 23 eee Interface From Enterprise Architect Concurrent Method Calls CLASSGUID In Add Ins 126 Add In Hidden Field 128 Conditional Substitution CLASSTYPE E Substitution Macros Code Template Syntax Add In Hidden Field 128 Connect Client Collection To Automation Interfa
364. t a Package has an Element object as an attribute this corresponds to an Enterprise Architect Package element in the t_object table and is used to associate additional information such as scenarios and constraints with the logical package To set additional information for a package reference the Element object directly Also note that if you add a Package to a diagram you should add an instance of the element not the Package itself to the DiagramObjects collection for a diagram Associated table in EAP file t_package Package Attributes woe fetes BatchLoad Long Read Write Flag to indicate that the package is batch loaded during batch import from controlled packages Not currently used BatchSave Long Read Write Boolean value to indicate whether the package is included in the batch XMI export list or not CodePath String Read Write The path to where associated source code is found Not currently used Connectors Collection Read only Collection of connectors 21 Read Write Date the package was created O 1998 2010 Sparx Systems Pty Ltd 216 Enterprise Architect Object Model Reference jatribute pe notes Diagrams Collection Read only A collection of diagrams contained in this package 21h Elementl2285 Read only The associated element object Use to get set common information such as Stereotype Complexity Alias Author Constraints Tagged Values and Scenarios Collection Read only A col
365. ta and user interface status information Return Value Return True to enable activation of the MDG Technology resource in the model Return False to disable activation of the MDG Technology resource 6 5 12 3 EA_OnPostActivateTechnology Details EA_OnPostActivate Technology notifies Add Ins that an MDG Technology resource has been activated in the model This event occurs when a user activates an MDG Technology resource in the model by clicking on the Set Active button on the MDG Technologies dialog see Extending UML With Enterprise Architect or by selecting the technology in the list box in the Default Tools toolbar see Using Enterprise Architect UML Modeling Tool The notification is provided immediately after the user succeeds in activating the MDG Technology so that the Add In can update the Technology if necessary Also look at EA_OnPreActivate Technology 152 Syntax Function EA_OnPostActivateTechnology Repository As EA Repository Info As EA EventProperties The EA_OnPostActivateTechnology function syntax contains the following elements CIC CE oom Ei E EA EventProperties Contains the following EventProperty objects for the MDG 214 Technology to be activated e TechnologyID A string value corresponding to the MDG Technology ID Repository 4 Repositoryl19 An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface stat
366. ta is appropriate Read write The value of the property as defined in the other fields 7 2 6 12 Transitions public Collection Applies only to Timeline elements A Timeline element displays 0 or more state transitions at set times on its extent This collection enables you to access the transition set You can also access additional information by referring to the connectors associated with the Timeline and by referencing messages passed between timelines Note that any changes made to elements in this collection are only saved when the main element is saved Transition Attributes A DurationConstra Read Write A constraint on the time duration that the transition takes int Event string Read Write Event optional that initiated transition Note Sting Read Write A free text note ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface TimeConstraint Read Write A constraint on when the transition has to be complete by TxState String Read Write The state to transition to Defined in the Timeline Properties dialog TxTime String Read Write The time that the transition occurs Value depends on range set in diagram 7 2 7 Connector public Package The Connector package details how connectors between elements are accessed and managed O 1998 2010 Sparx Systems Pty Ltd 256 Enterprise Architect Object Model Reference ConnectorConstraint Connector
367. te A globally unique ID for this Tagged Value TaglD Read only Local ID to identify Tagged Value Value String Read Write The value assigned to this tag This field has a 255 character limit If the value is greater than 255 characters long set the value to lt memo gt and insert the body of text in the Notes attribute above When reading existing Tagged Values if Value lt memo gt then the developer should read the actual body of text from the Notes attribute AttributeTag Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current AttributeTag object after modification or appending a new item If false is returned check the GetLastError function for 1998 2010 Sparx Systems Pty Ltd 248 Enterprise Architect Object Model Reference merca mo foies 7 2 6 4 CustomProperties public Collection The CustomProperties collection contains 0 or more Cust Properties associated with the current element These properties provide advanced UML configuration options and must not be added to or deleted The value of each property can be set Note The number and type of properties vary depending on the actual element CustomProperty Attribute type woes Cs Name String Read only The CustomProperty name Object
368. te a MTS file select the Tools Generate MDG Technology File menu option to launch the MDG Technology Wizard and work through the screens as described in Create MDG Technologies 30 On the second page select the Create a new MTS file option Advanced Options For Your MTS File Once you have created the MTS file you can add Model Search definitions see Using Enterprise Architect UML Modeling Tool Note If you use a custom SQL search the SQL must include ea_guid AS CLASSGUID and the object type Model Views see Using Enterprise Architect UML Modeling Tool Notes e Technology views do not store Favorite packages only Views e f your exported views run searches that you have defined you must also include those searches in your MDG Technology Model Validation configurations 58 Model Templates 59 Enterprise Architect Software Developers Kit MDG Technologies in SDK Working with MTS Files 47 Open the MTS file in a text editor To make it easier for you you can copy the following lines and paste them into the file before the last line of the file that is just before the lt MDG Selections gt lines lt ModelSearches file gt lt ModelViews file gt The code for the model validation configurations and model templates is provided in the corresponding sections accessed via the links in the list above You can if necessary have more than one line for each inclusion for exa
369. te a ehenodeeeee EA QnRun Diagram Rule ica A A a Wain eA as EA OnRunComectorR le cian EA OnRunAttribute Rule iniciada EA OnRunMethodRuleveniiiotaiaais AAA NAAA EA OnRunParameterRUlSiviiai e ia Model Validation Example cocinada in a vda EA_OnRetrieveModelTemplate coocccococoocccoonnnananononnnonnnnonononncnonnnnonnnon cnn nnnnnnnnnnrnnennnnnn arras nnnannnnnnnnnnss CUSTOM VIEWS E T cincedocczsareisccseasesssocseitexvadesvnes sensinesvnedesdouisdtecvscncevatesdecs addeuseetsduecsiessecbessuschvauereseiesdste Create a Custom View ER MDG Add Ins E ii A A A A MDG EVENTS SAINAI AE E EE E E E A AA aa cuchusduesundeecandsasdeuscuseudess S EEE EE EENAA AA MDGBuild Project BIE e E TE E E E E MDGDisconnet iison e Wve iode ad e a a a e ae aki dina anaes MDGGetConnectedPackages cessecceseessesceesecenecseceseceeesaeeeaeseneeaeeeaesseeeaeeaesaeeeaeeaeseeeaeeeaeeaeees MDGGetPropetty acter anitantesen aida paar MDGWMerge MDGNewClass MDGRostGenerate mucosidad dade rhode een een sails MDGPOStME le c cocoa ARA lia ENDS MDGPreGenerates sica A AAA AAA MDGPreMerge isin a a ds ina MDGPTeReVerSO oia ties MDGRUNEXE vitro A td MDGView Enterprise Architect Object Model oonnonnnnnicninnconanacononicinncan nara nano rana rar Using the Automation Interface ie Connect to the Interface A A A a beat A ADA Set References In Visual Basic Examples and Tips eer eeen e eaa a ee eaea daaa se eard a
370. tect Add Ins can respond to requests to create new elements connectors objects attributes methods and packages using the following broadcast events e EA OnPreNewElement 14h e EA OnPreNewConnector 142 e EA OnPreNewDiagram 143 e EA OnPreNewDiagramObject 143 e EA OnPreNewAttributel144 e EA OnPreNewMethodl145 e EA OnPreNewPackage 115 6 5 7 1 EA_OnPreNewElement Details EA_OnPreNewElement notifies Add Ins that a new element is about to be created on a diagram It enables Add Ins to permit or deny creation of the new element This event occurs when a user drags a new element from the Enterprise Architect UML Toolbox or Resources window onto a diagram The notification is provided immediately before the element is created so that the Add In can disable addition of the element Also look at EA_OnPostNewElementl147 1998 2010 Sparx Systems Pty Ltd 142 Enterprise Architect Add In Model Broadcast Events Syntax Function EA_OnPreNewElement Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreNewElement function syntax contains the following elements pr prime o oO Contains the following EventProperty Objects for the element to a ans be created 21 Type A string value corresponding to Element Type Stereotype A string value corresponding to Element Stereotype ParentID A long value corresponding to Element ParentID DiagramID A long value corresponding to the
371. tect to update the Repository with the LastUpdate value String Read only The identifier string identifying the Enterprise Architect runtime session O 1998 2010 Sparx Systems Pty Ltd 198 Enterprise Architect Object Model Reference CET E E IsSecurityEnabled Boolean Read only Checks whether User Security is enabled for the current repository Collection 2i4 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 Read only The build number of the Enterprise Architect runtime Collection Read only Models are of type package and belong to a of type collection of packages This is the top level entry point to Packagel215 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 ObjectType Read only Distinguishes objects referenced through the ProjectGUID Read on
372. tedElements 2 5 1 2 Run Add In Functions To run Add In functions from the Tasks Pane you create an attribute in the Tasks Pane stereotype Class with the following format Assembly FunctionName where Assembly is the name of the Add In and FunctionName is the name of a public function in the Add In Give the attribute an initial value of the text that is to appear in the Tasks Pane The function receives two parameters and returns a success status as in the following VB Net example Public Function ShowMyDiagram ByRef Repository As EA Repository ByVal args As Object As String Dim ret As String ret Repository SQLQuery select ea_guid from t_diagram where diagram_type Custom and StyleEx like MDGDgm MyDiagrams MyCustomDiagram If ret Is Nothing Then ShowMyDiagram False Exit Function End If Dim oXML As MSXML2 DOMDocument New MSXML2 DOMDocument OXML loadXML ret Dim NodeList As MSXML2 IXMLDOMNodeList oXML selectNodes ea_guid If NodeList length 0 Then ShowMyDiagram False Exit Function End If Enterprise Architect Software Developers Kit MDG Technologies in SDK Create Tasks Pane Profiles 57 Dim Node As MSXML2 IXMLDOMNode Dim diag As EA Diagram If NodeList length gt 1 Then Node NodeList item 0 diag Repository GetDiagramByGuid Node text Repository OpenDiagram diag DiagramID Repository ShowInProjectView diag End If ShowMyDiagram True End Function 2
373. the XMI file Note If the String is of type filename it is interpreted as a source file otherwise the String is imported as XML text e ImportDiagrams Long e StripGUID Long boolean value to indicate whether to replace the element UniquelDs on import if stripped then a package could be imported twice into Enterprise Architect as two different versions 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 1998 2010 Sparx Systems Pty Ltd 280 Enterprise Architect Object Model Reference DiagramGUID String the GUID in XML format of the diagram to lay out LayoutStyle Long always ignored LayoutDiagramEx string Boolean Calls the function to automatically layout a diagram in DiagramGUID long hierarchical fashion It is only recommended for Class LayoutStyle long Iterations and Object diagrams long LayerSpacing long ColumnSpacing boolean SaveToDiagram LayoutStyle accepts the following options also see ConstLayoutStyles Enuml19 e Default Options IsDiagramDefault IsProgramDefault Cycle Removal Options IsCycleRemoveGreedy IsCycleRemoveDFS Layering Options IsLayeringLongestPathSink IsLayeringLongestPathSource IsLayeringOptimalLinkLength Initialize Options IsInitializeNaive IsInitializeDFSO ut IsIn
374. the Code Samples folder under your Enterprise Architect installation default C Program Files Sparx Systems EA Code Samples e Enterprise Architect can be set up to call an external application 1851 e Several VB NET code snippets are provided in the reference section 28 e A comprehensive example of using Visual Basic to create MS Word documentation is available from the internet at www sparxsystems com resources developers autint_vb html e Additional samples are available from the Sparx Systems website see the Available Resources 18 topic Additionally you should note the following tips and tricks e An instance of the Enterprise Architect EA exe process is executed when you initialize a new repository object This process must remain running in order to perform automation tasks If the main window is visible you can safely minimize it but it must remain running e The Enterprise Architect ActiveX Interface is a functional interface rather than a data interface When you load data through the interface there is a noticeable delay as Enterprise Architect user interface elements such as Windows menus are loaded and the specified database connection is established e Collections use a zero based index for example Repository Models 0 represents the first model in the Enterprise Architect Software Developers Kit Enterprise Architect Object Model Using the Automation Interface 185 repository e During t
375. the application being called To define an application that you can run from Enterprise Architect select the Tools Customize menu option The Customize dialog displays Select the Tools tab Commands Toolbars Tools Keyboard Menu Options Menu contents Adobe CustAcc Wordpad CustAcc VB Autint Command C Program Files Aut Int EA Aut Int exe Arguments Sf Sp Initial directory c Program Files Autint al With this you can e Add a command line for an application e Define parameters to pass to this application The parameters required for running the AutInt executable are e The Enterprise Architect file parameter f and e The current PackagelD p O 1998 2010 Sparx Systems Pty Ltd 186 Enterprise Architect Object Model Using the Automation Interface 7 1 2 2 Hence the arguments should simply contain f p The available parameters for passing information to external applications are CCT CN ECONO COCO orang aonanosagam o foams oub raosang ne ascaovaauem COM CIAT MEN Comma separated list of element All elements selected in the current diagram GUIDs CI Project Name For example C projects EAexample eap Calling Application Enterprise Enterprise Architect Architect sp Current Package ID For example 144 E Package GUID GUID for accessing this package Once this has been set up the application can be called from the main men
376. the filter condition isn t met A Quick Linker definition has the following fields CN CN Source Element The row is ignored unless a connector is being dragged away from this Type type of element Source Stereotype If set the row is ignored unless a connector is being dragged away from Filter an element with this stereotype Target Element Type If set the row is ignored unless a connector is being dragged onto this type of element If blank the row is ignored unless a connector is being dragged onto an O 1998 2010 Sparx Systems Pty Ltd 26 Developing Profiles Quick Linker CoN CN Target Stereotype If set and Target Element Type also set the row is ignored unless a Filter connector is being dragged onto an element with this stereotype Diagram Filter Contains either an inclusive or exclusive list of diagrams which limits the diagrams the given kind of connector can be included on Each diagram name is terminated by a semi colon Excluded diagram names are preceded by an exclamation mark Example of an inclusive list Collaboration Object Custom Example of an Exclusive list Sequence F New Element Type If set and Create Element also set results in the creation of an element of this type New Element If set and Create Element also set results in the creation of an element Stereotype with this stereotype New Link Type If set and Create Link also set results in the creation of a connecto
377. the user to save unsaved source files Also look at MDG _PostGenerate 176 Syntax Function MDG_PreGenerate Repository As EA Repository PackageGuid As String As Long The MDG_PreGenerate function syntax contains the following elements pee pe CC Repository An EA Repository object representing the currently open Feposion Enterprise Architect model Poll its members to retrieve model data and user interface status information PackageGuid String The GUID identifying the Enterprise Architect package sub tree that is controlled by the Add In Return Value Return a zero value to abort generation Any other value enables the generation to continue 6 7 1 11 MDGPreMerge Details MDG_PreMerge is called after a merge process has been initiated by the user and before Enterprise Architect performs the merge process 1998 2010 Sparx Systems Pty Ltd 178 Enterprise Architect Add In Model MDG Add Ins This event is called after a user has performed their interactions with the merge screen and has confirmed the merge with the OK button but before Enterprise Architect performs the merge process using the data provided by the MDG_Merge call before any changes have been made to the model or the connected project This event is made available to provide the Add In with the opportunity to generally set internal Add In flags to augment the MDG_PreGenerate MDG_PostGenerate and MDG_PreReverse events Note File sa
378. through the Connector Constraints collection Associated table in EAP file t_connectorconstraints ConnectorConstraint Attributes Patti yee ee AAA Read Write A local ID value long system generated Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 257 Atribute Type Noss Name Sting Read Write The constraint name Notes Sting Read Write Notes about this constraint ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 19 Read Write The constraint type ConnectorConstraint Methods GetLastError Returns a string value describing the most recent error that occurred in relation 0 to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current ConnectorConstraint object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 7 2 Connector public Class A Connector object represents the various kinds of connectors between UML elements lt is accessed from either the Client or Supplier element using the Connectors collection of that element When creating a new connector you must assign it a valid type from the following list Aggregation Assembly Association Collaboration CommunicationPath Connector ControlFlow Delegate Dependency Deployment ERLink Genera
379. tification is provided immediately before the method is deleted so that the Add In can disable deletion of the method Syntax Function EA_OnPreDeleteMethod Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreDeleteMethod function syntax contains the following elements PAPAS Contains the following EventProperty Objects for the method to ens be deleted 21 e MethodID A long value corresponding to Method MethodID Repositor EA Repository An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True to enable deletion of the method from the model Return False to disable deletion of the method 6 5 6 4 EA_OnPreDeleteConnector Details EA_OnPreDeleteConnector notifies Add Ins that a connector is to be deleted from the model It enables Add Ins to permit or deny deletion of the connector This event occurs when a user attempts to permanently delete a connector on a diagram The notification is O 1998 2010 Sparx Systems Pty Ltd 140 Enterprise Architect Add In Model Broadcast Events provided immediately before the connector is deleted so that the Add In can disable deletion of the connector Syntax Function EA_OnPreDeleteConnector Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreDeleteConnector function sy
380. tion Return Value None 6 5 13 2 EA_OnContextltemDoubleClicked Details EA_OnContextltemDoubleClicked notifies Add Ins that the user has double clicked the item currently in context This event occurs when a user has double clicked or pressed Enter on the item in context either in a diagram or in the Project Browser Add Ins to handle events can subscribe to this broadcast function Also look at EA_OnContextltemChangedl155 and EA_OnNotifyContextltemModified 1571 Syntax Function EA_OnContextltemDoubleClicked Repository As EA Repository GUID As String ot as EA ObjectType The EA_OnContextltemDoubleClicked function syntax contains the following elements Ce ore Jor CTN String IN Contains the GUID of the new context item This value corresponds to the following properties depending on the value of the ot Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 157 aaraa CTN parameter ot ObjectType GUID value otElement Element ElementGUID otPackage Package PackageGUID otDiagram Diagram DiagramGUID otAttribute Attribute AttributeGUID otMethod Method MethodGUID otConnector Connector ConnectorGUID EA Specifies the type of the new context item ObjectType Repository EA An EA Repository object representing the currently open Enterprise Repository Architect model Poll its members to retrieve model data and user 1977 i
381. tion Return False otherwise 6 5 9 7 EA_OnPostNewPackage Details EA_OnPostNewPackage notifies Add Ins that a new package has been created on a diagram It enables Add Ins to modify the package upon creation This event occurs when a user drags a new package from the Enterprise Architect UML Toolbox or Resources window onto a diagram or by selecting the New Package icon from the Project Browser Set Repository SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs Also look at EA_OnPreNewPackagel145 Syntax Function EA_OnPostNewPackage Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPostNewPackage function syntax contains the following elements CC ooo Contains the following EventProperty objects for the new E package 21 e PackagelD A long value corresponding to Package PackagelD Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True if the package has been updated during this notification Return False otherwise Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 151 6 5 10 EA_OnPostinitialized Details EA_OnPostinitialized notifies Add Ins that the Repository object has finished loading and any necessary initi
382. tly open Repositor Enterprise Architect model Poll its members to retrieve model T data and user interface status information Return Value One of the following types e A string indicating the label for a single menu option e An array of strings indicating a multiple menu options e Empty Visual Basic VB NET or null C to indicate that no menu should be displayed In the case of the top level menu it should be a single string or an array containing only one item or Empty null 6 4 4 EA_GetMenuState Details The EA_GetMenuState event enables the Add In to set a particular menu option to either enabled or disabled This is useful when dealing with locked packages and other situations where it is convenient to show a menu option but not enable it for use This event is raised just before Enterprise Architect has to show particular menu options to the user lts use is described in the Define Menu ltems 124 topic Also look at EA_GetMenultems 13h O 1998 2010 Sparx Systems Pty Ltd 132 Enterprise Architect Add In Model Add In Events Syntax Sub EA_GetMenuState Repository as EA Repository MenuLocation As String MenuName as String ItemName as String IsEnabled as Boolean IsChecked as Boolean The EA_GetMenuState function syntax has the following elements AR A IsChecked Boolean Boolean Set to True to check this particular menu option IsEnabled Boolean Boolean Set to False to disable thi
383. to tye noes The number of properties that are available for this object ObjectType ObjectType w3 Read only Distinguishes objects referenced through a Dispatch interface Properties Methods Item object Index Property Returns a property either by name or by zero based integer offset into the list of properties Parameter e Index Variant either a string representing the property name or an integer representing the zero based offset into the property list Property Property Attributes pwo e ome String Read only Identifies the property The object to which the properties list applies can have an automation property with the same name in which case the data accessed through Value is identical to that obtained through the automation property ObjectType ObjectType 193 Read only Distinguishes objects referenced through a Dispatch interface Type PropType k Read only Provides an indication of what sort of data is going to be stored by this property This restriction can be further defined by the Validation attribute Validation String Read only Optional string that is used to validate any data that is passed to the Value attribute This string is used by the Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 255 programmer at run time to provide an indication of what s expected and by Enterprise Architect to ensure that the submitted da
384. to a comma separated list of stereotypes sets the Hide Stereotyped Features oO _MakeComposite Used for creating composite elements 23 If set to 1 switches on the Inherited Features Show Operations setting _OpPkg If set to 1 switches on the Operation Visibility Package setting If set to 1 switches on the Operation Visibility Private setting _OpPro _OpPub _PType If set to 1 switches on the Operation Visibility Protected setting If set to 1 switches on the Operation Visibility Public setting If set to 1 switches on the Show element type Port and Part only setting If set to 1 switches on the Show Element Compartments Inherited Responsibilities Dn oO 5 Q _Responsibility If set to 1 switches on the Show Element Compartments Responsibilities setting _Runstate If set to 1 switches on the Hide Object Runstate in current diagram setting _SourceAggregation Used to set the aggregation type at the end of a connector do not set both _SourceAggregation and _TargetAggregation Set to 1 for shared 2 for composite _SourceMultiplicity Used to set the multiplicity of the source element such as 1 or 0 1 _SourceNavigability Ilf the connector is non navigable set this attribute to Non Navigable For other values set the direction 257 attribute If set to 1 switches on the Show Element Compartments Tags setting _Taginh If set to 1 switches on the Show Element Compartments Inherite
385. torlD Long the ID of the connector Provides an Add In or automation client with the ability to advise the Enterprise Architect user interface that a particular element has changed ana if it is visible in any open diagram to reload and refresh that element for the user Parameters e ObjectID Long the ID of the element 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 e Name String the name of the user e Password String the password of the user 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 Notes e This method cannot be undone It is strongly advised that you call SaveAuditLogs first to backup the logs e This method might fail if the user logged into the model does not have the correct access permission Parameters e StartDateTime Variant DateTime the earliest date and time of log entries to clear e EndDateTime Variant DateTime the latest date and time of log entries to clear Removes all the text from a tab in the Output window See also CreateOutputTab 204 EnsureOutput Visible 20 WriteOutput zI Parameters e Name String the name of the tab to remove text fr
386. tory As EA Repository RulelD As String AttributeGUID As String ObjectID As Long The EA_OnRunAttributeRule function syntax contains the following elements O 1998 2010 Sparx Systems Pty Ltd 164 Enterprise Architect Add In Model Broadcast Events pesame te peoo O i AttributeGUID String IN The GUID of the attribute to potentially perform validation on Use the Repository GetAttributeByGuid method to retrieve the attribute object ObjectID Long IN The ID of the object that owns the given attribute Use the Repository GetObjectBy D method to retrieve the object Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information String IN The ID that was passed into the Project DefineRule command 6 5 15 9 EA_OnRunMethodRule Details This event is triggered once for each rule defined in EA _OnlnitializeUserRulesli6 to be performed on each method in the selection being validated If you don t want to perform the rule defined by RulelD on the given method then simply return without performing any action On performing any validation if a validation error is found use the Repository ProjectInterface PublishResult method to notify Enterprise Architect Syntax Sub EA_OnRunMethodRule Repository As EA Repository RulelD As String MethodGUID As String ObjectID As Long The EA_
387. true to suppress Enterprise Architect from showing its default dialogs Also look at EA_OnPreNewConnector 142 Syntax Function EA_OnPostNewConnector Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPostNewConnector function syntax contains the following elements ream ome pee ooo Contains the following EventProperty objects for the new En ventProperties connector 21 an e ConnectorID A long value corresponding to Connector ConnectorID O 1998 2010 Sparx Systems Pty Ltd 148 Enterprise Architect Add In Model Broadcast Events CET CI CE CTN Repository 4 Repositoryl19 IN An EA Repository object representing the currently open Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True if the connector has been updated during this notification Return False otherwise 6 5 9 3 EA_OnPostNewDiagram Details EA_OnPostNewDiagram notifies Add Ins that a new diagram has been created It enables Add Ins to modify the diagram upon creation Set Repository SuppressEADialogs to true to suppress Enterprise Architect from showing its default dialogs Also look at EA_OnPreNewDiagram 143 Syntax Function EA_OnPostNewDiagram Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPostNewDiagram function syntax contains the following elements pm Joe orar ooo Contains the
388. ts within the Automation Interface It contains methods to iterate through the collection refresh the collection and delete an item from the collection It is important to realize that when AddNew is called the item is not automatically added to the current collection The typical steps are 1 Call AddNewto add a new item 2 Modify the item as required 3 Call Update on the item to save it to the database 4 Call Refresh on the collection to include it in the current set Delete is much the same until Refresh is called the collection still contains a reference to the deleted item which should not be called Each can be used to iterate through the collection for languages that support this type of construct O 1998 2010 Sparx Systems Pty Ltd 212 Enterprise Architect Object Model Reference Collection Attributes Atribute te motes Read only The number of objects referenced by this list ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch Collection Methods AddNew string Adds a new item to the current collection Name string Type Note that the interface is the same for all collections you must provide a Name and Type argument What these are used for depends on the actual collection member Also note that you must call Update on the returned object to complete the AddNew If Update is not called the object is left in an indeterminate state Parameters
389. tually clicked for example Create a New Invoice SS String String representing the part of the user interface that brought up the menu Can be Treeview MainMenu or Diagram a The name of the parent menu for which sub items are to be Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Add In Events 135 pemer e CEN O N E defined In the case of the top level menu it is an empty string Repository EA An EA Repository object representing the currently open Repositor Enterprise Architect model Poll its members to retrieve model ish data and user interface status information Return Value None 6 5 Broadcast Events Overview The following general Broadcast events are sent to all loaded Add Ins For an Add In to receive the event they must first implement the required automation event interface If Enterprise Architect detects that the Add In has the required interface the event is dispatched to the Add In e File Open Event 135 e File Close Event 1361 e File New Event 13 e Post Diagram Open Event 137 e Post Diagram Close Event 137 e Pre Deletion Events 138 e Pre New Events 141 e Post New Events 148 e Technology Events 152 e Context Item Events 155 e Transformation Events 15h e Compartment Events 15 e Model Validation Broadcasts 165 e Retrieve Model Template Event 168 e Initialize Technology Event 152 e Exit Instancel1461 not currently
390. turn ret public void EA_MenuClick EA Repository Rep string Location string MenuName string ItemName if ItemName amp Create m_MyControl UserControl1 Rep AddTab C Demo ContDemo UserControl1 else m_MyControl ShowButton 6 7 MDG Add ins MDG Add Ins are specialized types of Add Ins that have additional features and extra requirements for Add In authors who want to contribute to Enterprise Architect s goal of Model Driven Generation Unlike general Add In events MDG Add In events are only sent to the Add In that has taken ownership of an Enterprise Architect model branch on a particular PC One of the additional responsibilities of an MDG Add In is to take ownership of a branch of an Enterprise Architect model which is done through the MDG_Connect 17h event MDG Add Ins identify themselves as such during EA_Connect 136 by returning the string MDG Unlike ordinary Add Ins responding to MDG Add In events is not optional and methods must be published for each of the MDG Events 170 Two examples of MDG Add Ins are the commercially available MDG Link for Eclipse and MDG Link for Visual Studio published by Sparx Systems 6 7 1 MDG Events An MDG Add In must respond to all MDG Events These events usually identify processes such as Build Run Synchronize PreMerge and PostMerge amongst others An MDG Link Add In is expected to implement some form of forward and reverse engineering capability within Enter
391. tyParameter ActivityPartition Actor Artifact Boundary CentralBufferNode Change ChoiceState Class Collaboration Component DataType Decision DeepHistoryState Deployment Specification Device DiagramGate EntryPoint EntryState List of Connector Types ExecutionEnvironment ExitPoint ExitState ExpansionNode ExpansionRegion Feature GUIElement HistoryState Informationltem InitialActivity InitialState InteractionOccurrence Interface Issue InterruptableActivity Region JunctionState MergeNode MessageEndpoint n ary Association Node Object ObjectNode Package Part Port PrimitiveType Providedinterface Receive Requiredinterface Requirement Screen Send Sequence Signal State StateLifeline StateMachine Synchronization_H Synchronization_V SynchState UMLDiagram UseCase ValueLifeline The following connector names can be used in Quick Linker definitions Aggregation Association AssociationClass CommunicationPath Composition ConnectorLink ControlFlow DelegateLink Dependency Deployment Extension Generalization InterfaceLink Manifest Nesting ObjectFlow Packagelmport PackageMerge Realization Redefinition Sequence StateFlow UCExtends UCIncludes UseCase O 1998 2010 Sparx Systems Pty Ltd 30 MDG Technologies in SDK 2 MDG Technologies in SDK Model Driven Generation Y The Model Driven Generation MDG Technologies enable Enterprise Architect users to
392. type is Spin with the Upper and Lower Bounds set for the field values Spin is the Microsoft term for selection arrows in a variable field the user clicks on the arrows to increase or decrease the value between the upper and lower bound limits 6 Click on the Save button The Tagged Value type displays in the Defined Tag Types list 4 3 Predefined Reference Data Types This table details the predefined Reference Data Tagged Value types that are used to return the values held in a relevant table in Enterprise Architect along with the syntax required for their use You use these to create your own Reference Data Tagged Values 851 Tagged Value Drop Down List Returned Type Authors Type Enum Authors that have been defined for the Enterprise Architect List Authors model Cardinality Type Enum Cardinality types that have been defined for the Enterprise List Cardinality Architect model Clients Type Enum Clients that have been defined for the Enterprise Architect List Clients model ComplexityTypes Type Enum Complexity types that have been defined for the Enterprise List ComplexityTypes Architect model Whilst complexity types can be exported and imported as project reference data see UML Model Management they cannot be updated and so are effectively standard across all projects ConstraintTypes Type Enum Constraint types that have been defined for the Enterprise List ConstraintTypes Architect model EffortType
393. type to a stereotype just create an attribute with the same name For example to make the Tagged Value Handicap appear in a stereotype create an attribute named Handicap You can set the default value for the Tagged Value by giving the attribute an Initial value O 1998 2010 Sparx Systems Pty Ltd 10 Developing Profiles Create Profiles ametscisss Class Active Boolean extends myStereotype lt gt Handicap int 40 myTag color Yellow 1 2 3 2 With Supported Attributes Supported stereotype attribute tags are special tags that set the default behavior of stereotyped elements such as the initial size of the element and the default location of any image files associated with the stereotype For a list of supported attributes see the Supported Attributes 19 topic To define tags for a stereotype with supported attributes follow the steps below 1 Open the Attributes dialog for the stereotyped element Enterprise Architect Software Developers Kit Developing Profiles Create Profiles 11 mem Copy Seve _ Delete Name Initial Value ag image cane type EAShapeS W se e 2 Inthe Name field type the name of the stereotype tag 3 In the Initial field type the initial value of the tag Note For supported attributes you set only the Name which must match the attributes listed in the supported attributes sect
394. u in Enterprise Architect using the Tools YourApplication menu option Available Resources Other available resources include VB 6 Add In for generating MS Word www sparxsystems com resources developers autint_vb html documentation VB 6 Add In to display a custom ActiveX www sparxsystems com resources developers autint_vb custo graph control within the Enterprise m_view html Architect window as a new view A basic Add In framework written in C www sparxsystems com bin CS AddinFramework zip Useful as a starting point for authoring your own custom Enterprise Architect Add In An extension on the CS_AddinFramework www sparxsystems com bin CS AddinTaggedCSV zip example showing how to export Tagged Values to a csv file A basic Add In skeleton written in Delphi www sparxsystems com bin DelphiDemo zip A simple example Add In written in C www sparxsystems com bin CS Sample zip For further information see www sparxsystems com resources developers autint html 7 2 Reference This section provides detailed information on all the objects available in the object model provided by the Automation Interface covering e Interface Overview 187 e Appho e Enumerations h9 e Repository 198 Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 187 e Element 225 e Element Features 243 e Connector 255 e Diagram Package 2631 e Project Interface 27h e Code
395. udes for example the custom points and display appearance Accessed from the Diagram DiagramLinks 265 collection Associated table in EAP file t_diagramlinks DiagramLinks Attributes Anribute Type motes ConnectorlD Read Write The ID of the associated connector DiagramiD Read Write The local ID for the associated diagram Read Write The geometry associated with the current connector in this diagram InstancelD Long Read only Holds the connector identifier for the current model IsHidden Boolean Read Write Flag to indicate if this item is hidden or not ObjectType Obi jectType Read only Distinguishes objects referenced through a Dispatch interface 19 Path String Read Write The path of the connector in this diagram Style Read Write Additional style information for example color thickness 1998 2010 Sparx Systems Pty Ltd 268 Enterprise Architect Object Model Reference DiagramLinks Methods GetLastError Returns a string value describing the most recent error that occurred in 0 relation to this object This function is rarely used as an exception is thrown when an error occurs Update Boolean Update the current DiagramLink object after modification or appending a new item If false is returned check the GetLastError function for more information 7 2 8 3 DiagramObjects public Class The DiagramObjects collection holds a list of element IDs and presentation in
396. ules In MDG Technology Wizard 40 EA Connect 130 Diagram Type In MDG Technology Wizard 36 EA Disconnect 130 Enumeration Tags To Stereotypes 14 EA GetMenultems 131 Images In MDG Technology Wizard 43 EA GetmenuState 131 Linked Document Template In MDG Technology EA MenuClick 132 Wizard 45 EA_OnOutputltemClicked 133 on Transforms In MDG Technology Wizard EA OnOutputltemDoubleClicked 133 EA _ShowHelp 134 Pattern In MDG Technology Wizard 35 Add In Model Profile In MDG Technology Wizard 35 Add In Event EA Connect 130 Ti E O Add In Event EA Disconnect 130 IZar T Scripts In MDG Technology Wizard 43 Add In Event EA_GetMenultems 131 Shape Script To Stereotype In Profile 15 Add In Event EA_GetMenuState 131 Tagged Value Types In MDG Technology Wizard Add In Event EA_MenuClick 192 39 Add In Event EA_OnOutputltemClicked 133 Task Panel In MDG Technology Wizard 38 Add In Event EA_OnOutputltemDoubleClicked Toolbox In MDG Technology Wizard 37 133 Add And Delete Attributes Add In Event EA_ShowHelp 134 Automation Interface Code Example 288 Add In Event Overview 129 Add And Delete Methods a Taske 124 Automation Interface Code Example 288 Benetts 123 Add And Manage Diagrams Broadcast Event EA_FileClose 136 Automation Interface Code Example 287 broadcast Event EA FileNew 136 Add And Manage Elements Broadcast Event EA_FileOpen 135 Automation Interface Code Example 286 Broadcast Event EA_OnPostCloseDiagram 137 Add And Manage Packages
397. urn private void AddToMap string sRulelD string sKey m_RulelDs Add sRulelD m_RulelDEx Add sKey private string GetRuleStr string sRulelD switch sRulelD case cRule01 return Error Message 01 case cRule02 return Error Message 02 case cRule03 return Error Message 03 TODO add extra cases as much as necessary return public void ConfigureCategories EA Repository Repository EA Project Project Repository GetProjectinterface m_sCategory D Project DefineRuleCategory Enterprise Collaboration Architecture ECA public void ConfigureRules EA Repository Repository EA Project Project Repository GetProjectinterface 1998 2010 Sparx Systems Pty Ltd 168 Enterprise Architect Add In Model Broadcast Events AddToMap Project DefineRule m_sCategoryID EA EnumMVErrorType mvError GetRuleStr cRule01 cRule01 AddToMap Project DefineRule m_sCategoryID EA EnumMVErrorType mvError GetRuleStr cRule02 cRule02 AddToMap Project DefineRule m_sCategoryID EA EnumMVErrorType mvError GetRuleStr cRule03 cRule03 TODO expand this list public void RunConnectorRule EA Repository Repository string sRulelD long IConnectorID EA Connector Connector Repository GetConnectorBy ID int IConnectorID if Connector null switch LookupMapEx sRulelD case cRule02 TODO perform rule 2 check break TODO add more cases
398. us information Return Value Return True if the MDG Technology resource is updated during this notification Return False otherwise 6 5 12 4 EA_OnPreDeleteTechnology Deprecated refers to deleting a technology through the Resources window this process is no longer recommended See e EA OnPreActivate Technology 152 e EA OnPostActivate Technologyl15 e EA OnlnitializeTechnologies 152 1998 2010 Sparx Systems Pty Ltd 154 Enterprise Architect Add In Model Broadcast Events Details EA_OnPreDelete Technology notifies Add Ins that an MDG Technology resource is about to be deleted from the model This event occurs when a user deletes an MDG Technology resource from the model The notification is provided immediately after the user confirms their request to delete the MDG Technology so that the Add In can disable deletion of the MDG Technology Also look at EA_OnDelete Technology 154 Syntax Function EA_OnPreDeleteTechnology Repository As EA Repository Info As EA EventProperties As Boolean The EA_OnPreDelete Technology function syntax contains the following elements CIO CT CN EA EventProperties IN Contains the following EventProperty objects for the MDG 2127 Technology to be deleted e TechnologyID A string value corresponding to the MDG Technology ID Repository EA Repository An EA Repository object representing the currently open Enterprise Architect model Poll its members to retriev
399. used MDG Eventsl17 add quite a number of additional events but the Add In must first have registered as an MDG style Add In rather than as a generic Add In 6 5 1 EA_FileOpen Details The EA_FileOpen event enables the Add In to respond to a File Open event When Enterprise Architect opens a new model file this event is raised and passed to all Add Ins implementing this method The event occurs when the model being viewed by the Enterprise Architect user changes for whatever reason through user interaction or Add In activity Also look at EA FileCloselt361 and EA FileNewl136 Syntax Sub EA FileOpen Repository As EA Repository The EA_FileOpen function syntax contains the following elements O 1998 2010 Sparx Systems Pty Ltd 136 Enterprise Architect Add In Model Broadcast Events CTC CT CN Repository 4 Repository IN An EA Repository object representing the currently open 19 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value None 6 5 2 EA_FileClose Details The EA_FileClose event enables the Add In to respond to a File Close event When Enterprise Architect closes an opened Model file this event is raised and passed to all Add Ins implementing this method This event occurs when the model currently opened within Enterprise Architect is about to be closed when another model is about to be opened or when Enterprise
400. vailable contexts 4 Create the Profile 587 and incorporate it 387 into your Technology Enterprise Architect Software Developers Kit MDG Technologies in SDK Create Tasks Pane Profiles 55 2 5 1 Define Tasks Pane Toolboxes A Tasks Pane toolbox is defined by a stereotype Class that extends a metaclass ToolboxPage element These elements must be owned by a profile package Each stereotype Class represents the contents of the Tasks Pane for a given context and each attribute of the stereotype Class defines a command button in the Tasks Pane The following diagram shows an example of a Tasks Pane toolbox metaciass ToolboxPage extends Debugging Profile DebuggingTasks EASystem MenuCmd Build Build Package EASystem MenuCmd BuidSenpts Configure Scripts EASystem MenuCmd DebugRun Start debugging EASystem MenuCmd DebugStop Stop debugging EASystem ShowHelp genersting_sequence_disgrams him Generating EASystem ShowHelp recording_s_debug_session htm Recording with EASystem ShowMovie nttp spamsystems com su resources demos debugginges debugginges htm C Debugging EASystem ShowMovie nttp spamsystems com su resources demos workbench TO_20060907 20Workbench1 him Workbenc SEPARATOR The title bar of the Tasks Pane toolbox is defined by the Alias of the stereotype Class in this case Debugging Profile This example uses the following stand
401. ve string Boolean Deprecated no longer in use Perspective long Options DeleteTechnology string ID Boolean Removes a specified MDG Technology resource from the repository Returns true if the technology is successfully removed from the model Returns false otherwise Note 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 See Deploying MDG Technologies 607 from Add Ins Parameters e ID String the ID of the technology EnsureOutputVisible string Ensures that a specified tab in the Output window is visible Name to the user The Output window is made visible if it is hidden See also ClearOutput 20b CreateOutputTab 20 WriteOutput 2051 Parameters e Name String the name of the tab to make visible O 1998 2010 Sparx Systems Pty Ltd 202 Enterprise Architect Object Model Reference ExecutePackageBuildScript long ScriptOptions string PackageGuid 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 e ScriptOptions Long the script type can be any one of these numerical values 1 Build 2 Test 3 Run 4 Create Workbench Instance 5 Debug PackageGuid String the ID of the package for which to run the
402. ve checking should not be performed with this function but should be handled by MDG_PreGenerate 17h MDG PostGeneratel176 and MDG_PreReverse 178 Also look at MDG_Merge 17 1 and MDG_PostMergel176 Syntax Function MDG_PreMerge Repository As EA Repository PackageGuid As String As Long The MDG_PreMerge function syntax contains the following elements Peon owe CIC Repository An EA Repository object representing the currently open Feposion Enterprise Architect model Poll its members to retrieve model data and user interface status information eo String The GUID identifying the Enterprise Architect package sub tree that is controlled by the Add In Return Value A return value of zero indicates that the merge process will not occur If the value is not zero the merge process will proceed If this method is not implemented then it is assumed that a merge process is used 6 7 1 12 MDGPreReverse Details MDG_PreReverse enables the Add In to save file changes before being imported into Enterprise Architect This function operates on a list of files that are about to be reverse engineered into Enterprise Architect If the user is working on unsaved versions of these files in an editor you could either prompt the user or save automatically Also look at MDG PostGenerate 1761 and MDG PreGenerate 177 Syntax Sub MDG_PreReverse Repository As EA Repository PackageGuid As String FilePaths As Variant The MDG_PreReverse function
403. ve to ST If set to TRUE indicates that elements of type Source Element Type with Filter the stereotype Source Stereotype Filter do not display the Quick Linker No inherit from definitions of the equivalent unstereotyped element Metatype Enterprise Architect Software Developers Kit Developing Profiles Quick Linker 27 CN CN a mMemuGroup If set indicates the name of a sub menu in which a menu item is created R o Complexity Level Not implemented always set to 0 Target Must Be If set to TRUE this menu item only appears when dragging from a child Parent element to its parent for example from a port to its containing Class T Embed element If set to TRUE the element being created is embedded in the target element otherwise should be left blank Precedes Separator If set to TRUE results in a menu separator being added to the Quick LEAF Linker menu otherwise should be left blank V Precedes Separator lf set to TRUE results in a menu separator being added to the Quick GROUP Linker sub menu otherwise should be left blank Depending on which spreadsheet application you use this column might require a value in every cell to force CSV export to work correctly with trailing blank values o Dummy Column 1 3 2 Quick Linker Example This example uses a Class element with the stereotype quick The example scenario is this when you drag a connector away from one of these elements you want to create
404. velopers Kit Code Template Framework in SDK Code Template Syntax 117 Vertex IsHistory A check on whether the vertex is a history state IsPseudoState A check on whether the vertex is a pseudo state PseudoStateKind The Vertex s pseudo state kind 5 1 3 Variables Template variables provide a convenient way of storing and retrieving data within a template This section explains how variables are defined 11 and referenced 118 Variable Definitions Variable definitions take the basic form lt name gt lt value gt where lt name gt can be any alpha numeric sequence and lt value gt is derived from a macro or another variable A simple example definition would be foo className Variables can be defined using values from e Substitution function or list macros e String literals enclosed within double quotation marks e Variable references Definition Rules The following rules apply to variable definitions e Variables have global scope within the template in which they are defined and are not accessible to other templates e Each variable must be defined at the start of a line without any intervening whitespace e Variables are denoted by prefixing the name with as in foo e Variables do not have to be declared prior to being defined e Variables must be defined using either the assignment operator or the addition assignment operator e Multiple terms can be combined in a
405. version control status of each version controlled package within the current model with the status reported by your version control provider See Version Control Within UML Models Using Enterprise Architect Parameters e ClearSettings Boolean if true clear the version control settings from packages that are reported by the version control provider as uncontrolled if false leave the version control settings unchanged for packages reported as uncontrolled Writes text to a specified tab in the Output window and O 1998 2010 Sparx Systems Pty Ltd 210 Enterprise Architect Object Model Reference string String long ID associates the text with an ID See also ClearOutput 206 CreateOutputTab 20h EnsureOutput Visible 20h Parameters e Name String specifies the tab on which to display the text e String String specifies the text to display e ID Long specifies the ID the text is associated with 7 2 4 2 Author public Class An Author object represents a named model author Accessed using the Repository Authors collection Associated table in EAP file t_ authors Author Attributes Atribute Type Notes Name smg Reaawite Author name Notes Sting Read Write Notes about the author ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch interface 1957 Roles Sting Read Write Roles the author might play in this project Author Methods
406. w long Show SynchronizeClass string Boolean ElementGUID string ExtraOptions SynchronizePackage string Boolean PackageGUID string ExtraOptions TransformElement string Boolean TransformName string ElementGUID string TargetPackage string ExtraOptions TransformPackage string Boolean TransformName string SourcePackage string TargetPackage string ExtraOptions e PackageGUID String the GUID in XML format of the package to save Saves a diagram image of the current diagram to file Parameters e FileName String the filename of the image to save Shows or hides the Enterprise Architect User Interface Parameters e Show Long Synchronizes a Class with the latest source code Parameters e 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 Synchronizes each Class in a package with the latest source code Parameters e 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 Transforms an element into a package Parameters TransformName String specifies the transformation that should be executed ElementGUID String the GUID
407. with the origin to the top left of the screen EndPointY Long Read Write The y coordinate of the connector s end point Note Connector end points are specified in Cartesian coordinates with the origin to the top left of the screen String Read Write Structure to hold a variety of flags concerned with event signaling on messages Read Write Flag indicating connector is a eaf fisRoot Boolean Read Write Flag indicating connector is a root isSpec Boolean Read Write Flag indicating connector is a specification MetaType String Read only The connector s domain specific meta type as defined by an applied stereotype from an MDG Technology String Read only This low level property provides information about the contents of the PDatax fields These database fields are not documented and developers must gain understanding of these fields through their own endeavors to use this property Enterprise Architect Software Developers Kit Enterprise Architect Object Model Reference 259 MiscData is zero based therefore e MiscData 0 corresponds to PData1 e MiscData 1 to PData2 and so on Name String Read Write The connector name Notes sing Read Write Descriptive notes about the connector ObjectType ObjectType Read only Distinguishes objects referenced through a Dispatch Properties Properties 254 Returns a list of specialized properties that apply to the connector that might not be ava
408. y RulelD As String Element As EA Element The EA_OnRunElementRule function syntax contains the following elements pres re Ton pesen o Element EA Element The element to potentially perform validation on Repository EA Repository IN An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Ruled Sting mw The ID that was passed into the Project DefineRule command 6 5 15 5 EA_OnRunPackageRule Details This event is triggered once for each rule defined in EA_OninitializeUserRules 1661 to be performed on each package in the selection being validated If you don t want to perform the rule defined by RulelD on the given package then simply return without performing any action On performing any validation if a validation error is found use the Repository ProjectInterface PublishResult method to notify Enterprise Architect Syntax Sub EA_OnRunPackageRule Repository As EA Repository RulelD As String PackagelD As Long The EA_OnRunElementRule function syntax contains the following elements CC CC PackagelD Long IN The ID of the package to potentially perform validation on Use the Repository GetPackageByID method to retrieve the package object Repository EA Repositor An EA Repository object representing the currently open 19 Enterprise Architect model Poll its members to retrieve model data
409. y object representing the currently open 19 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value Return True to enable addition of the new package to the model Return False to disable addition of the new package 6 5 8 EA_OnPreExitinstance Details EA_OnPreExitInstance is not currently used Syntax Sub EA_OnPreExitinstance Repository As EA Repository The EA_OnPreExitinstance function syntax contains the following element pan ime preno eto Ei IN Repository EA Repository An EA Repository object representing the currently open 197 Enterprise Architect model Poll its members to retrieve model data and user interface status information Return Value None 6 5 9 Post New Events Enterprise Architect Add Ins can respond to the creation of new elements connectors objects attributes methods and packages using the following broadcast events e EA OnPostNewElement 14 e EA OnPostNewConnector 147 e EA OnPostNewDiagraml14 e EA OnPostNewDiagramObject 148 e EA OnPostNewAttributel14 e EA OnPostNewMethod 145 e EA OnPostNewPackagel150 Enterprise Architect Software Developers Kit Enterprise Architect Add In Model Broadcast Events 147 6 5 9 1 EA_OnPostNewElement Details EA_OnPostNewElement notifies Add Ins that a new element has been created on a diagram It enables Add Ins to modify the element upon creation
410. you can save a lot of confusion if you make them the same or very similar For example Enterprise Architect Software Developers Kit Developing Profiles Create Profiles 19 package GL with diagrams GL1 GL2 GL3 The profile takes the The profile takes the package s diagram s notes notes You can take the default size You cannot take the default size and appearance including alternate image from the diagram object Can be much faster 1 2 9 Supported Attributes and appearance from the diagram object You can use the _sizeX _sizeY and _ image properties but there is no equivalent for default colors Can be much slower The difference arises because diagram objects are kept in memory and Project Browser elements aren t This is only likely to be an issue if the profile is a large one and you are using a slow network connection to a remote repository Supported Stereotype Attributes in UML Profiles The following attributes can be applied to stereotypes in UML Profiles Contains the path to a bitmap file to be used as the Project Browser icon for all elements other than Package with the given stereotype The bitmap must be 16x16 pixels For a transparent background use light grey RGB 192 192 192 image Shape script definition _instanceMode Used for defining behavior on creating an instance _instanceOwner Used for defining behavior on creating an instance 224
411. ype 195 Instance Enumeration Elements Define Behavior On Creation Supported Add To Profiles 14 Attributes 22 EnumRelationSetType Enum Introduction Automation Interface 192 To Enterprise Architect SDK 2 EventProperties To Quick Linker 25 Automation Interface Repository 214 To Shape Scripts 61 EventProperty To Tagged Value Types 81 Automation Interface Repository 214 Issue Defect Examples And Tips Automation Interface Element Package 235 Automation Interface 184 Iterate Through EAP File Export Automation Interface Code Example 284 Code Templates 119 Profile 17 L Z UML Profile 17 ExportPackageXMIFlag Enum Automation Interface 193 Extend UML Toolbox Connectors 51 UML Toolbox Elements 50 oe Field Substitution Macros Language Custom Create Templates For In Code Template Editor 122 Linked Document Template Add To MDG Technology 45 List Macro Code Template Syntax 106 1998 2010 Sparx Systems Pty Ltd 304 Index Macro Branching 106 Code Template Syntax 106 Control 106 Field Substitution Code Template Syntax 90 Function Code Template Syntax 103 List 106 PI 106 Synchronization 106 Tagged Value Code Template Syntax 102 Template Substitution Code Template Syntax 89 Macros Behavioral Model 109 Code Template Syntax 89 EASL Code Generation 109 EASL_GET 109 EASLList 109 Manage Add Ins 128 Masked Tagged Values Create 86 MDA Transform Add To MDG Technology 42 MDG Add Ins Add In Model 1
412. ype a name for the Profile Select the Automatically add new diagram checkbox Click on the OK button The New Diagram dialog displays Provide the required diagram name and select the diagram group UML Structural and diagram type Class Click on the OK button Enterprise Architect creates a package with the stereotype profile gt and with a child Class diagram Double click on the Profile Package on the diagram to open the child diagram You now use this child diagram to add stereotypes 6 to the Profile 1 2 2 Add Stereotypes and Metaclasses To add metaclasses and stereotypes to a Profile follow the steps below for as many stereotypes and metaclasses as you require 1 2 Open the child diagram of the Profile Package Drag the Metaclass element from the Profile page of the Enterprise Architect UML Toolbox onto the diagram The Create New Metaclass dialog displays in which you can tick multiple metaclasses for dropping onto the diagram Enterprise Architect Software Developers Kit Developing Profiles Create Profiles 7 Scroll down the Element list and select the checkbox for Class Click on the OK button display the Class Properties dialog and in the Name field type a name for the element Click on the OK button again Drag a Stereotype element from the Toolbox
413. z Float Read Write A weighting factor Effort Methods GetLastError Returns a string value describing the most recent error that occurred in relation to this object This function is rarely used as an exception is thrown when an error occurs Update Saves the effort to the model 7 2 5 3 Element public Class An Element is the main modeling unit It corresponds to for example Class Use Case Node or Component You create new elements by adding to the Package Elements collection Once you have created an element you can add it to the DiagramObjects collection of a diagram to include it in the diagram Elements also have a collection of connectors Each entry in this collection indicates a relationship to another element There are also some extended collections for managing addition information about the element including things such as Tagged Values Issues Constraints and Requirements Associated table in EAP file t_object Element Attributes jatibute type Notes Cs Se Read Write Indicates if the element is Abstract 1 or Concrete 0 ActionFlags String Read Write A structure to hold flags concerned with Action semantics fais Sting ReadrWrite An optional alias or this element Collection Read only Collection of Attribute objects for current element Use the AddNew and Delete functions to manage attributes AttributesEx Collection Read only Collection of Attribute objects belongin
Download Pdf Manuals
Related Search
Related Contents
Tabla de contenidos Périgueux GE Surface Time-Saving Wellheads Brochure 師 CT内蔵プラグインスリムサ一キッ トプレーカ 取扱説明書 Montage- und Bedienungsanleitung A veces solo tiene segundos para llamar la atención /Es por eso dreamGEAR Type 6 ROBINET FLOTTEUR pour ARRIVÉE LATÉRALE et Olympus f2.8-3.5 User's Manual Logiciel els - Notice utilisation Copyright © All rights reserved.
Failed to retrieve file