Unit 3 - Lesson 5 - Validation Flashcards
Explain the different types of validation in Curam
- Modeled validations
- Server-side validations
** Coded in Java
** Use informational manager for exceptions
** Failed validation may result in transaction rollback
**
Sample: check Registration date is before DateOfBirth. Check whether Person is already registered with first name and last name - Client-side Validations
** Java on the Web server
** JavaScript on the browser
** Saves a round trip to the application
Sample: Is a date in the right format (infrastructure validation)
Implement modeled validations
** Defined in Curam model
** Associated with a Domain Definition
** Performed on the Client (web server or browser)
** maximum, minimum values, minimum number of characters, pattern match
Sample: check at least 3 characters are entered for PERSON_NAME, ensure age between 18 and 120.
Explain the purpose of the Information Manager for server validation
*Present multiple messages to the user t one time. e.g. several warnings occur independently during the course of validation.
*To use Information Manager get instant of the InformationalManager.class
curam.util.exception.InformationalManager im = curam.util.transcation.TransactionInfo.getInforamtionalManager();
*Messages are added by calling addInformationalMsg(AppException or LocalisibleString)
InformationalType parameter is used to specify type:
** Warning
** Error
** Fatal Error (results in throwing an AppException)
Describe the difference between post-processing informational messages and validation messages
- Used to notify the user of warnings encountered during processing
- No exception is thrown
- failOperation() is not called in the code
- The transaction completes
- Messages must be returned to the client from the server application
- Return messages as you would return any server data
Implement server validation and post-processing informational messages
Informational message is modelled as a 0..n aggregation of a struct that contains an Unbound String.
To model output paramenter, it is necessary to return a list of strings. This is modelled by including a 0..n aggregation between existing return parameter and a new structure, which includes an Unbounded String. This string is used as a source connection to the Informational element in the UIM page.
Explain modelled validations
Modelled using RSA. By default, generator creates Java Code for the modelled validation that executes in the web server or container. However, a configuration parameter ca be set to tell the generator to create JavaScript for the modelled and infrastructure validations, which executes in the web browser.
Explain modelled validations type
** Defined in Curam model
** Associated with a Domain Definition
** Performed on the Client (web server or browser)
** maximum, minimum values, minimum number of characters, pattern match
Sample: check at least 3 characters are entered for PERSON_NAME, ensure age between 18 and 120.
Validate Mandatory fields
Specified in the model for a parameter of a page-related operation, such as insert and modify.
Specified for particular attributes rather than domain definitions.
Accessed by selecting ‘mandatory field’ parameter of an operation. Coma separated string. Aggregated structs must prefix the field with the role name of the struct. e.g. info.accountName.
NOT NULLABLE database field doesn’t make it a mandatory input field.
Informational Error types
** Warning
Continue with further validations
If no errors are found, user will get a warning
** Error
Continue with further validations
Operation should eventually fail
Allows for multiple errors to be displayed
** Fatal Error (results in throwing an AppException)
No further validations should be performed
Operation will fail immediately
Informational to User
It is possible to return these messages as an exception so the transaction is rolled back
- by calling addInformationalMsg() with validation level kFatal
- By calling method failOperation()
- If there are any messages of type kError or kWarning, the transaction is rolled back.
Consolidation Messages
InformationalManager.obtainInformationalAsString()
Enables all informational messages to be output as a string.
This String array of messages must be converted to a list of structs before being returned to the client.
Informational Manager client side
INFORMATIONAL element, only needed if using the return parameter populated with informational of type kWarning.
Normal exceptions will be displayed automatically.
PAGE > INFORMATIONAL > CONNECT > SOURCE (attribute containing the message)