Defining the Content of XML Documents used for Object Initialization Rules
This section describes the content of XML documents used when specifying rules through the Object Initialization Rules Administration utility.
Object initialization rules can also be set through the use of templates; however, additional elements are needed before and after the rules to define import information that is needed in an XML document that can be imported as a template. The format of the rules themselves is the same everywhere. For information on the elements required in XML documents for importing templates, see
Specifying Object Initialization Rules in a Context Template.
For each object initialization rule, the XML document must contain the following:
• Nested inside the AttributeValues tag must be at least one of the following:
◦ An AttrValue tag that identifies an attribute for which a default value is being set and specifies the algorithm that is used to set the default value.
◦ An AttrConstraint tag that identifies an attribute for which a constraint is defined and specifies the algorithm that is used to apply the constraint.
◦ A VarDef tag that defines a variable name and value that is then available when referencing the variable (using the VarRef tag). The value for a variable is not calculated until a rule is processed that references the variable. See
Variables.
|
The constraint definitions provided through the AttrConstraint tag do not impact the behavior of setting default values provided through the AttrValue tag. The constraints are only used to control the behavior of the user interface.
|
For details on the syntax required for the tags and optional elements that can be included in the tags, see
Especificación de reglas.
An example wt.doc.WTDocument rule specification that defines a default folder path and displays the folder path value as a server generated value that can be manually changed is as follows:
<AttributeValues objType="wt.doc.WTDocument">
<AttrValue id="folder.id"
algorithm="com.ptc.core.foundation.folder.server.
impl.FolderPathAttributeAlgorithm">
<Arg>/Default</Arg>
</AttrValue>
<AttrConstraint id="folder.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue"/>
</AttrConstraint>
</AttributeValues>
The object types, attributes, and algorithms that you can include in rule tags are described in the following sections.