Using Plugins with All Fusion Gen John Carter




























- Slides: 28

Using Plug-ins with All. Fusion® Gen John Carter CA Session 31 Tuesday, June 13, 2006

Session Abstract • This session provides an introduction to the plug-in capability of All. Fusion Gen. It is particularly aimed at those who are interested in creating their own plug-ins to expand the functionality of the toolset.

Agenda • • • Overview Executing a Plug-in Creating a Plug-in Database Schema Import Facility Q&A

Overview • Plug-in capability enables new functionality to be added to the toolset – By vendors (third party enhancements) – By users (specific requirements) • Typical uses – Wizards – Application Patterns – Additional Reporting – Interfacing to other tools

Existing Plug-ins • • • All. Fusion Gen Web Service Wizard All. Fusion Gen Database Schema Import Facility Solution Console from QAT, IET and Jumar QAT Function Manager Jumar: Links for All. Fusion Gen and UML IET gen. IE

Overview Toolset Plug-in Toolset API Model

Executing a Plug-in • Plug-in execution is based upon Registry Entries – Can restrict based upon diagram type – Can restrict based upon selected objects • Toolset passes arguments – Current diagram name, object id(s) of selected object(s), object id of main diagram object – Examples • ACTIONDIAGRAM -M 196629 -O 786846 • NAVIGATIONDIAGRAMTOP -M -1 -O 295 • DATAMODELDIAGRAM -M 76 -O 3735665

Executing a Plug-in

Executing a Plug-in

Executing a Plug-in

Executing a Plug-in • Sample plug-in displaying parameter line

Executing a Plug-in • No user interaction allowed while plug-in app is running • Rollback always performed when plug-in app returns control to toolset to discard uncommitted changes • Commit done by plug-in app runs toolset integrity checking • Text "markers" are placed in the transaction file to indicate that changes to a model were made by a particular plug-in

Creating a Plug-in • Use any language/tool that allows the consumption of an OLE control (even All. Fusion Gen!) • Consume the All. Fusion Gen toolset automation object – Create. Object("COOLgen. Toolset") • Utilize command line parameters – Which diagram initiated the plug-in – Object id of the scoping object – Object id(s) of any selected objects

Toolset Automation Object - Objects • Toolset – Top-level object; used to get to all other objects • Models – Collection object used to get the currently opened model • Model – Contains a property that returns the Open. API object • Open. API – Contains methods that are not related to a specific instance of a meta-model object

Toolset Automation Object - Objects • Meta. Model. Object – Contains properties and methods that are specific to a specific instance of a meta-model object • Meta. Model. Objects – An object that contains a collection of Meta. Model. Object objects – Count property returns the number of objects in the collection – Item method returns a specific Meta. Model. Object object

Toolset Automation Object - Properties • Last. Return. Code – Open. API and Meta. Model. Object – Stores the return code of the last method executed from the object • Meta. Model. Object – ID • Stores the object id – Object. Type. Code • Stores the object type code

Toolset Automation Object - Methods • • • Add / delete objects Add / delete associations Count / fetch objects Fetch / update properties Commit / Rollback

Creating a Plug-in • Standard plug-in structure -- Check for multiple toolset executables -SET lcl_wmi_locator ole obj TO Create. Object("Wbem. Scripting. SWbem. Locator") SET lcl_wmi_service ole obj TO lcl_wmi_locator ole obj. Connect. Server(". ", "rootcimv 2", "", "", 0, lcl_model ole obj) SET lcl_wmi_processes ole obj TO lcl_wmi_service ole obj. Exec. Query("Select * from Win 32_Process Where Name = 'TOOLSET. EXE'", "WQL", 0, lcl_model ole obj) IF lcl_wmi_processes ole obj Count IS NOT EQUAL TO 1 SET toolset work obj TO Create. Object(“COOLGen. Toolset”) SET model work obj TO toolset work obj. Models. Item(1) SET openapi work obj TO model work obj. Open. API … do stuff … INVOKE openapi work obj. Commit() SET openapi work obj TO NOTHING SET model work obj TO NOTHING SET toolset work obj TO NOTHING

Creating a Plug-in - Limitations • A maximum of 20 plug-ins will be recognized by the All. Fusion Gen toolset • Some diagrams may not refresh after modifications/additions/deletions made by a plug-in application • If All. Fusion Gen is used to create the plug-in application, a maximum of 80 characters allowed for parameters – Parameters will need to be parsed from the COMMAND system variable

Creating a Plug-in – Code Sample • Add a NOTE statement to an action diagram SET local_temp work type_code TO openapi work obj. Fetch. Schema. Obj. Type. By. Mnem(“TACTNOTE”) IF openapi work obj. Last. Return. Code IS NOT EQUAL TO 0 { error handling } SET local_metamodel work obj TO openapi work obj. Add. Object(local_temp work type_code) IF openapi work obj. Last. Return. Code IS NOT EQUAL TO 0 { error handling }

Creating a Plug-in – Code Sample • Update the description of the NOTE statement added previously SET local_temp work type_code TO openapi work obj. Fetch. Schema. Prp. Type. By. Mnem(“DESC”) IF openapi work obj. Last. Return. Code IS NOT EQUAL TO 0 { error handling } SET local_temp work return_code TO local_metamodel work obj. Up. Char. Array(local_temp work type_code, “Sample Note Text”) IF local_temp work return_code IS NOT EQUAL TO 0 { error handling }

Creating a Plug-in - Resources • tsauto. chm – Toolset Automation documentation – API details • odrpta. chm – Object Decomposition Report details model objects, properties and associations • Encyclopedia API guide • Transaction file dump – Perform function manually in the toolset and see what objects it creates, what properties are updated, what associations are created

Database Schema Import Facility • Read schema data from a database • Create an All. Fusion Gen model from that schema data – Tables become entity types – Columns become attributes • Provide customers with a quick way to create applications targeting existing databases

Database Schema Import Facility • ODBC used to access database schema – Catalog functions • All. Fusion Gen generated application – Uses the All. Fusion Gen ODBC support to connect to the database – EAB’s call catalog functions – External file used to create messages • Allows for messages to be translated

Transformations • Databases / Schemas become subject areas • Tables become entity types • Columns become attributes – Numeric data types become All. Fusion Gen Numbers – Character data types become All. Fusion Gen Text – Date/Time data types become All. Fusion Gen Date, Time, or Timestamp • Primary keys become identifiers • Foreign keys become relationships

Demo

Supported Database • Advantage CA-Datacom/DB r 11 SP 2 initially – Target existing Advantage CA-Datacom/DB databases – Help new users from this camp get started by reutilizing existing data • Other databases to be supported depending on customer demand

Q&A