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 > Life Cycle Constraints Example
  
Life Cycle Constraints Example
The following example XML shows the out-of-the-box XML that sets the attribute display constraints for the life cycle template associated with a document.
The example is formatted to fit the page. Always enter each tag on one line:
<AttributeValues objType="wt.doc.WTDocument">
<AttrConstraint id="lifeCycle.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="lifeCycle" 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>
The constraints are supplied for two attributes:
lifeCycle.id (for fields from which users can search for a life cycle template)
lifeCycle (for life cycle 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 life cycle template assigned is the one set by the server (in the AttrValue rule) and the user cannot change the template that is used.