DOCS

User Exit Example

This appendix presents a user exit example designed to enforce constraints on the contents of a text attribute: A date to be stored must be within a specified range. To accomplish this, the example uses an attribute-operation user exit of type ON_SAVE. The user exit code is stored in a RO_EXECUTABLE item named DateCheckUserExitSample.

In the metamodel, this entry in the AP-INTERFACES attribute of an AP-TEXT-ATTR item registers the user exit for the corresponding text attribute.

POST-EDIT-JAVA DateCheckUserExitSample begin=01/01/2005 end=05/31/2005

The entry is the same no matter what implementation language is used. You can predefine the constraints, in this case the range of dates, by specifying arguments. The argument names and values are passed exactly as defined in the user exit definition line, which means no case conversion is done. The sections below demonstrate how you can implement this user exit in the available languages and how they access their arguments.

To know more on user exits, see the documentation of the interface de.rochade.ap.ApUserExit in the Java API documentation.