We’re implementing a custom CAPA data model in Arena QMS 2022.1 where we need to link multiple root causes to a single CAPA record with specific relationship types (direct, contributing, underlying). The entity-relationship enforcement is failing during save operations.
Our current mapping attempt:
ALTER TABLE capa_root_cause_link
ADD CONSTRAINT fk_capa_id FOREIGN KEY (capa_id)
REFERENCES capa_master(id) ON DELETE CASCADE;
The foreign key constraint validates successfully, but when we try to create the relationship through the API, we get a validation error: “Relationship type not recognized in schema.” We’ve configured the validation rules in the data model designer, but the enforcement logic seems to reject our custom relationship types. Has anyone successfully implemented multi-type relationship mappings in CAPA modules? Are there specific validation rule configurations we’re missing?
Mike, one more thing - check if you’re hitting the API validation before database validation. Arena validates relationship operations at multiple layers, and the error you’re seeing suggests it’s failing at the API schema validation level, not the database level.
One thing to watch out for - if you’re using CASCADE on the foreign key, make sure your validation rules don’t conflict with Arena’s internal deletion logic. I’ve seen cases where the FK constraint works but Arena’s validation layer blocks the operation because it has its own referential integrity checks that run before database constraints. You might need to configure the validation rules to allow cascading deletes explicitly.
Adding to what jenn said - you also need to ensure your relationship metadata is properly defined in the entity-relationship configuration. The validation rules won’t recognize custom types unless they’re explicitly registered. Go to Admin > Data Model Designer > Relationship Types and add your three types (direct, contributing, underlying) there first. Then rebuild the validation cache using the admin utility. The foreign key constraint alone won’t enforce the business logic Arena expects.
I’ve seen this before. The issue is that Arena’s validation engine checks relationship types against a predefined enum in the CAPA schema. Your foreign key constraint is fine, but you need to register the custom relationship types in the validation rule configuration first. Check the data_model_extensions table - there should be entries for allowed relationship types.
Here’s the complete solution for implementing multi-type relationship mappings in CAPA modules:
Step 1: Entity-Relationship Enforcement Configuration
First, register your custom relationship types in Admin > Data Model Designer > Relationship Types. For each type (direct, contributing, underlying), create entries with these settings:
- Entity A: capa_master (cardinality=“1”)
- Entity B: root_cause (cardinality=“*”)
- Relationship direction: unidirectional
- Validation scope: both API and database layers
Step 2: Foreign Key Constraints
Your FK constraint structure is correct, but you need to add the relationship type column to the constraint:
ALTER TABLE capa_root_cause_link
ADD CONSTRAINT fk_capa_relationship
FOREIGN KEY (capa_id, relationship_type)
REFERENCES capa_relationships(capa_id, type_code);
Step 3: Validation Rule Configuration
Critical step - update the validation rules XML in the CAPA module configuration:
- Navigate to Module Config > CAPA > Validation Rules
- Add custom relationship type validators that reference your new types
- Set enforcement level to “strict” for relationship type checking
- Enable cascading validation for delete operations
Step 4: API Schema Registration
The “Relationship type not recognized” error occurs because the API schema hasn’t been updated. Run this admin command:
arenaqms-admin refresh-schema --module=capa --include-relationships
This regenerates the API validation schema to include your custom types. After refresh, the API will recognize your relationship types during save operations.
Additional Considerations:
- Clear the validation cache after making these changes (Admin > System > Clear Validation Cache)
- Test with a single relationship first before bulk operations
- If using workflow automation, ensure transition rules don’t conflict with your relationship constraints
- Monitor the data_model_audit table to verify relationship creation events are logged correctly
The key issue in your case was that the validation rule configuration wasn’t synchronized with the database schema. Arena’s multi-layer validation requires explicit registration at each level - database constraints alone aren’t sufficient. Once all three components (entity-relationship config, FK constraints, and validation rules) are aligned, your custom relationship mapping should work correctly.