示例:从模型化主数据类创建具有衍生属性的模型化对象
请考虑一个包含一个属性 masterAtt1 的模型化类型 ext.ts.part.TSPart 的示例,该属性是从主数据属性 ext.ts.part.TSPartMaster>>masterAtt1 衍生而来。
derivedProperties={
@DerivedProperty(name="masterAtt1", derivedFrom="master>masterAtt1")
}
在 <WT_HOME>\codebase\LogicalAttributes.xml 中,创建一个新条目 <Class name="ext.ts.part.TSPart">。
1. 添加衍生属性的逻辑形式。
2. 复制 wt.part.WTPart 中包含 MBA|masterReference^WCTYPE|wt.part.WTPartMaster〜MBA 的每个条目。
3. 对于这些重复条目,请将 wt.part.WTPartMaster 替换为 ext.ts.part.TSPartMaster。例如:
<Class name="ext.ts.part.TSPart">
<!-- custo derived attributes -->
<Property>
<LogicalForm>masterAtt1</LogicalForm>
<ExternalForm>MBA|masterReference^WCTYPE|ext.ts.part.TSPartMaster~MBA|masterAtt1</ExternalForm>
</Property>
<!-- duplicates from wt.part.WTPart which involve MBA|masterReference^WCTYPE|wt.part.WTPartMaster -->
<Property>
<LogicalForm>defaultTraceCode</LogicalForm>
<ExternalForm>MBA|masterReference^WCTYPE|ext.ts.part.TSPartMaster~MBA|defaultTraceCode</ExternalForm>
</Property>
...
</Class>
|
|
建议创建一个自定义 LogicalAttributesSite.xml 文件来配置自定义逻辑属性,并使用特性 com.ptc.core.meta.common.impl.LogicalIdentifierFactory.translatorSelectors 指定此自定义 LogicalAttributesSite.xml 文件的位置。通过设置此特性,管理员可以确保 Windchill 对逻辑属性使用正确的自定义配置。
|