Displaying a Composite Rule
To determine what object initialization rule is in effect for an object type in a specific context, you can display the composite rule for the object type.
The composite rule is created by merging all rules that are set for an object type and ancestor object types in the current context and in all ancestor contexts. For example, a rule for WTPart numbering and versioning can be set at the site context and a rule for WTPart folders can be set at the product or organization context. Then the composite rule for WTPart objects created under the product or organization includes both the setting for numbering and versioning, and the setting for folders. If the product rule had included setting the numbering scheme, then this rule setting would usually take precedence over the setting made at the site context.
Use the following steps to download and display a composite rule:
1. Access the Object Initialization Rules Administration utility from the context in which you want the composite rule displayed by navigating to the Object Initialization Rules table.
2. Click the download composite icon .
The Download Composite Object Initialization Rule window opens.
3. Click the Find button and select the object type for which you want to display a composite rule.
4. Click OK to initiate the download process.
How the download occurs depends on how your system is configured. Your system may be set up to display the XML in an XML editor or a browser. From the display, you can save the XML; otherwise, you may initially be prompted to save the XML in a file.
For details on how the composite rule is generated, see Merging Rules to Create a Composite Rule.
The following XML shows a sample composite rule for the wt.doc.WTDocument object type. The first part of the file shows the default values that are set using AttrValue tags:
< AttributeValues objType= " wt.doc.WTDocument ">
<AttrValue id="lifeCycle.id"
algorithm="com.ptc.core.foundation.lifecycle.server.impl.LifeCycleTemplateAttributeAlgorithm"
ignore="false"
force="false"
final="false">
<Arg>Basic</Arg>
</AttrValue>

<AttrValue id="teamTemplate.id"
algorithm="com.ptc.core.foundation.team.server.impl.TeamTemplateAttributeAlgorithm"
ignore="false"
force="false"
final="false">
<Arg>Default</Arg>
</AttrValue>

<AttrValue id="folder.id"
algorithm="com.ptc.core.foundation.folder.server.impl.FolderPathAttributeAlgorithm"
ignore="false"
force="false"
final="false">
<Arg>/Default</Arg>
</AttrValue><AttrValue id="MBA|versionInfo"
algorithm="com.ptc.core.foundation.vc.server.impl.VersionInfoGenerator"
ignore="false" force="false" final="false">
<Arg>wt.series.HarvardSeries</Arg>
</AttrValue>

<AttrValue id="number"
algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.NumberGenerator"
ignore="false"
force="false"
final="false">
<Arg>{GEN:wt.enterprise.SequenceGenerator:WTDOCUMENTID_seq:10:0}</Arg>
</AttrValue>
</AttributeValues>
In this part of the rule, the following wt.doc.WTDocument attribute default values are set:
The lifeCycle.id default value is set to Basic.
The teamTemplate.id default value is set to Default.
The folder.id default value is set to /Default.
The MBA|versionInfo default value (which sets the versioning scheme) is set to wt.series.HarvardSeries.
The number default value (which sets the numbering scheme) is set to {GEN:wt.enterprise.SequenceGenerator:WTDOCUMENTID_seq:10:0}.
The second part of the file shows the display constraints that are set using AttrConstraint tags:
<AttrConstraint
id="lifeCycle.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"
ignore="false"
force="false"
final="false">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint">
</Value>
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint">
</Value>
</AttrConstraint>

<AttrConstraint
id="lifeCycle"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"
ignore="false"
force="false"
final="false">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint">
</Value>
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint">
</Value>
</AttrConstraint>

<AttrConstraint
id="teamTemplate.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"
ignore="false"
force="false"
final="false">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint">
</Value>
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint">
</Value>
</AttrConstraint>

<AttrConstraint
id="teamTemplate"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"
ignore="false"
force="false"
final="false">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint">
</Value>
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint">
</Value>
</AttrConstraint>

<AttrConstraint
id="folder.id"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"
ignore="false"
force="false"
final="false">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerPreGeneratedValue">
</Value>
</AttrConstraint>

<AttrConstraint
id="number"
algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints"
ignore="false"
force="false"
final="false">
<Value algorithm="com.ptc.core.rule.server.impl.GetServerAssignedConstraint">
</Value>
<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint">
</Value>
</AttrConstraint>
In this part of the rule, the following wt.doc.WTDocument attribute display constraints are set:
The lifeCycle.id and lifeCycle attribute values are generated automatically but not displayed, and are not editable.
The teamTemplate.id and teamTemplate attribute values are generated automatically but not displayed, and are not editable.
The folder.id attribute values are displayed using the value set in the corresponding AttrValue element and the user can edit the value.
The number attribute values are generated automatically but not displayed, and are not editable.
Notice that the optional ignore, force, and final attributes are displayed in each AttrValue element and in each AttrConstraint element. When these attributes are set to "false" (as shown in the example), they have no effect on the rule. The effect of setting the ignore and final attributes to "true" is described in Specifying Rules. The use of the force attribute has no effect on the rule.
For an explanation of what the numbering scheme and versioning scheme default values mean, see Object Numbering and Object Versioning.
Isto foi útil?