Prev Next

Intermediary Language Debugging

The script from an MDA template produces intermediate language text. However, on generating the model this script could return errors. When an error occurs, you can view and debug the generated text externally, preferably in an editor that prompts on updates to the file alterations.

Access

Ribbon

Design > Tools > Transform > Transform Selection

Keyboard Shortcuts

Ctrl+H (transform selected elements)

Ctrl+Shift+H (transform current Package)

Debug when errors are returned on generating altered code

Step

Description

See also

1

Select the Package to be transformed, and the 'Transform Package' option.

The 'Model Transformations' dialog displays.

Transform Elements

2

In the 'Name' column, select the checkbox against the type of transformation being altered.

3

In the 'Intermediary File' field, click on the button and set the file location into which to generate the code.

4

Select the 'Write Always' checkbox, and click on the Write Now button to generate the script.

This only generates the script, not the model.

5

If an error is returned specifying the line number of the problem, open the file in an external Code Editor (with Line Numbering) and locate the line number of problem.

6

Alter the template code to correct the error.

7

Click on the Do Transform button to check that the alteration has corrected the problem.

Example

For a MySQL database, the template code might resemble this:

$enumFieldName = “test”

Column

{

name= %qt%% CONVERT_NAME ($enumFieldName, "Pascal Case", "Camel Case")%%qt%

type= %qt%% CONVERT_TYPE (genOptDefaultDatabase, "Enum")%%qt%

}

This returns the output in the generated text file as:

Column

{

name = "test"

type = "ENUM"

}

If there is an error in the original transform, such as a spelling error - ‘Colum’ - clicking the Do Transform button returns an error message referring to the first line of intermediate code that includes the error 'Colum’.