I am using IBM DOORS 9.6 and I aim to develop some DXL code to implement addons. I have read all the documentation and I have analysed several examples on the web. But for some reasons, none of the scripts I have tried so far execute successfully. Yet, everything seems fine. I can't say if the error comes from something I miss or from the installation. I have reinstalled DOORS several times, checking that all required options were enabled. Here is an example of code that fails:
// Define a new menu
Menu eCollabMenu = menu("eCollab")
// Define actions for each menu item
void loginAction(Menu m) {
print "Login action triggered\n"
}
void pushAction(Menu m) {
print "Push action triggered\n"
}
void pullAction(Menu m) {
print "Pull action triggered\n"
}
// Create menu items and assign actions
MenuItem miLogin = menuItem("Login", loginAction)
MenuItem miPush = menuItem("Push", pushAction)
MenuItem miPull = menuItem("Pull", pullAction)
// Add items to the menu
add(eCollabMenu, miLogin)
add(eCollabMenu, miPush)
add(eCollabMenu, miPull)
// Attach the menu to the main menu bar
addMenu(eCollabMenu)
Thanks in advance for any help. Regards.
Well, yes, almost all the syntax is wrong, as neither the types Menu
nor MenuItem
exist in DXL AFAIK.
There is a section "Module menus" in the DXL manual which explains the details. Also, look at the instructions and the example created by Tony Goodman at http://www.smartdxl.com/content/?p=432.
Note that a menu item in DOORS is never a call to a function (like loginAction
in your example), but a reference to an existing DXL file which contains the code to be executed.
I prefer the method to start DOORS with parameters -addins <path/to/ModuleExplorerMenus> -projectaddins <path/to/DBExplorerMenus>
and prepare the menu structure as IBM suggests in https://www.ibm.com/support/pages/how-add-custom-menu-doors-modules