Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Dermot

Pages: 1 ... 37 38 [39]
571
The latest version of EA - version 7.1, now supports scaling diagrams across multiple pages in RTF generated reports.  
See the entry from RoyC above, as well as:
http://www.sparxsystems.com.au/EAUserGuide/document_options.htm

572
Automation Interface, Add-Ins and Tools / Re: documentation rtf fields
« on: March 20, 2007, 05:15:27 pm »
The {Element.Tag} field does output the Element.Keywords data.  I am not sure why it has that name - I will pass this on to see if it should be corrected.

573
Automation Interface, Add-Ins and Tools / Re: How to use CSV-Import
« on: August 27, 2006, 06:17:05 pm »
In the CSV import specification you do need to specifiy the Element Type that you are going to create in EA.

So your "Select element field:"
- has to have at least : Name, Type

The Element Type can be:
Action, Activity, ActivityPartition, ActivityRegion, Actor, Artifact, Association, Boundary, Change, Class, Collaboration, Component, Constraint, Decision, DeploymentSpecification, DiagramFrame, EmbeddedElement, Entity, EntryPoint, Event, ExceptionHandler, ExitPoint, ExpansionNode, ExpansionRegion, GUIElement, InteractionFragment, InteractionOccurrence, InteractionState, Interface, InterruptibleActivityRegion, Issue, Node, Note, Object, Package, Parameter, Part, Port, ProvidedInterface, Report, RequiredInterface, Requirement, Screen, Sequence, State, StateNode, Synchronization, Text, TimeLine, UseCase

I hope this is of help.


574
Hello Gary,

It is suprising to hear that this code does work under Word 2003.  We did test it for Word 2000, 2002 & 2003.  We ended up using the library for Word 2000 as this was the one that seemed to cover all the versions best.

If you are looking at working on this in VB,  I would reccomend you reset the Word Object library to the Word 2003 - "Microsoft Word 11 Object library" See:
http://sparxsystems.com.au/resources/developers/autint_vb_setup.html for a graphical picture of where to set this in VB 6.

I assume you are already aware of the location for the source code: ttp://sparxsystems.com.au/bin/AutIntDll.zip.

I hope this is of help.

Dermot.

575
Automation Interface, Add-Ins and Tools / Re: Refresh Packages
« on: September 08, 2004, 05:28:48 pm »
Try using ReloadDiagram()  

Ie.
      Repository.ReloadDiagram(DiagramId)

I hope this is of help.

576

This is defined in a Element under Gentype See:

http://www.sparxsystems.com.au/EAUserGuide/index.html?showelementusage.htm

and search for Gentype.


I hope this is of help.

577
Automation Interface, Add-Ins and Tools / Re: ER DIAGRAM
« on: January 26, 2004, 04:54:45 pm »
EA supports creating UML data diagrams. To import a schema from an existing SQL database - create an ODBC connection to your SQL Database.

Create a package and a diagram for your data schema. Then from the main menu, select Project | Database Engineering | Import Schema from ODBC.  This will import the schema into the diagram.

See: http://www.sparxsystems.com.au/EAUserGuide/index.html?importdatabaseschemafromod.htm

578
Just an update on that - use the ODBC string defined in EA when doing:
File | Open
Copy the text from the ODBC link in the field: Project to Open
Use this text as the ODBC string in Repositpory.OpenFile()
:)

579
Repository.Open( ) is the command for opening a repository in the Automation Interface .  The parameter for this can have a file path or an ODBC string as the parameter.  An example of this is attached below.

This can be further automated by calling your application from within EA and passing across a parameter in the call.  See: http://www.sparxsystems.com.au/AutIntVBCallingFromEA.htm
There is an example code using this type of call in:
http://www.sparxsystems.com.au/AutIntVBDownload.htm

I hope this of help.

Sub Main()
   Dim rep As EA.Repository
   Dim Package As EA.Package
 
   Dim aPackageGuid As String
   Dim aProject As EA.Project
   
   Set rep = New EA.Repository
  ‘ ODBC path ..
   rep.OpenFile "SQLREPOS ---
      DBType=1;Connect=Provider=MSDASQL.1; _
      Password=xxxxx;Persist Security _
      Info=True;User ID=xx;Data Source=xxxxx"
   ‘ File path
   'rep.OpenFile "C:\Program Files\Sparx" + _  
   "Systems\EA\EAExample.eap"
   
   Set Package = rep.Models.GetByName("Support")
   aPackageGuid = Package.PackageGUID
   
   Set aProject = rep.GetProjectInterface()
   aProject.RunHTMLReport aPackageGuid, "C:\temp", "BMP", "", "htm"
   
   rep.Exit
   Set rep = Nothing
   
End Sub
:)

580
This was based on request for gettting inforation on Formal-Requirements across into the Test Cases of that object.

This is short piece of Automation Interface code that gives an example of:
- making updates to the repository
- Calling an application using parameters from EA

It needs to be called as an executable from EA.  There are details on the web site for calling an application from EA -
http://www.sparxsystems.com.au/AutIntVBCallingFromEA.htm.

These details would differ for this application:

