The Backend has the opportunity to trigger UI-Messages, which are created/triggered in the backend as part of the Businesslogic, but are displayed in the UI. This allows easier migration of old logic, where data access and UI were not separated.
There are 2 basic types: Messages and Questions.
The difference is that Messages are just displayed in the UI, and after they are displayed (and confirmed in case of a modal message) the UI does nothing. Questions instead require an action/answer from the User. Hence, when displayed in the UI they provide additional buttons like yes/no, which the user can select from. After selecting a button, the backend call is immediately re-performed, providing information to the backend about which button has been clicked. It is then the task of the Backend-code to check for the answered questions and perform the correct logic.
The Message-functionality is available in Business-Tasks (when invoking BT-Methods) and Business-Entities (when submitting Records for create, update, delete).
In the Backend, Messages can be created using the message-API:
Typical methods that contain code for creating ui-messages:
Type | visualizationj Sub-types | update behaviour | UI behaviour | Visualisation Modal/Non-Modal | Sample backend code |
---|---|---|---|---|---|
Questions | Info / warning | while questions pending it will always undo, when all questions answered it depends on answers and/or the business-logic | Show question, after user clicks button, re-perform backend call, unless user pressed cancel | M | |
Messages | |||||
- Info-Message | Info / warning | Commit | Show message | M / N | |
- Validation-Message | Info / warning / error | undo | Show validation message | M / N | |
- Runtime-Error | error | undo | show error message, in a promise (e.g. BusinessTask) the FAIL path will be executed | M / N |