Debugging maps

This section provides the following information about debugging a map:

For information on how to test relationships, see "Testing maps that contain relationships".

Resolving run-time errors

Even if your map compiled successfully, you can get a run-time error during the map execution in the Debugger.

Example: You have an outbound map with the generic business object on one side and an application specific business object on the other side. Let us assume that this map has an identity relationship in it.

  1. Go to the Test tab and select the calling context SERVICE_CALL_REQUEST.
  2. Select the verb "Update."
  3. Run the test.

    Result: An error message like the one below displays:

    Exception at step 17, attribute <attribute name>,java.lang.nullpointerexception
     
    

This exception is happening because the map is trying to update an entry in the repository that is not created in the first place. Ideally, you should ensure that the sequence of steps is correct. You should look at the database for relationship entries pertaining to the map in question. You should then draw the conclusions based on whether it is ready for SERVICE_CALL_REQUEST or not.

Debugging tips

This section provides the following tips for making the debugging of a map easier:

Using logging messages

Use the logInfo() method for tracking the map execution. It takes a String as an argument, which is sent on the InterChange Server Express log. You need to type it in the Activity Editor for the attribute whose execution needs to be tracked. To make sure that the submap is executed, create a custom transformation rule and use the "Log Information" function block to customize the activity.

You might not always want to see this message. If this is the case, change the DataValidationLevel property of the map.

To set the DataValidationLevel, select the Map Properties option from the Edit menu of Map Designer Express and change 0 to 1 or a greater number. The settings are as follows:

0 No data validation
1 IBM data validation level
2 or greater User-defined data validation

Writing safe mapping code

If you customize your transformation rule in the Activity Editor, you are not guaranteed that it will work properly during run time. To make sure that the map continues executing when an error occurs and you get a notification of an error, use the "Catch Error" function block in the Activity Editor and handle the error appropriately.

Copyright IBM Corp. 2003