Amministrazione avanzata > Adattamento di business object > Amministrazione delle regole di inizializzazione degli oggetti > Understanding Object Initialization Rules > Defining the Content of XML Documents used for Object Initialization Rules > Examples of Algorithms Used with AttrConstraint > Folder Constraints Example using GetServerPreGeneratedValue
  
Folder Constraints Example using GetServerPreGeneratedValue
The following example XML shows the out-of-the-box XML that sets the attribute display constraint for the folder location of a document.
The example is formatted to fit the page. Always enter each tag on one line:
<AttributeValues objType="wt.doc.WTDocument">
<AttrConstraint id="folder.id" algorithm=
"com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue"/>
</AttrConstraint>
</AttributeValues>
The constraint is supplied for the folder.id attribute and is used to obtain the default folder path that is then presented when a user creates a document.
For example when the user creates an object by clicking an icon from the Folder Contents table associated with the Design folder, the folder locations presented in the field are the top-level folder and the folder from which the icon was clicked (in this case, /GOLF_CART/Design):
/GOLF_CART in Autoselect Folder (/GOLF_CART) is generated using object initialization rule set for the wt.doc.WTDocument object type. The system uses the constraint in the example XML to obtain the value which comes from the /Default argument that is stored in the AttrValue tag for wt.doc.WTDocument.