Managed Save Sequence (Additional and Unmanage Save)
Managed Save Sequence (Additional and Unmanage Save)
1. Standard Behavior
o Data Modification: Updates or inserts the instance data into the database.
o Lifecycle Management: Manages the lifecycle events triggered during the save process.
o Post-Save Actions: Completes any final actions after the data persisted.
o The extra save feature allows adding additional logic to the save process, such as logging
changes or triggering external services.
o Developers can implement additional steps using the save_modified method in a saver class.
4. Change Tracking
o Logs changes made to an instance, such as modified fields or newly added data.
o These changes can be written to a log table for auditing or debugging purposes.
Tuesday, December 30, 2024
By: Devi Prasad Mishra
1. Additional Save
The RAP framework supports adding extra functionality to the managed save sequence via the extra
save feature, allowing reuse of services like change documents and application logs. By default,
managed saves handle this, but additional steps can be included using the saver class and the save
modified method. When an entity instance is updated, changes are saved, including updated fields,
data, and completed operations. In this scenario, modified data is recorded in a log table.
When a new instance is created, additional data is stored in the entity's database and log table.
Steps:
In log table.
For Edit.
In log table
For Delete.
Tuesday, December 30, 2024
By: Devi Prasad Mishra
In log table
2. Unmanaged Save
Unmanaged save is ideal when the default save logic in the RAP framework (managed save)
cannot handle specific business requirements. It gives developers full control over how data persisted,
enabling customization for complex scenarios like:
Custom Table Structures: When data is stored in unconventional formats or across multiple tables.
Advanced Integrations: When saving data involves external APIs or systems.
Complex Logic: For operations requiring extensive calculations, validations, or dependencies between
entities.
Step 1: Include the unmanaged save keywords for all nodes where unmanaged behavior is required.
Here, I have used SQL queries, but instead, you can call external APIs or existing
function modules to perform Create, Update, or Delete (CUD) operations.
Tuesday, December 30, 2024
By: Devi Prasad Mishra
Create
Update
Tuesday, December 30, 2024
By: Devi Prasad Mishra
Delete
Conclusion:
In RAP applications, both Additional Save and Unmanaged Save offer essential flexibility for customizing
data persistence:
Additional Save enhances the standard managed save sequence, allowing developers to introduce
custom functionality (like logging or external integrations) while still utilizing the framework’s built-in
features for validation and lifecycle management.
Unmanaged Save provides full control over the save process, enabling developers to implement
custom Create, Update, delete (CUD) operations, such as using SQL queries, external APIs, or function
modules, for more complex or non-standard requirements.
Both methods empower developers to tailor data management in the RAP framework, ensuring the application
can meet diverse and complex business needs.