Constraints
Creating incompatible value sets and interpreting validity and availability at runtime.
Constraints prevent shoppers from selecting incompatible or unmanufacturable combinations of choice values. They are the current supported compatibility mechanism in Backoffice and runtime resolution.
Current behavior
A constraint is an unordered set of ChoiceValue IDs that cannot all be selected together. For example, a constraint containing Green Velvet and Brass Legs means that exact pair is invalid.
- Open a draft revision in the product workspace.
- Select the Rules tab.
- Select Add constraint.
- Choose two or more incompatible values.
- Save the constraint.
The current CreateConstraintInput accepts only productRevisionId and choiceValueIds. There is no public per-constraint customer message field. Storefronts should render their own explanation from the affected choices and values or use application-owned copy.
Availability and validity
- Validity (
valid) answers whether the submitted selection violates a constraint. - Availability (
availabilityJson) projects which values remain selectable in the current context.
When Green Velvet is selected, the availability matrix can mark Brass Legs as false. If the storefront nevertheless submits both values, resolution returns valid: false and violation identifiers generated by the resolver. Do not depend on custom authored prose in that array.
Legacy configuration rules
ConfigurationRuleModel and its condition/effect JSON remain in the schema and historical graph snapshots for compatibility. Current API writes are deliberately blocked with guidance to use constraints based on ChoiceValue IDs, and current resolution uses constraints for compatibility evaluation.
Treat configuration rules as legacy or migration-only data:
- do not create new operator workflows around them;
- do not describe them as the current resolution mechanism;
- preserve them when reading historical revisions;
- migrate their intended incompatibilities to constraints before relying on current runtime behavior.
Change a constraint safely
Constraints belong to a revision. To change live compatibility, create or open a draft, delete the obsolete constraint, create the replacement, test the affected selection space, and publish the draft. There is no disable action in the current constraint API.
Verify
- Resolve a selection containing only the first constrained value and confirm the conflicting value is unavailable.
- Resolve the full constrained combination and confirm
validisfalse. - Remove one constrained value and confirm the selection becomes valid again.
- Test an unrelated combination and confirm it remains available.
- Publish the draft, resolve without an explicit revision ID, and confirm the response uses the newly published revision.