Creating a Check
LumisXP provides a Health Check framework (HealthCheck) that allows developers to create their own validations.
Creating a health check is quite simple in LumisXP. Just add a java annotation @HealthCheck followed by the parameters name and description in your check method.
The class containing the method must have a public constructor without parameters and must be in an module installed in the portal.
Example of a validation method declaration:
@HealthCheck(name="Example Name", description="Example description of the check")
public void testCheck() throws Exception
It is through capturing the exception HealthCheckException that we will have the result of the check. It returns the status of the check and, if necessary, a message to help the user understand the result.
Below is a basic example where it checks if a randomly generated number, between 1 and 10, is equal to 2. Otherwise, depending on the generated number, a specific message is returned.
```