Examples
Overview · Rule Patterns · Profile Examples · Name Examples · Common Examples
Profile Rule Examples
- Overview
- Fixed Material by Profile family
- Prefix by Radius
- Length by Profile depth
- Grating Material substring match
- CHS Material by depth and thickness
- CHS fallback Material rules with onFirstMatch
- CHS Length override rules with onAnyMatch
CHS fallback Material rules with onFirstMatch
Problem
The CHS availability tables overlap awkwardly.
A first set of rules covers the main table, but some additional 350 cases also need to be recognised from a secondary list.
Trying to merge both tables into one clean rule set can become difficult and error-prone.
Strategy
Use the main CHS material targets first, then add fallback MATERIAL targets configured with onFirstMatch.
This allows the fallback checks to apply only if no earlier target has already set a result for the same cell.
Rule Structure
- Subject
PROFILE- Match
- Regex (CHS)
- Primary Targets
- main table of material rules
- Fallback Targets
- secondary
350rules usingonFirstMatch
Minimal Tree
Subject: PROFILE
Match: Regex (CHS)
Target: MATERIAL [main table]
Target: MATERIAL [main table]
Target: MATERIAL [fallback, onFirstMatch]
Target: MATERIAL [fallback, onFirstMatch]
Why onFirstMatch Matters
onFirstMatch prevents the fallback rule from overwriting an earlier result.
That makes it ideal for cases where:
- a later rule is only a backup
- the first matching results are limited via conditions
- i.e. not necessarily applied to every row
- overlapping lists would otherwise create unnecessary conflicts
Example Behaviour
| Profile | Material | Main Table Result | Fallback Result | Final Result |
|---|---|---|---|---|
| CHS… found in main table | 250 | Okay | skipped | Okay |
| CHS… not in main table | 350 | no result | Okay | Okay |
| CHS… found in main table | 250 | Error | skipped | Error |
| CHS… not in main table | 350 | no result | Info | Info |
Notes
This is a good reference for any rule set where:
- one table handles the main logic
- another table fills in exceptions
- later rules should only apply if nothing else has already matched