Skip to content

Use the power of Java, .NET like C#, F#, VB for your EA Scripting and Querying.

License

Notifications You must be signed in to change notification settings

Helmut-Ortmann/EnterpriseArchitect_ScriptDotNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EnterpriseArchitect_ScriptDotNet

Use the power of

  • .NET like C#, F#, VB, C++
  • Java

for your EA Scripting and Querying.

Implement your EA Scripts in .NET or Java and make only the glue-code to EA in JScript, VB Script or JavaScript. The minimal EA glue-code is responsible for EA integration and passing the parameters to your target environment (.NET or Java).

Benefits

  • Find your typos at compile time
  • A vast amount of libraries, examples and tutorials
  • Easy testing and debugging
  • LINQ for SQL, the powerful way of SQL

Principle

One line of code and you are in your Java, C#, VB, F#, C++ environment!

EA: VB Script glue-code

' Run the C#, VB, F#, C++ Console Programm,
result = RunCommand(myScript.exe, "DoTask1", guid, "", "") ' C# vb script glue-code
' Run the Java Class, let Java do everything
result = RunCommandJava("%EA_SCRIPT_HOME%", "SparxSystems.RepositoryInterface", " ", " "," ", " ") ' Java vb script glue-code

.NET: See ScriptCSharp.cs

switch (command) {  // Decide what to do
    case: "DoTask1":
       var el = _repository.GetElementByGuid (guid); // get the passed element
       _repository.ShowInProjectView(el);            // show the passed element in project browser
    break;

    case: "DoTask2":
    break;
}

Java: See RepositoryInterface.java

public void PrintPackage( org.sparx.Package pkg)
    {
        Trace( pkg.GetName());
        Collection<org.sparx.Package> packages = pkg.GetPackages();
        for(short i = 0; i < packages.GetCount(); i++)
        {
            PrintPackage(packages.GetAt(i));
        }
    }

EA glue-code

Take the EA-Script Template and add three or so lines of code and you have done integration or the so-called glue-code. Decide whether you pass the environment like guid ot type to C# or let C# do it.

EA VB Scripts

You may condense this code section to (one line of EA VB Script code):

' Call C# "TraversePackage" and make everything there
runCommand "%EA_SCRIPT_HOME%ScriptCSharp.exe", "TraversePackage", "", ""

Try it

  1. Installation C#
  2. Tutorial C#
  3. Java
  4. Use it for other languages, VB, F#, C++, or?

References

History

1.2.0 Text to Speech added

  • Minor improvement Debug and productive script

1.1.0

  • VB Script: RunComand with three parameters instead of 2
  • LINQ to SQL as project ScriptsCSharpLinq (powerful, database independent)
  • Java

1.0.0 Created

  • C# Interface
  • VB: Browser Script
  • VB: Diagram Script
  • Preparation Java Interface

About

Use the power of Java, .NET like C#, F#, VB for your EA Scripting and Querying.

Resources

License

Stars

Watchers

Forks

Packages

No packages published