Administración especializada > Adecuación de los objetos de negocio > Administración de reglas de inicialización de objetos > Understanding Object Initialization Rules > Defining the Content of XML Documents used for Object Initialization Rules > Examples of Algorithms Used with AttrConstraint > Examples using GetServerAssignedConstraint and GetImmutableConstraint > Team Template Example
  
Team Template Example
The following example shows the out-of-the-box XML that sets the attribute display constraints for the team template associated with a document.
The constraints are supplied for two attributes:
teamTemplate.id (for fields from which users can search for a team template)
teamTemplate (for team template fields that do not provide the search capability)
Using the constraints in the example, the New Document window includes the following:
From this interface, the team template assigned is the one set by the server (in the AttrValue rule) and the user cannot change the template that is used.
The following example is formatted to fit the page. Always enter each tag on one line:
<AttributeValues objType="wt.doc.WTDocument">
<AttrConstraint id=teamTemplate.id" 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"/>
</AttrConstraint>

<AttrConstraint id=teamTemplate" 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"/>
</AttrConstraint>
</AttributeValues>