This document explains how strict validation enforcement protects your transformation pipeline from processing invalid models. This is critical for thesis defense demonstrations where examiners may test model integrity.
By default, the pipeline operates in strict validation mode:
./run_complete_pipeline.sh- ✅ Valid Model → Validation PASSES → Transformation PROCEEDS
- ❌ Invalid Model → Validation FAILS → Pipeline STOPS (exit code 1)
- 🎓 Thesis Defense: Demonstrates that OCL constraints actually work
- 🛡️ Quality Assurance: Prevents invalid models from producing incorrect code
- 📊 Model Integrity: Ensures all 50+ OCL constraints are satisfied
The pipeline validates 50+ OCL constraints across multiple categories:
- ✓ Valid names and IDs
- ✓ Unique identifiers
- ✓ Proper parent-child relationships
- ✓ Color values in range [0.0, 1.0]
- ✓ Positive dimensions (width, height)
- ✓ Valid font properties
- ✓ Valid layout modes
- ✓ Non-negative spacing/padding
- ✓ Consistent sizing constraints
- ✓ No circular component references
- ✓ Valid component property types
- ✓ Consistent auto-resize settings
- ✓ Valid navigation targets
- ✓ Positive transition durations
When validation fails, the pipeline stops immediately:
[STEP 2] Validating Figma Instance Model
────────────────────────────────────────────────────────────────────
✗ Figma model validation FAILED
One or more OCL constraints were violated
════════════════════════════════════════════════════════════════
VALIDATION FAILED - STOPPING PIPELINE
════════════════════════════════════════════════════════════════
The Figma instance model contains constraint violations.
Transformation cannot proceed until these issues are fixed.
Why this matters:
• OCL constraints ensure model integrity and correctness
• Invalid models can produce incorrect transformations
• Quality assurance requires valid input models
What to do:
1. Review the validation errors above
2. Fix the constraint violations in your Figma design
3. Re-fetch the Figma model: cd python_code && python3 main.py && cd ..
4. Re-run the pipeline: ./run_complete_pipeline.sh
For debugging only (not recommended):
To bypass validation: STRICT_VALIDATION=false ./run_complete_pipeline.sh
════════════════════════════════════════════════════════════════
Result: Pipeline exits with code 1. No transformation occurs.
Examiner: "What happens if I provide invalid data?"
Your Response: "Let me demonstrate the validation enforcement..."
-
Show Current Valid State
./validate_models.sh figma # Output: ✓ Figma model validation PASSED -
Run Test Script
./test_validation_enforcement.sh
This script:
- ✅ Tests valid model (passes)
- ❌ Creates invalid model (fails validation)
- 🛑 Shows pipeline stops on invalid model
-
Explain the Protection
- "The pipeline has 50+ OCL constraints"
- "Invalid models are automatically rejected"
- "This ensures transformation quality"
- "Strict validation mode is enabled by default"
-
Show Example Violations
# Example: Color value out of range # OCL constraint: r >= 0.0 and r <= 1.0 # Invalid: r = 2.5 # Result: REJECTED # Example: Negative dimensions # OCL constraint: width > 0.0 # Invalid: width = -100 # Result: REJECTED
./run_complete_pipeline.sh
# STRICT_VALIDATION=true (default)
# Pipeline STOPS on validation errorsVALIDATE_FIGMA=false ./run_complete_pipeline.sh
# Skips validation step completelySTRICT_VALIDATION=false ./run_complete_pipeline.sh
# Pipeline continues despite validation errors
# ⚠️ NOT recommended for production/thesis defense| Category | Count | Examples |
|---|---|---|
| Structural | 15 | Unique IDs, valid names |
| Data Validation | 12 | Color ranges, font sizes |
| Layout | 10 | Non-negative spacing |
| Business Logic | 8 | No circular refs |
| Interactions | 5 | Valid transitions |
| Total | 50+ | Comprehensive coverage |
- ⚡ Fast: ~2-5 seconds for typical models
- 🔍 Comprehensive: Checks all constraints
- 📝 Clear: Reports specific violations
# Test that validation works
./test_validation_enforcement.sh# 1. Validate current (valid) model
./validate_models.sh figma
# Expected: ✓ PASSED
# 2. Try to run pipeline with invalid model
# (Manually edit figma_instance.xmi to introduce error)
./run_complete_pipeline.sh
# Expected: Pipeline STOPS at validation stepAnswer: ✅ Yes, absolutely.
Proof:
- Pipeline has strict validation mode (default ON)
- Invalid models cannot proceed to transformation
- 50+ OCL constraints are enforced
- Test script demonstrates rejection of invalid models
Answer:
- Validation is enabled by default
- Bypassing requires explicit flag (STRICT_VALIDATION=false)
- This is clearly marked as debugging-only
- Production/thesis defense uses strict mode
- Pipeline shows "Strict Validation: ENABLED" in output
OCL Constraint:
context Color
inv validRGBAValues:
self.r >= 0.0 and self.r <= 1.0 and
self.g >= 0.0 and self.g <= 1.0 and
self.b >= 0.0 and self.b <= 1.0 and
self.a >= 0.0 and self.a <= 1.0
Violation: r="2.5" (outside range [0, 1])
Result: ❌ REJECTED - "Color values must be between 0.0 and 1.0"
OCL Constraint:
context Dimensions
inv positiveDimensions: self.width > 0.0 and self.height > 0.0
Violation: width="-100.0"
Result: ❌ REJECTED - "Dimensions must have positive width and height"
OCL Constraint:
context Children
inv validName: self.name <> null and self.name.size() > 0
Violation: name=""
Result: ❌ REJECTED - "All nodes must have valid non-empty names"
| Feature | Status | Benefit |
|---|---|---|
| Strict Validation | ✅ Enabled by default | Protects quality |
| 50+ OCL Constraints | ✅ Fully enforced | Comprehensive checks |
| Pipeline Stops on Error | ✅ Yes (strict mode) | Prevents bad output |
| Clear Error Messages | ✅ Detailed violations | Easy debugging |
| Test Script | ✅ Included | Demo-ready |
| Thesis Defense Ready | ✅ Yes | Professional |
# Run pipeline (strict validation enforced)
./run_complete_pipeline.sh
# Test validation enforcement
./test_validation_enforcement.sh
# Validate model only
./validate_models.sh figma
# Check constraint count
grep -c '^inv' Metamodel/figma_meta_model.ocl
# View all constraints
cat Metamodel/figma_meta_model.oclWhen demonstrating validation:
-
Show the setting:
Pipeline Configuration: Strict Validation: ENABLED (Pipeline stops on validation errors) -
Explain the protection: "The pipeline enforces 50+ OCL constraints to ensure model quality."
-
Run the test:
./test_validation_enforcement.sh
-
Explain the results:
- Valid models pass ✅
- Invalid models are rejected ❌
- Pipeline stops immediately on errors 🛑
-
Emphasize quality assurance: "This validation layer ensures that only valid, well-formed models proceed to transformation, guaranteeing output quality."
Last Updated: November 2025 Status: ✅ Production Ready for Thesis Defense