Server Administration > Item Type Attributes > Managing Constraints
Managing Constraints
Constraints are conditions defined by you that are applied to selected fields in a Windchill RV&S type. The conditions can be used to restrict the values that display in the field, or to make certain fields mandatory when editing an item. After creating a constraint, you can later edit, copy, or delete that constraint as required for your workflow.
In Windchill RV&S, constraints effectively replace trigger scripts that previously validated field rules. Rather than writing and maintaining individual triggers scripts, constraints can be managed directly through the Windchill RV&S administration client GUI (or CLI) when you are editing types.
Once you have defined a type, and the corresponding fields for that type, you can create constraints to further customize the display of data in all items for that type. Constraints allow you to:
restrict the allowed values that display in a field
define mandatory fields (as defined either on a state or on a constraint)
customize error messages that are displayed to users when an invalid value is selected or when a mandatory field is left empty
You can configure the following categories of constraints: basic, field relationship, rule, or Item Backed Pick List (IBPL).
Key Considerations
Constraints are based on the Windchill RV&S type, therefore you can only create constraints between fields that exist within a single type in your workflow.
Field relationship constraints can only be created on a one-to-one basis, that is, one field is constrained by another field.
Rule constraints can evaluate multiple fields to constrain a single field.
You cannot create a constraint for a field value attribute (FVA).
You cannot create a basic constraint when creating or copying a type.
If a user enters an invalid value for a field, or an empty value for a mandatory field, Windchill RV&S displays a default error message. You can also create customized error messages that will be displayed for invalid field values or mandatory field errors. For more information, see “Customizing Error Messages for Constraints”.
Changes to a constraint do not take effect until the associated type has been saved (that is, until you click OK in the edit Type view). If you cancel your edits to the type, your constraint changes are also canceled.
When working with types, the constraints panel also provides a Search field, allowing you to search the list of constraints. The list is then filtered according to the text string you entered and only those constraints matching your search terms are displayed in the list.
Basic Constraints
A basic constraint allows you to restrict the allowed values of a constrained field according to the Windchill RV&S type, without specifying any other condition. Therefore, a basic constraint will always apply for the specified field(s) in the type. Basic constraints can include requiring the constrained field to be mandatory.
For more information, see “Working With Basic Constraints”.
Field Relationship Constraints
A field relationship constraint allows you to restrict the allowed values of a field, based on the value of another field. The fields are related through the constraint because the value of the constrained field is restricted (or made mandatory) only when another field (the “source” field) has a particular value or set of values.
For more information, see “Working With Field Relationship Constraints”.
Rule Constraints
A rule constraint allows you to restrict the allowed value of a field when a specified rule is met (that is, the rule resolves to true). The rule method also applies for mandatory fields when the specified rule is met.
For more information, see “Working With Rule Constraints”.
Item Backed Pick List (IBPL) Constraints
An IBPL constraint allows you to set up constraints for items matching a specified rule. The IBPL constraint filters the content of an item backed pick list to show only those items that match the specified rule. The rule can include comparisons between the item being edited and the items that display in the item backed pick list.
For more information, see “Working With IBPL Constraints”.
Mandatory Fields
The Empty Mandatory Field error message displays when a user attempts to save an edit with an empty mandatory field. If a user is having problems with mandatory fields, or you are trying to diagnose a problem that may be related to mandatory fields, review the relevant constraint definition in the edit Types view.
For more information, see “Customizing Error Messages for Constraints”.
Document Versioning and Constraints
For information on the impact of document versioning on constraint rules, see “Limitations For Document Versioning”.