Setting List-based or State-based Versioning for Objects
The default Harvard series versioning scheme is set at the site level and then used at the organization, product, and library levels unless it is overwritten. One context template that is loaded (the demo Product Design template) sets the versioning for parts, documents, and CAD documents to state-based versioning. Additionally, new context templates that are created can set list-based or state-based versioning; however, PTC recommends that you set the same versioning scheme for all organizations, products, and libraries by setting the scheme at the site level.
In a context template XML file, you can specify the versioning you want used for each object type as an element in the corresponding <TypeBasedRule> tag for the object type. For example, in the Product Design template XML file, the following sample <AttrValue> tag sets the versioning for parts to StateBased (which is the series set in the out-of-the-box versioning XML file that is loaded):
<TypeBasedRule>
<EngineRule isDefault="false" enabled="true">
<ruleName>Part</ruleName>
<ruleSpecification><![CDATA[
<AttributeValues objType="wt.part.WTPart">
:
:
<!-- set the version info to a generated version info -->
<AttrValue id="MBA|versionInfo" algorithm="com.ptc.core.foundation.vc.server.
impl.VersionInfoGenerator">
<Arg>wt.series.HarvardSeries.myVersionSeries</Arg>
</AttrValue>

</AttributeValues>
]]></ruleSpecification>
<ruleType type="INIT"/>
</EngineRule>
<className>wt.part.WTPart</className>
</TypeBasedRule>
In this example, versioning for parts is set to wt.series.HarvardSeries.myVersionSeries. The versioning code checks for wt.series.HarvardSeries.myVersionSeries properties and, when they are not found, it looks in the loaded list-based or state-based versioning scheme for a series named myVersionSeries. This example assumes a list-based or state-based scheme was loaded containing a series name myVersionSeries.
Additionally, you can change versioning to list-based or state-based versioning by using the Object Initialization Rules Administration utility from within the context where you want the change to take place. However, all changes should be made before a product or library is used. Changing values that have already been used can cause unpredictable results when versions are being updated.
The format of the <attrValue> tag that is used for setting list-based or state-based versioning in an object initialization rule is the same as the format shown previously in Defining the Content of XML Documents used for Object Initialization Rules. For more information about using the Object Initialization Rules Administration utility, see Accessing the Object Initialization Rules Administration Utility.
For state-based schemes, you also need to set the seed used to define a life cycle phase in a life cycle template. For more information, see Version Series property in Life Cycle Phases.
¿Fue esto útil?