Guard Clauses are conditional checks placed at the beginning of an action to validate input parameters or preconditions. If the conditions are not met, an exception is thrown, preventing the execution of the rest of the action.
Why Guard Clauses?
Why do I need it in OutSystems?
Even though setting parameters as 'mandatory' ensures some correctness, it is still possible to fill them with null or empty values. Furthermore, when the parameters come from computed values (like the result of another action), there is little to no guarantee that they are in the format we expect.
Guard Clauses in OutSystems serve as indispensable guardians of your application's integrity, promoting data correctness, simplifying error handling, and bolstering code reliability throughout the development lifecycle.
Added new constraints:
- EnsureTextMaxLength
- EnsureTextMinLength
- EnsureNumberAtMax
- EnsureNumberAtMin
Converted app to service
Improved descriptions