Setting Display Characteristics Directly by Omitting Algorithms
You can set the display characteristics of an attribute directly by omitting the constraint algorithm. When the constraint algorithm is omitted, specifying only a single argument is allowed. The result of evaluating this single argument is returned as the result of evaluating the AttrConstraint element.
If more than one argument is specified when the algorithm is omitted, an exception is returned.
The following XML fragment shows the use of omitting the algorithm. It sets the display constraints for the number attribute value to the constraints calculated from the variable named ServerAssignedAndImmutableConstraints:
<AttrConstraint id="number">
<VarRef id="ServerAssignedAndImmutableConstraints"/>
</AttrConstraint>
An example of the corresponding VarDef for the variable named ServerAssignedAndImmutableConstraints is as follows:
<VarDef id="ServerAssignedAndImmutableConstraints"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint"/>
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"/>
</VarDef>
Isto foi útil?