Developing Maintenance Extensions

Maintenance extensions must use the same buffer structure as the original maintenance. The only change allowed is to add possible new default values. Thus a maintenance extension with its annotation might look like this:


/**
 * @version $Revision: #1 $
 * @MaintenanceExtension (serviceName = CILTALTP,
 *      newDefaults={ @JavaNameValue (value = TEST, name = test)
 *                  }
 *      )
 */
public class AlgorithmTypeMaintenanceExtension
    extends AlgorithmTypeMaintenanceExtension_Gen {
   }

The maintenance extension will have its superclass generated to give easy access to the STRUCTURE definition and HEADER and DEFAULT constants, as well as provide an easy hook for any future functionality that might need to be inserted.

You must use the constants on the STRUCTURE or HEADER structure definitions to reference input header fields or which output fields to populate.

The maintenance extension can then override any methods needed to provide its functionality. Some examples of methods available are:


    /**
     * Process a default
     * @param defaultValue the raw string value of the default (can compare
     *     against DEFAULTS constants)
     * @param item the item to be modified with default values
     */
    public void processDefault(String defaultValue, DataElement item) {}

    /**
     * Process the data after the whole add (root and chidren) action is
     *     done.
     * @param originalItem the input item
     */
    public void afterAdd(DataElement originalItem) {}

    /**
     * Process the data after the whole read (root and children) action is
     *     done.
     * @param result the output item
     */
    public void afterRead(DataElement result) {}


    /**
     * Process the data after an element of the given list has been read.
     * @param listName the list name
     * @param outputElement the output element
     * @param sourceEntity the just read entity
     */
    public void afterPopulateElement(String listName,
        DataElement outputElement, BusinessEntity sourceEntity) {}

    /**
     * Process the data after an element of the given list has been changed.
     * @param listName the list name
     * @param inputElement the input element
     * @param changedEntity the changed entity
     */
    public void afterChangeElement(String listName,
        DataElement inputElement, BusinessEntity changedEntity) {}

    // ...

The complete list can be found in the hierarchy of the extension class (e.g., AbstractMaintenanceExtension) http://www.python.org/