Skip to content

Form Service

Form Service is a service within the Platon platform designed to manage dynamic forms, including creation, updating, deletion, and restoration.
It prepares form meta-data according to user requests, enforces access control, and logs operations to the centralized system.


Overview

Form Service provides the following capabilities:

  • Creating, updating, deleting, and cloning forms
  • Preparing form meta-data (create, update, restore)
  • Processing user-submitted data
  • Persisting records in the database
  • Preparing form components tailored to the user
  • Managing public and private forms
  • Ensuring fast performance via caching
  • Logging errors and operations to a centralized system (via NATS)

Database Interactions

Form Service performs the following database operations:

  • Create: Creates a new form record using user-submitted data and persists it in the database
  • Update: Updates existing form records and saves the changes
  • Delete: Performs logical or physical deletion of form records
  • Restore: Restores deleted or archived form records
  • Clone: Copies an existing form record and saves it as a new record
  • Block/Unblock: Sets or removes the blocked status of a form record and manages user access
  • Retrieve: Fetches forms and components from the database, applying access control rules

All CRUD operations are transactional and tied to the user session context.


Architecture Components

  • Form Handler: Implements business logic for creating, updating, cloning, and deleting forms
  • Form Loader: Prepares form meta-data and components
  • Access Validator: Checks user permissions for forms and components
  • Cache Manager: Stores forms and components in cache for fast access
  • Database Manager: Performs CRUD operations and manages transactions
  • Logging Service: Sends errors and operations to the centralized system (via NATS)
  • Session Context: Manages user session data and request parameters

Form Management Capabilities

  • Create, update, clone, delete, and restore dynamic forms
  • Manage form records in the database using CRUD operations
  • Prepare form meta-data tailored to user requests
  • Enforce user access permissions for forms and components
  • Distinguish between public and private forms and enforce access rules
  • Merge user-submitted data from request bodies with forms
  • Log errors and critical operations to the centralized system

Cache and Performance

  • Form meta-data and components are stored in cache
  • Ensures fast access and reduces server load
  • Cached forms are automatically refreshed at defined intervals
  • Newly created or updated forms are added to cache automatically
  • Obsolete or unnecessary forms are removed from cache

Access Control

  • Access to forms and components is controlled based on user permissions
  • Role and permission checks determine whether a user can access a given form

Logging and Monitoring

  • User requests and form operations are logged
  • Errors and successful operations are sent to the centralized system via NATS
  • Blocked records and form statuses are monitored centrally

Summary

Form Service in the Platon platform enables modular and component-based form management, prepares forms according to user permissions, persists form records in the database, and ensures fast access via caching.
It manages public and private forms, supports blocking/unblocking records, and logs errors and critical operations to a centralized system.