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
- Install VS 2017
- Clone 'EnterpriseArchitect_ScriptDotNet'
- Update References
- Create your Script Library (e.g. c:\temp\EaScripts)
- 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"
- Build for release
- Adapt & run: SetEnvProductive.bat to point to your VS bin\release folder
- Open EA model ScriptDotNet.eap
- Select a Package, Specialize, Scripts, TraversePackage
References Project ScriptCSharp
- Project ScriptCSharp
- References, Add References
- Select/Browse
- Browse
- Interop.EA
- SparxSystems.Repository
- Path: your EA Installation
- Properties:
- Copy Local: true
- Embed Interop Types: false
- Assemblies:
- Browse
- References, Add References, Assemblies,
- System.Windows.Forms
- System.Speech
Browse References
Reference properties
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
Adapt & Run SetEnvProductive.bat
Adapt & run:
- SetEnvDebug.bat (path: bin\debug of your environment)
- SetEnvProductive.bat (path: bin\release of your environment)
First try
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 |
Import/Export EA Scripts
- Configure
- Transfer
- Export Referenced Data
- Import Referenced Data
- Transfer
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
- EA Script Group Properties
- EA Community, Use C#, VB, F#, Java for your VB Scripting
- Metrics
- Python
- SPARX Webinar Hybrid Scripting
- SPARX Tutorial Hybrid Scripting
- Where is the exe?
- Why LINQ beats SQL