Constraint Algorithms
Use constraint algorithms to set display characteristics on a user interface field for the attribute identified in the AttrConstraint tag.
Out of the box, Windchill provides the following constraint algorithms (names are shown on multiple lines in the table; enter the name of the algorithm on one line):
Algorithm
Description
com.ptc.core.rule.server.impl.
GetHiddenConstraint
The user interface does not display a label or value for the attribute.
com.ptc.core.rule.server.impl.
GetDiscreteSetConstraint
The user interface allows picking from a list of discrete values for the attribute where the argument type matches the attribute type. The values are specified as arguments to the algorithm.
com.ptc.core.foundation.lifecycle.server.impl.
DiscreteLifecycleTemplateSetAlgorithm
The user interface allows picking from a list of discrete life cycle template values for the lifeCycle.id attribute. The values are specified as arguments to the algorithm.
com.ptc.core.foundation.team.server.impl.
DiscreteTeamTemplateSetAlgorithm
The user interface allows picking from a list of discrete team template values for the teamTemplate.id attribute. The values are specified as arguments to the algorithm.
com.ptc.core.rule.server.impl.
GetImmutableConstraint
The user cannot change the attribute value that is being displayed. If an attribute that has another constraint does not have this constraint, then the user is allowed to manually enter a value. For more information, see Examples using GetServerAssignedConstraint and GetImmutableConstraint.
com.ptc.core.rule.server.impl.
GetServerAssignedConstraint
The user interface does not display a value for the attribute; the value is generated when the user clicks OK to save the object instance. The text displayed in place of the value is similar to (Generated). For more information, see Examples using GetServerAssignedConstraint and GetImmutableConstraint.
com.ptc.core.rule.server.impl.
GetServerPreGeneratedValue
The user interface displays a value for the attribute. The value is generated before the user interface is displayed. The value displayed is specified as an argument to this algorithm, or if not specified, is obtained by executing the corresponding AttrValue tag for the given attribute.
* 
For number attributes where the default number value is sequentially generated, using this constraint can cause numbers in the sequence to be unused. The skipping of numbers occurs when a user accesses the interface and then cancels the operation before saving. There is no way to reclaim the skipped numbers.
For example, use the following XML to specify the constraint algorithm that generates an attribute value that is displayed in the field:
algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue"
You specify the constraint algorithms as part of the AttrConstraint tag, nested in Value tags under the com.ptc.core.rule.server.impl.GatherAttributeConstraints algorithm as defined in theAttrConstraint Tag Syntax topic.
Using the out-of-the-box constraint algorithms, you can specify zero, one, or more algorithms in Value tags.
Isto foi útil?