Configuring Rules
As part of configuring your Windchill solution, you can:
Create additional default value, constraint, and conditional logic algorithms that can be used in object initialization rules.
Use the AttrValue element to specify default values for additional object types or attributes in object initialization rules.
To use object types or attributes that are not listed in Using Supported Types and Attributes, you may need to perform additional configuration and customization as described in #ObjRuleCustomRef/AddlTypeAttrPair.
Use the AttrConstraint element to specify constraints for additional attributes in object initialization rules.
To use object types or attributes that are not listed in Using Supported Types and Attributes, you may need to perform additional configuration and customization as described in #ObjRuleCustomRef/AddlTypeAttrPair.
Many of the object initialization rules that are loaded provide specific functionality in the user interface. Do not modify the rules that are loaded without considering the full impact of your changes.
Custom Rule Algorithms
To create custom algorithms, PTC provides the wt.rule.algorithm.RuleAlgorithm interface upon which all out-of-the-box algorithms have been built. For details on how to use this interface to create custom algorithms, see the Javadoc associated with this interface.
Additional Type and Attribute Pairs
The RuleConfigurableTypeAttribute.properties file contains the list of object and attribute pairs for constraints. Each property has the following format:
object_type="list_of_attributes"
where:
object_type is the internal name of the object type, as defined in the Type and Attribute Management utility.
list_of_attributes is zero or more attributes (separated by commas).
* 
A value of zero indicates that display constraints are not supported for the object type.
Use the internal name of each local or global attribute you want to include. The internal names for attributes are defined in the Type and Attribute Management utility.
* 
When customizing, internal names can be overridden in the LogicalAttributes.xml. For additional information, see the comments in this file and the “Managing the LogicalAttributes.xml File” section in Best Practices for Customizing Files Supplied by PTC.
To add new properties to this file, use the -s parameter on an xconfmanager utility command. For example, to add a new object type that has the internal name of "myCompany.demoType" and defined attributes that have the internal names "myCompany.demoAttr1" and "myCompany.demoAttr2", enter following command (on one line) from within a windchill shell:
xconfmanager -s myCompany.demoType="myCompany.demoAttr1,myCompany.demoAttr2"
-t codebase/com/ptc/core/rule/server/delegate/init/RuleConfigurableTypeAttribute.properties
-p
To add a new attribute to an existing property in this file, use the --add parameter on an xconfmanager utility command. For example, to add the attribute with the internal name of "description" to the existing property for the "wt.doc.WTDocument" object type, enter following command (on one line) from within a windchill shell:
xconfmanager --add wt.doc.WTDocument="description"
-t codebase/com/ptc/core/rule/server/delegate/init/RuleConfigurableTypeAttribute.properties
-p
A default value that is specified in a rule will only be used if the value for the attribute is left unspecified by the user interface that is used to create the object. If the user interface code does not allow the value for an attribute to be left unspecified, then you must customize the user interface to allow the value to be left unspecified. If you do not customize the interface, the value that you specify in the object initialization rule will not be used. If there is no user interface used to create this attribute, and no attribute value is specified, the default value is used.
A constraint that is specified in a rule will only impact the way an attribute is rendered in a user interface if the user interface code reads constraints and uses the constraint information to determine how to render the attribute. If the user interface does not read constraints or does not use the constraint information to determine how to render the attribute, then you must customize the user interface to do so. If you do not customize the interface, the constraint that you specify in the object initialization rules will not have any impact on the display of the attribute.
* 
All user interfaces provided by PTC require customization to use constraints defined in rules for local or global attributes. Before customizing, be sure that you understand the interface and follow the customization best practices as described in the “Managing the LogicalAttributes.xml File” section in Best Practices for Customizing Files Supplied by PTC. For specific details on customizing attributes in the user interface using object initialization rules, see Attribute Customization.
Was this helpful?