Altova UModel 2025 Enterprise Edition

If a DLL is added to UModel as a plug-in, it is necessary that it registers a COM component that answers to an IUModelPlugIn interface. The IUModelPlugin interface exposes the following methods, all of which must be implemented by a client plug-in.

 

OnInitialize

OnRunning

OnShutdown

GetUIModifications

GetDescription

OnCommand

OnUpdateCommand

 

Method Declaration

Usage

OnInitialize(pUModel as IDispatch)

The OnInitialize method of the interface implementation is called when the plug-in is initialized and before DDE or batch commands are processed.

 

You can attach notifiers and listen to UModel events, but should not start new commands / modifications until the OnRunning method is called.

 

pUModel holds a reference to the dispatch interface of the Application object of UModel.

OnRunning(pUModel as IDispatch)

The OnRunning method of the interface implementation is called when the plug-in is initialized and after DDE or batch commands are processed.

 

The application is now fully initialized and you can start new commands / modifications and modify UML data.

 

pUModel holds a reference to the dispatch interface of the Application object of UModel.

OnShutdown(pUModel as IDispatch)

The OnShutdown method of the interface implementation is called immediately before the plug-in is unloaded (e.g. because the application will shut down).

 

pUModel holds a reference to the dispatch interface of the Application object of UModel.

GetUIModifications() as String

The GetUIModifications() method is called during initialization of the plug-in, to get the configuration XML data that defines the changes to the UI of UModel.

 

The method is called when the plug-in is loaded for the first time, and at every start of UModel.

 

See Configuration XML for a detailed description on how to change the UI.

GetDescription() as String

 

GetDescription() is used to define the description string for the plug-in entries visible in the Customize dialog box.

OnCommand(nID as long, pUModel as IDispatch)

The OnCommand() method of the interface implementation, is called each time a command, added by the  plug-in (menu item or toolbar button), is processed.

 

nID stores the command ID defined by the ID element of the respective UIElement.

 

pUModel holds a reference to the dispatch interface of the Application object of UModel.

OnUpdateCommand(nID as long, pUModel as IDispatch) as UModelUpdateAction

The OnUpdateCommand() method is called each time the visible state of a button, or menu item, needs to be set.

 

nID stores the command ID defined by the ID element of the respective UIElement.

 

pUModel holds a reference to the dispatch interface of the Application object.

 

Possible return values (as defined in UModelUpdateAction) to set the update state are:

 

UModelUpdateAction_Enable

= 1

UModelUpdateAction_Disable

= 2

UModelUpdateAction_Check

= 4

UModelUpdateAction_Uncheck

= 8

 

Values can be combined using the bitwise OR operator (for example, UModelUpdateAction_Enable | UModelUpdateAction_Check ).

 

For a very simple interface implementation example, see Implement IUModelPlugIn Interface. Other sample implementations are available (as Visual Studio solutions) at the following path: C:\Users\<username>\Documents\Altova\UModel2025\UModelExamples\IDEPlugIn.

 

The sequence diagram below shows how UModel interacts with IUModelPlugIn:

um_IUModelPlugIn

© 2018-2024 Altova GmbH