Scripts - Helmut-Ortmann/EnterpriseArchitect_hoTools GitHub Wiki

Script

  • Run your Script by pressing a Global Keys combination like CTRL+F1
  • Run your Script by clicking on a Toolbar Button
  • Run your Scripts with the results of your SQL Query.
  • Run SQL Query from Script
  • Supported: VB Script, JScript or JavaScript

Script preconditions

  • Script contains one line 'EA-Matic
  • First parameter: EA Object (Element, Package, Diagram,..)
  • Second parameter: EA Object type as eNumeration (otElement, otPackage, otDiagram, otAttribute, otOperation)
  • see Example VB Scripts
  • see Load Example VB Scripts

Run SQL from Script

You can run the hoTools SQL files from Script by using hoTools as COM server. See: hoDemoRunSql

###Run your Script with the results of one of your SQL Queries With that you can easily perform your task by your script in your preferred language on the result set.

  • Create your SQL Query.
  • Choose your script to run on the Query results
  • Run your Query (CTRL+R, Icon on Toolbar, Context Menue, Buttons)

Load Example VB Scripts

  • Load Standard Scripts
    • File, LoadStandardScripts
      • Loads hoTools ScriptGroup
      • hoDemo2Par (Run Script on SQL results)
      • hoDemo3Par (Run Script on SQL results)
      • hoDemoRunSql (Run SQL from Script)

Demo VB Scripts

The easiest way is just to copy them and change according to your needs.

Rules for Scripts

  • Contains line with (compatible to Geert Bellekens VBScript-Library) :
    • 'EA-Matic for VB
    • //EA-Matic for JScript, JavaScript
  • Code (for VB, JScript, JavaScript)
    • no 'as EA.Element'
    • no 'Session' Object available
      • use e.g. 'Repository.WriteOutput "Script", "MyTest",0)' instead
    • 'var Repository' is EA.Repository Object
  • Query results contain (also best practice for almost all EA Searches you develop)
    • Column 1: AS CLASSGUID (ea_guid)
    • Column 2: AS CLASSTYPE (object_type, diagram_type, 'Package', 'Attribute', 'Operation')
  • 2 or three parameters
    • par1: EA model item according to GUID in your Search (Package, Diagram, Element,..)
    • par2: EA Object type as eNum (otElement, otPackage, otDiagram, otAttribute, otOperation)
    • par3 (optional): The hoTools Model object which will give you advanced features, future use
  • Make sure your SQL returns only one GUID per row!
  • The rules of the great EA-Matic

Thanks

Thanks a lot to Geert Bellekens and his