...
The model adapter should be as far as possible made configurable and must be done in a consistent way.
Log messages and diagnostics
External Modules and their adapters can be written in any programming language. However, in case Java is used, they have to implement the interface ModuleAdapterRunnable. Modules and module adapters can only communicate with the General Adapter via the Published Interface. The only 2 means to exchange information with the General Adapter are:
- The return code indicating the result of an execution. A return code of 1 indicates a successful execution, all other codes other than 0 execution failure.
- A diagnostic file written in the Published Interface format. If such a diagnostic file is available the General Adapter will read it and write corresponding logs to the FEWS system.
Modules and their adapters cannot use exception or event handling as a means to communicate with the General Adapter.
Return code error information
The GA distinguishes between two types of failures of a module or module adaptor, graceful and non graceful.
- On non graceful failure the GA expects a non-zero return code
- On graceful failure the GA expects a zero return code. The type of error and the accompanied message are stored in the diagnostics file according to the GA.
Actions taken by the GA on:
- a non graceful failure or on a graceful failure that indicates a fatal error (see the definition of the diagnostics file below)
- the GA will make a binary dump of the entire module configuration (a list of directories supplied by the module adaptor constructor).
- The GA will stop processing the remaining instructions.
- all other occasions
- the messages in the diagnostics file are passed on to the event logging system
- further operation is continued
Diagnostics file
The published interface documentation describes the (simple) xml file format. Per batch (pre processing - module run - post processing) one diagnostics file is always expected. Each line/message in this file contains the actual text and the warning level attached to this text. The warning levels in the diagnostics file will be interpreted by the general adapter. according to the following table:
Level | Name | Description | Example |
---|---|---|---|
3 | info | information, all is well | Module PreProcessor : program ended |
2 | warning | warning information | Module Processor : unresolved symbol |
1 | error | critical problems | Module Processor: module fails (returns 1) |
0 | fatal | fatal error, complete module crash | Module Processor: division by zero |
All levels higher than 3 are regarded as non-essential (debug) information. The warnings are recorded in the system, but no actions will be taken. Please see the PI Documentation
Children Display | ||
---|---|---|
|