Professional Documents
Culture Documents
Application Framework - CRUD Wrappers
Application Framework - CRUD Wrappers
Structures
EntityActionMessage
o Structure containing a message and message type (i.e., error, warning, info, success).
Typically, holds the error/s encountered during CRUD operations.
EntityActionResult
o Expected output for all CRUD operations. Contains an IsSuccess boolean flag, the
combined output message text and type, and a list of EntityActionMessages.
Server Actions
EntityActionResult_CombineEntityActionMessages
o Input: EntityActionMessage list
o Output: CombinedEntityActionMessageText, CombinedEntityActionMessageType
o Combines all messages during the CRUD operation to one text variable separated by a
new line. Message type is determined by the following hierarchy: Error > Warning > Info
> Success (e.g., in an operation with multiple success and errors, combined type is
error). Typically used for CRUD operations with failed validations.
EntityActionResult_BuildFromSuccess
o Input: EntityActionResultMessageText
o Output: EntityActionResult
o Accepts a “Success” prompt and sets the IsSuccess flag to true. Used for a successful
CRUD operation.
EntityActionResult_BuildFromError
o Input: EntityActionResultMessageText
o Output: EntityActionResult
o Accepts a “Failed” prompt and sets the IsSuccess flag to false. Typically used for a CRUD
operations with errors.
Session_GetNormalizedSessionUserId
o If session exists, returns the active user’s Id (CRUD operations coming from the UI); else,
returns the default system user Id (CRUD operations initiated by system processes e.g.,
timers, BPT, etc.).
Entity_Upsert (Update/Insert)
CRUD wrapper for creating and updating entity records.
Entity_Validate
CRUD wrapper for validating record. Used to validate format, null values, date ranges, min/max
values/lengths, etc.
Entity_Remove (Delete)
CRUD wrapper used for soft/hard deleting records.
Input: Entity Id (Id)
Output: EntityActionResult
Sample Implementation (refer to SIF_CS):
Entity_GetCanRemove
CRUD wrapper that validates if record is safe to remove.
Input: Entity Id (Id)
Output: EntityActionResult
Sample Implementation (refer to SIF_CS):