- Builder
- Data Types in Codejig Builder
- Composite Data Types
Composite Data Types
Composite Data Types model complex entities such as employees, orders, or products. These types consist of fields, views, actions, type settings, and seed instances—defining the structure, behavior, and presentation of the entity.
Key Components:
Fields: These represent data elements and are categorized into:
- Regular: Hold standard values (e.g., text, numbers, or references to other composite types).
- Collection: Store multiple values, similar to lists or arrays.
- Shared: Reused across different composite types, ensuring consistency.
- Dynamic: Untyped fields that can reference any composite type with a metaObject field.
Views: Define how data is presented or exported, such as web pages, tables, JSON, or MS Word. Some views are interactive for data input (e.g., forms), while others support data export/import, such as JSON for APIs.
Actions: Define the behavior of the composite type in response to events like loading, saving, or other custom triggers. Developers can create workflows using block-based logic or advanced custom logic (including native code), giving them the flexibility to implement specific business rules and extend the system's capabilities.
Type Settings: Control how the composite type behaves in the system, including:
- System Name: For internal references in code and database tables.
- Permissions: Manage who can access and modify the data.
- Sequences: Control numbering or ordering of records.
- History Tracking: Logs changes made to records.
- Menu and Categories: Organize how the type is displayed in the system interface.
Seed Instances: Predefined data entries that are automatically generated when the composite type is created. These serve as default records or templates to help with initial data setup.
Different Kinds of Composite Data Types:
- Directory: Used for entities that are frequently referenced across the system (e.g., employees, products).
- Document: Handles accounting events or transactions, supporting posting and unposting mechanisms.
- Journal: Stores bookkeeping records automatically generated by documents. Manual modifications are not allowed.
- Report: Aggregates and analyzes data, producing reports.
- Embedded: Tightly linked to another composite type and edited together with its parent.
- Transient: Temporary objects for runtime calculations that are not stored in the database.