Maintenance of code in the workspace

When code generation is performed, files are created that reflect the names of elements present in the MDM development models.

In addition to files named after these elements, references to these names also appear within the files in the form of method or variable names and so on.

During the development cycle, model changes must be reflected in the generated code. Where elements are renamed or deleted, the files must be changed accordingly. This maintenance process is performed each time code generation takes place and is the first step in the process. Depending on the nature of changes to MDM development models, this maintenance process can result in the following activities:

When code generation is performed, the files present in the workspace are examined to locate any files that need to be updated as a result of model changes. These files are then presented in a dialog allowing you to examine the list and deselect any files you wish to keep and process manually. Selecting Update will process the checked files as required before continuing with code generation. Selecting Skip Update will prevent any updates from occurring and simply proceed to code generation.

The information is presented in a tree structure with elements that cause the maintenance to be necessary presented at the top of the tree. Expanding the tree shows the files that will be updated.

In some cases, the removal of a specific file then requires other files to be removed from the workspace. The effect is groups of files that must be removed together if they are to be removed at all. This is reflected in the tree structure where this grouping is reflected and enforced.

Maintenance actions

Unless an alternative is indicated in square brackets after the file name, the default action is to delete the affected file. During code maintenance there are two possible actions that can be performed.

Remove action

No action is explicitly listed in brackets after the file name. If checked, then the file will be deleted from the workspace when the Update button is pressed. This is the most common action taken during workspace code maintenance. If necessary, the Eclipse local file history or source code control system can be used to recover deleted files.

If the file to be deleted has been edited, the maintenance process will archive the file prior to its removal. The archive file name reflects that of the original file with a postfix added to the end.

The Backup customized files option is available in the maintenance wizard and selected by default, but it but can be disabled if required.

Just as with code generation, modified files must be identified with @generated NOT within the file

Modify action

The file needs to be modified to make it consistent with the MDM development models. This is typically required when a file contains content relating to multiple model elements. This action is displayed in square brackets after affected files.

Renaming files as a result of model changes

Where an MDM development model element name has changed, the maintenance wizard will delete files associated with the old name. These changes will show in the maintenance wizard as delete actions. Subsequent code generation will then create replacements with the new file names. For this reason, there is no explicit rename action.

Identifying files for maintenance

To be eligible for maintenance files must have a recognizable location, file name structure, and content.

In addition, the contents of each file is checked for a special marker in a comment line, which was added when the file was first generated.

An example of such a marker follows:

// IBM-MDMWB-1.0-[d3e9f90d3d26ea424db7f984d2afafef] 

The marker represents a link from the generated file back to the MDM development model element, which caused the file to be created. Older versions of the workbench did not generate this comment line.

Files identified for maintenance that have a valid marker comment line will be included in cleanup by default and preselected for processing.

Files identified for maintenance that do not have a valid marker comment line can be optionally included in the cleanup by enabling the Include potentially redundant artifacts that could not be verified automatically option in the maintenance wizard. Once this option is selected you must then manually confirm those files you want to process.

Handling workspace maintenance automatically

You can select the Always update workspace automatically option when the workspace maintenance wizard opens to handle this process automatically in the future.

To disable automatic maintenance, open the Window > Preferences menu, select the InfoSphere Master Data Management tab and disable Always update workspace automatically.

Disabling workspace maintenance

To enable or disable workspace maintenance altogether, open the Window > Preferences menu, select the InfoSphere Master Data Management tab and enable or disable the Update workspace before code generation option.

General workspace maintenance settings

Configuration settings controlling workspace maintenance are available in the Preferences panel. To access these settings, open the Window > Preferences menu, select the InfoSphere Master Data Management tab. The following options are available:


Last updated: 23 October 2014