Installation - Helmut-Ortmann/EnterpriseArchitect_ScriptDotNet GitHub Wiki

Installation

Here you find information to setup and use C# (Projects: ScriptCSharp, ScriptCSharpLinq) in an Visual Studio environment with your EA model. Other IDEs or languages are working similare.

  • Setup Visual 2017
  • Setup EA or use the delivered EA model
  • Environment Variables
    • EA_SCRIPT_HOME Folder with all the C# *.dll, *.exe

For Java follow the instructions in Java.

Procedure

  1. Install VS 2017
  2. Clone 'EnterpriseArchitect_ScriptDotNet'
  3. Update References
  4. Create your Script Library (e.g. c:\temp\EaScripts)
  5. Update Post-build event, release for Script installation in productive environment
    • Project Properties, Build Events, Edit Pre-build...
    • "$(SolutionDir)ScriptCSharp\Scripts\Install.bat" "$(SolutionDir)ScriptCSharp\bin\Release" "c:\temp\EaScripts"
  6. Build for release
  7. Adapt & run: SetEnvProductive.bat to point to your VS bin\release folder
  8. Open EA model ScriptDotNet.eap
  9. Select a Package, Specialize, Scripts, TraversePackage

References Project ScriptCSharp

  1. Project ScriptCSharp
  2. References, Add References
  3. Select/Browse
    • Browse
      • Interop.EA
      • SparxSystems.Repository
      • Path: your EA Installation
      • Properties:
        • Copy Local: true
        • Embed Interop Types: false
    • Assemblies:
  4. References, Add References, Assemblies,
    • System.Windows.Forms
    • System.Speech

Browse References

Add References

Reference properties

Reference property

References Project ScriptCSharpLinq

All of Project ScriptCSharpLinq and:

  • References, Add References, Browse,..
    • ScriptCSharpLinq\Library\hoLinqToSql.dll
  • Nuget packages
    • linq2db (2.6.1)
    • MoreLinq (useful extensions LINQ)

Post-build event

The Post-build event copies the \bin\release\ to your Script

Post-build event

Adapt & Run SetEnvProductive.bat

Adapt & run:

  • SetEnvDebug.bat (path: bin\debug of your environment)
  • SetEnvProductive.bat (path: bin\release of your environment)

First try

Run Script TraversePackage from Browser

EA Script-Types

In the EA Script-Groups you create VB Scripts which later appear in Context Menues.

Group Description Context Menu of
Browser Works from Browser Browser
Diagram Works from Diagram Diagram
ModelSearch Result row in Search Window Selected rows in Search Window
Normal Runs the Script, no context no
Project Search Should be a Search, entry 'Script' in Category Search Window no

Script Group and Browser Context Script Group Project Search Script Group Model Search

Import/Export EA Scripts

  • Configure
    • Transfer
      • Export Referenced Data
      • Import Referenced Data

Export Referenced Data

Deployment

Scripts Folder

The place where the Post-build event copies the *.exe and *.dll files and EA calls the C# Console Applications.

The *.exe to call from VB Script is then:

  • %EA_SCRIPT_HOME%ScriptCSharp.exe or whatever the name is

Environment Variable

The User Environment Variable 'EA_SCRIPT_HOME' points to the Scripts Folder.

The script 'SetEnvProductive.bat' sets it to your productive environment. The script 'SetEnvDebug.bat' sets it to your debug environment

Example:

  • c:\myWorkEnvironemnt\MyEaScripts\

Remark: You have to restart after a change of the Environment Variable value the involved Windows processes:

  • EA

What helps me

  • Restart EA, VisualStduio, .., because changes to Environment Variable takes effect after stert of the *.exe,..
  • Where javac.exe from the comant line

Glossary

  • VS Visual Studio 2017

References