Use the power of modern IDEs and languages like Java, C#, F#, VB, or C++ for your EA Scripting. Here you find everything you need for a quick-start.
Develop your solution, let's say a Text to Speech application for selected EA items. Code it in your favourite language with all the benefits of your IDE - the developing, debugging, version control and your life-cycle. In short, professional software development with a state of the art IDE.
Just add one line of code in EA VB Scripts to call this Text to Speech application for Browser, Diagram, Model Search.
You find an error, a new release, no big deal. Just deploy the application at your desktop.
Benefits
-
Well known Software Life-Cycle
-
Let IDE and compiler work for you
-
A vast amount of libraries, examples and tutorials
-
Easy testing and debugging
Principle
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
Example in C#
Other languages are similar.
switch (command) { // Decide what to do
case: "TextToSpeech":
var el = _repository.GetElementByGuid (guid); // get the passed element
_repository.ShowInProjectView(el); // show the passed element in project browser
break;
case: "DoTask2":
break;
}
Example 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));
}
}
Summary
You find the whole article, the code, an EA-Repository and the Tutorial at GitHub, ScriptDotNet.
Converting the glue-code from VB Script to JScript or JavaScript is no big deal.