MDL View
Last updated
Last updated
The MDL View allows the user to write and execute Vault MDL (Metadata Definition Language) commands to configure a Vault or automate tasks by writing scripts which manipulate the various Vault component types.
The MDL View offers advanced code editing and debugging functionality, such as MDL syntax highlighting, auto-complete functionality for MDL commands, setting breakpoints, stepping through code during execution, logging responses from the server as commands are executed, executing a sequence of commands as a script, etc.
The MDL View is divided into an upper and lower area - the upper area is the code editor area, while the lower area is the log viewer which displays output and error messages in response to the MDL commands/script being executed.
The bottom border of the code area can be dragged with the left mouse button to split the MDL work area between the code and log windows as per the user's preference (e.g. view more of the code editor or show more log output).
MDL code can be typed/edited directly in the upper code editor area of the window, pasted from the clipboard or loaded from/saved to an external file:
Paste from clipboard: you can paste any text copied to your clipboard into the MDL code editor by using the default Ctrl+V shortcut or selecting Paste from the MDL code editor's context menu. The text will be inserted at the cursor's position.
Load from file: Either use the Load Script action from the Edit main menu, the Script Navigator (folder tree) or drag-and-drop the file from your filesystem to the MDL view in dqMan Veeva Vault Edition.
Save to file: Use the Save Script action from the Edit main menu or from the MDL code editor's context menu in order to save MDL you have edited in dqMan Veeva Vault Edition to an external file.
Individual statements or scripts can be executed in several ways. It is also possible to step through scripts, pause, or stop a running script. You can control the execution using the action buttons to the right of the main toolbar.
Command | What It Does |
---|---|
Executes the currently active statement (where the cursor is located) | |
Executes all MDL statements as if they represent a script The arrow to the right of the Run Script button opens a menu with a number of options on how the script should be executed: Run Script - run all code sequentially as a single script from top to bottom Send statements one by one - sends all statements to be executed individually one after another starting from top to bottom Execute script asynchronously - the script is sent to the server to be executed asynchronously as a job. dqMan check the result of the job execution and returns the cursor to the user only after the job result is displayed in the Script Log section | |
Executes the script one statement/command at a time, requiring the user to initiate each step by pressing this button repeatedly. The next statement/command to be executed is always highlighted. This is ideal for debugging complex scripts or simply following the individual processing steps a script performs. | |
Pauses a running script and switches to debug mode. The next command will be highlighted. | |
Stops the execution. |
Note that some of the above commands may not be available depending on the type of code being executed and/or if execution times are too short for the user to interact with the buttons during runtime.
Additional functions are available in the context menu:
Run to Cursor executes all commands from the current cursor position or from the beginning to the selected line. The command in the current line is highlighted and debug mode is turned on.
In debug mode, you can select to execute the next command using Set Next Statement. This can be used to place the next statement/command that will be executed anywhere in the code, thus skipping errors or unneeded steps.
Breakpoints can also be set to control the execution of a script. Any number of breakpoints can be set anywhere in a script using the Set/Remove Breakpoint context menu items respectively. Breakpoints will be set/removed on the line where the context menu is opened, and will be marked with a red dot to the left of the line as well as highlight. It is also possible to remove all breakpoints at once when they are no longer needed using the Clear All Breakpoints context menu item.
Breakpoints cannot be set on empty lines.
Breakpoints can only be set on the starting line of a statement, not "inside" it.
Trying to set a breakpoint in a location where it is not allowed will move the breakpoint automatically to the starting line of the closest statement/command.
The Script Navigator is a folder tree for all available local drives, enabling quick access to MDL command/script files stored on the user's machine.
The Script Navigator is optional and can be closed if the user prefers to open MDL files by other means (e.g. using Load Script from the context menu or simply dragging an MDL file into the MDL code editor)
You can open a selected script using the Return key or by double-clicking it. Open scripts are marked as such until the session window is closed. Additionally, you can toggle the marks using the function Mark as New and/or Mark as Opened from the context menu.
The option Stop on Errors in the script editor's context menu defines the error handling behavior:
When this option is active, the script pauses in case of error and highlights the faulty statement/command. The statement or command affected by the current error will be highlighted in its entirety (even if it spans multiple lines) to clearly show which part of the script is affected.
In this case you can only resume script execution by fixing the error OR manually setting the next line to be executed beyond the point where the error occurred, thus skipping the error entirely (see description of Set Next Statement in #_toc105765626 above)
If this option is inactive, the script will not stop execution but will display error messages in the result log.
Error handling will always pause on any error, prompting you to take action before resuming execution (for example, to fix the error or place the cursor after the error to skip it).