设置对象初始化规则
设置对象初始化规则,以便对象与新建的生命周期关联,并采用定义了种子的 StateBased 版本控制方案。
下面的示例显示了 WTPart 的已修改初始化规则。
<AttributeValues objType="wt.part.WTPart">
<!-- set the folder -->
<AttrValue id="folder.id"
algorithm="com.ptc.core.foundation.folder.server.impl.
FolderPathAttributeAlgorithm">
<Arg>/Default</Arg>
</AttrValue>
<!-- set the lifecycle -->
<AttrValue id="lifeCycle.id"
algorithm="com.ptc.core.foundation.lifecycle.server.impl.LifeCycleTemplate
Attribute
Algorithm">
<Arg>
<!-- Translation of the word "Basic" must be the same as
the translation done in commonLifeCycles.xml -->
<?loc-begin key="BASIC_LIFECYCLE_NAME" maxlen="30" match= "commonLifeCycles.xml:BASIC_LIFECYCLE_NAME"?>Prototype_Reject<?loc-end?>
</Arg>
</AttrValue>

<!-- set the team template -->
<AttrValue id="teamTemplate.id"
algorithm="com.ptc.core.foundation.team.server.impl.TeamTemplateAttributeAl
gorithm"
>
<Arg>Default</Arg>
</AttrValue>
<!-- set the number to a generated number -->
<AttrValue id="number"
algorithm="com.ptc.windchill.enterprise.revisionControlled.server.impl.Number
Genera
tor">
<!-- add a V prefix for variant parts -->
<Value algorithm="wt.rule.algorithm.BooleanBranch">
<Value algorithm="wt.rule.algorithm.EqualsTest">
<Attr id="genericType"/>
<Arg>variant</Arg>
</Value>
<Arg>V</Arg>
<Arg></Arg>
</Value>
<!-- the sequence -->
<Arg>{GEN:wt.enterprise.SequenceGenerator:WTPARTID_seq:10:0}</Arg>
</AttrValue>
<!-- 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.MyStateBased</Arg>
</AttrValue>
</AttributeValues>
* 
如果在站点或组织级别定义了此规则,则可能需要禁用在上下文级别定义的对象初始化规则。
这对您有帮助吗?