Introduction to the Component_Process_Links Table
The component_process_links table is designed to establish and maintain relationships between components and processes in the Serial database. This table plays a crucial role in organizing the workflow and structure of component processing within the system.Table Structure
The component_process_links table is structured to efficiently link components to their associated processes while maintaining order and versioning information. Here’s a detailed breakdown of its columns:| Column Name | Data Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key, default uuid_generate_v4() | Unique identifier for each link |
| company_id | uuid | not null, foreign key | Reference to the company owning this link |
| component_id | uuid | not null, foreign key | Reference to the component being linked |
| process_id | uuid | not null, foreign key | Reference to the process being linked |
| order | bigint | not null | Specifies the order of processes for a component |
| is_active | boolean | not null, default true | Indicates whether the link is currently active |
| process_revision | bigint | not null, default 1 | Tracks the revision of the process in this link |
Usage and Functionality
The component_process_links table is designed to be a flexible and powerful tool for managing the relationships between components and processes. Here are some key points about its usage:-
Active Link Management: The table allows for soft deletion of links through the
is_activecolumn, enabling historical tracking while maintaining current relationships. -
Process Ordering: The
ordercolumn facilitates the sequencing of processes for a given component, allowing for structured workflows. -
Revision Tracking: By including the
process_revisioncolumn, the table supports versioning of processes, ensuring that components are linked to the correct version of a process. -
Company-Specific Relationships: The inclusion of
company_idensures that links are properly segregated by company, supporting multi-tenant functionality.
Notes
-
The table is often queried to retrieve only active links of active components, excluding links to processes of type “Instantiation”. This can be seen in the following example:
- The table is involved in transactional deletions of components, ensuring that all related links are properly removed when a component is deleted.
- It plays a role in retrieving component genealogies, helping to establish the hierarchical relationships between components based on their associated processes.
- The table is updated automatically when process revisions change, ensuring that links always reference the most up-to-date process information.

