There are separate error messages and reporting mechanisms for each type of validation performed by a Service. You can control the amount of debugging information in the error messages you receive by using the debug flags as parameters when you call the command() method. The library’s error parser provides the following debug levels:
Regular Information: Gives general information, and if an error occurs, the path to the node or piece of data that caused the error.
Debug: Gives all of the node information generated by the parse, that is, each field and subfield.
Parser Debug: Combines the debug level with information regarding just what the parser is matching, and the data being used. In general, you only need to use this level for situations where the error cannot be determined using the other levels because of the quantity of data. This level gives the exact location and nature of the failure.
Error message file output appears at the end of any message that generates an error.
The available debug level flags are:
A or a: Enables the abbreviation of path names. This reduces the path output when you are printing to a Regular Information set.
D or d: Enables Debug (mid-level) debugging. If enabled, this generates more debug data than the Regular Information level, but less than the Parser Debug level.
I or i: Enables Regular Information level debugging.
L or l: Enables saving and display of the last successfully parsed node. When a parse has failed, this information is the last item printed by the current root node.
P or p: Enables the Parser Debug-level information. If enabled, this generates the maximum information about what the internal parser is doing.
Using the Debug Level flags, you can configure the debugging information you receive by setting the appropriate debug parameter in the OTD’s command() method. For example, to set the error message level to the Regular Information level (I flag), with abbreviations turned on (A flag), you would set command() with the parameters A and I. You can do this from the Collaboration Editor’s Business Rules Designer as displayed below.
This produces the following Java code (this example uses the mt_202 Validation Collaboration:
mt_202_1.command( "AI" ); |
Calling command() enables any of the debug functions presented as a parameter. For more information, see the SWIFT OTD Library Javadoc.