You can create XML add-ins to group multiple commands for calling executable programs or VB scripts and add them to PowerDesigner menus.
The following illustration helps you understand the XML file structure:
The Profile is the root element of the XML file add-in descriptor and can contain:
A Shared element - which defines the menus that are always available and their associated methods, along with a GlobalScript attribute, which can contain a global script for shared functions.
One or more Metaclass elements - which define commands and menus for a specific metaclass, identified by its public name prefixed by its Type Library public name.
<?xml version="1.0" encoding="UTF-8"?> <Profile> <Metaclass Name="PdOOM.Model"> <Menus> <Menu Location="Tools"> <Popup Caption="Perforce"> <Command Name="CheckIn" Caption="Check In"/> <Separator/> <Command Name="CheckOut" Caption="Check Out"/> </Popup> </Menu> </Menus> <Methods> <Method Name="CheckIn"> Sub %Method%(obj) execute_command( p4, submit %Filename%, cmd_PipeOutput) End Sub </Method> <Method Name="CheckOut"> Sub %Method%(obj) execute_command( p4, edit %Filename%, cmd_PipeOutput) End Sub </Method> </Methods> </Metaclass> </Profile>
<?xml version="1.0" encoding="UTF-8"?> <Profile> <Shared> <GlobalScript> Option Explicit Function Print (obj) Output obj.classname & " " & obj.name End Function </GlobalScript> </Shared> <Metaclass Name="PdOOM.Class"> <Menus> <Menu> <Popup Caption="Transformation"> <Command Name="ToInt" Caption="Convert to interface"/> <Separator/> </Popup> </Menu> </Menus> <Methods> <Method Name="ToInt"> Sub %Method%(obj) Print obj ExecuteCommand("%MORPHEUS%\ToInt.vbs", "", cmd_InternalScript) End Sub </Method> </Methods> </Metaclass> </Profile>