- The application Name: Requirements
- The command line would be: c:\{YourDir..}\Requirement.exe
- The Arguments would be:  $f, $p

On running EA - open the diagram with the Formal Requirements then select the installed application from the EA menu - Tools | Requirements.  This will give a simple msgbox asking if want to copy the name and notes of each Requirement element in that package.  On selecting 'Yes' it simply copies the Name and Details into a Test Case.


This is simple code.  It only checks if the records already
exist - if so it does not try to add the same name.


Here is the code below:


______________________________________________________________


Option Explicit
Public EARepos As EA.Repository        ' The instance of an EA repository

Private Sub Main()
   '_______________________________________________
   '
   'Get the command line parameters, Load the Repository
   'and set some defaults
   '_______________________________________________
   Dim Package As EA.Package
   Dim lPackageId As Long
   Dim EafileName As String

   'set what will be parameters in the procudure call
    If Len(Command) > 0 Then                    ' See if there are any arguments.

       ' The Ea repository location             'possible EA Arguments $f, $p
       EafileName = GetParams(Command, 0)
 
       ' get the package Id
       lPackageId = Val(GetParams(Command, 1))
       
   Else
   
       'No Arguments may not be running from EA..
       MsgBox ("Please set this up to be called as an application by EA passing the $f, $p arguments.  See: http://www.sparxsystems.com.au/AutIntVBCallingFromEA.htm")
       End
       
   End If
   
   OpenRepos (EafileName)                   'load up with sepcified path
   
   Set Package = EARepos.GetPackageByID(lPackageId)
   
   ScanElements Package
   
End Sub


Sub ScanElements(Package As Package)
   Dim idx As Integer, oElement As Element, PackageName As String
   
   '_______________________________________________________________
   '
   ' Scan through each Element - Ask user if they want to add to tests
   '_______________________________________________________________
   
   For idx = 0 To Package.Elements.Count - 1
   
       Set oElement = Package.Elements.GetAt(idx)
       
       ' Check if there are details for this element to be output
        If oElement.Type = "Requirement" Then
       
           ' if so list the details for the element
           If MsgBox(oElement.Name + "  - Pass to test?", vbYesNo, _
           "Copy to Element Requirements") = vbYes Then
               ElementDetailToTest oElement
           End If
           
       End If
       
   Next
End Sub

Public Sub ElementDetailToTest(oElement As EA.Element)
    '_______________________________________________________________
    '
    'Copy over the key details for a Requirement Element to Element Requirements
    '_______________________________________________________________
   
    Dim aTest As EA.Test, idx As Integer
   
    'Check the test is not already there
    For idx = 0 To oElement.Tests.Count - 1
       If oElement.Tests(idx).Name = oElement.Name Then
           MsgBox ("There is an existing Test of this name")
           Exit Sub
       End If
    Next
   
   ' Create a test case from the Formalrequirements
    Set aTest = oElement.Tests.AddNew(oElement.Name, "Standard")
    aTest.AcceptanceCriteria = oElement.Notes
    aTest.Input = oElement.Notes
   
    aTest.Update
   
End Sub


Public Function GetParams(ParamStr As String, ParamNum As Integer) As String
   Dim words() As String
   
   words = Split(ParamStr, ",")
 
   GetParams = words(ParamNum)
   
End Function


Public Function OpenRepos(EaProjName As String)

   'create the EA Reppository
   Set EARepos = New EA.Repository
 
   EARepos.OpenFile (EaProjName)                   'load up with sepcified path
   EARepos.ShowWindow (0)                          'optionally hide window

End Function


____________________________________________

Enjoy!

581
Automation Interface, Add-Ins and Tools / Working with Connectors
« on: September 28, 2003, 06:19:33 pm »
I have had a some requests from users trying to work out how to deal with outputing details about Connectors in diagrams.

Below is some example code that I have used for doing this.  The call from Main is a simple process for getting at some existing elements in the examle repository for 3.60.


_______________________________

Option Explicit
 

Public Sub DumpConnections(oElement As EA.Element, Rep As EA.Repository)
   Dim Idx As Integer
   Dim lNumRows As Long, iRows As Integer
   Dim AltObj As EA.Element
   Dim SourceStr As String, TagetStr As String
   Dim Connector As EA.Connector
     
   ' Set dimensions for the table
   lNumRows = oElement.Connectors.Count
   
   'Insert the table entries
   For iRows = 1 To lNumRows
       
          Set Connector = oElement.Connectors.GetAt(iRows - 1)
         
          ' Check which connector Supplier/Client is the Target/source
          If Connector.ClientID = oElement.ElementID Then
               'Client is the source
         
               'Set the Alternate Object as the target
               Set AltObj = Rep.GetElementByID(Connector.SupplierID)
               
               SourceStr = oElement.Name + " " + _
                    IIf(Len(Connector.ClientEnd.Cardinality) > 0, _
                    Connector.ClientEnd.Cardinality + ", ", "") + _
                    IIf(Connector.ClientEnd.Ordering, "Ordered ", "Unordered ")
               
               TagetStr = AltObj.Name + " " + _
                    IIf(Len(Connector.SupplierEnd.Cardinality) > 0, _
                    Connector.SupplierEnd.Cardinality + ", ", "") + " " + _
                    IIf(Connector.SupplierEnd.Ordering, "Ordered ", "Unordered ")
           Else
               'Supplier is the source

               Set AltObj = Rep.GetElementByID(Connector.ClientID)
               
               SourceStr = AltObj.Name + " " + _
                    IIf(Len(Connector.ClientEnd.Cardinality) > 0, _
                    Connector.ClientEnd.Cardinality + ", ", " ") + _
                    IIf(Connector.ClientEnd.Ordering, "Ordered ", "Unordered ")
                   
               TagetStr = oElement.Name + " " + _
                    IIf(Len(Connector.SupplierEnd.Cardinality) > 0, _
                    Connector.SupplierEnd.Cardinality + ", ", " ") + _
                    IIf(Connector.SupplierEnd.Ordering, "Ordered ", "Unordered ")
           End If
           
           ' Column 1 - name and type of the connector
           Debug.Print "Connector Type: " + Connector.Type + _
               IIf(Connector.Direction <> "Unassigned ", " ", Connector.Direction)
               
           'Source object name and ordering
           Debug.Print "Source: " + SourceStr
           Debug.Print "Taget: " + TagetStr
           Debug.Print "Notes: " + Connector.Notes
   
   Next
   
   Set AltObj = Nothing
   Set Connector = Nothing
End Sub

Sub Main()

   Dim Package As EA.Package
   Dim Diag As EA.Diagram
   Dim Rep As EA.Repository
 
   Dim aPackageGuid As String
   Dim aProject As EA.Project
   
   Set Rep = New EA.Repository
   Rep.OpenFile "C:\Program Files\Sparx Systems\EA\EAExample.eap"
   
   '3.60 example repository
   Set Package = Rep.Models.GetByName("Messenger")
   Set Package = Package.Packages.GetByName("Model Views")
   Set Package = Package.Packages.GetByName("Analysis Model")
   Set Package = Package.Packages.GetByName("Address Book")
   
   ' display connections for just the first element
   DumpConnections Package.Elements.GetAt(0), Rep
   
   Rep.Exit
   Set Rep = Nothing
   
End Sub

The code is written in Vba /VB 6.

If EA version 3.51 is still being used try using:
  'Using EA Version 3.51 ... Different EaExample
   Set Package = rep.Models.GetByName("Views")
   Set Package = Package.Packages.GetByName("Use Case View")
   Set Package = Package.Packages.GetByName("Business Process Model")
   Set Package = Package.Packages.GetByName("Process Model")

to replace the calls to the 3.60 pacakage set above.

Enjoy! :-)
   

582
Below is a simple set of code for testing or trying out commands when using the Automation Interface.

It uses the EaExample.eap file.  It is assumed a copy of this is stored in the default installation directory.

The following is some VBA/ VB 6 code for testing the command to generate the HTML report:

Sub Main()
   Dim rep As EA.Repository
   Dim Package As EA.Package
   Dim Diag As EA.Diagram
 
   Dim aPackageGuid As String
   Dim aProject As EA.Project
   
   Set rep = New EA.Repository
   'rep.OpenFile "C:\temp\EAExample.eap"
   rep.OpenFile "C:\Program Files\Sparx Systems\EA\EAExample.eap"
   
   'Using EA Version 3.51 ... Different EaExample
'   Set Package = rep.Models.GetByName("Views")
'   Set Package = Package.Packages.GetByName("Use Case View")
'   Set Package = Package.Packages.GetByName("Business Process Model")
'   Set Package = Package.Packages.GetByName("Process Model")
   
   'Using v3.60...EAexample
   Set Package = rep.Models.GetByName("Messenger")
   Set Package = Package.Packages.GetByName("Model Views")
   Set Package = Package.Packages.GetByName("Business Context Model")
   Set Package = Package.Packages.GetByName("Business Requirements Model")
   aPackageGuid = Package.PackageGUID
   
   'Place to test some commands..
   Set aProject = rep.GetProjectInterface()
   aProject.RunHTMLReport aPackageGuid, "C:\temp", "BMP", "", "htm"
   ' end test..
   
   rep.Exit
   Set rep = Nothing
   
End Sub


Please refer to
http://www.sparxsystems.com.au/AutIntVBReferences.htm for references on using the Automation Interface.

583
Automation Interface, Add-Ins and Tools / Automation Interface background
« on: September 26, 2003, 12:33:09 am »
This is just to give some background information about the Automation Interface :

On the website there is a new set of pages with some example code/application for using the Automation Interface.  This is available from: http://www.sparxsystems.com.au/AutIntVB.htm


There is a set of documentation defining the use of the Automation Interface available in the Enterprise Architect Helpfiles which can be found under the Help | Help Contents | Automation and Scripting menu item in EA.

There is reference to this in HTML format in EA under Help | Online Resources | Automation Interface - this takes you to the online version (The direct address to this: http://www.sparxsystems.com.au/userdocs/AutoInterface/index.htm).




Pages: 1 ... 37 38 [39]