特定管理 > 訂做企業物件 > 類型及屬性管理 > 使用類型及屬性管理公用程式 > 管理類型 > 類型資訊頁 > 屬性標籤 > 建立新屬性 > 別名屬性對應
  
別名屬性對應
別名屬性與相關物件上的屬性對應。此對應可透過將別名屬性包括在配置圖中,讓相關物件的資訊顯示在目前類型的使用者介面上,例如資訊頁或表格。與其他屬性的對應可在「對應」內容中,使用運算子以及類型與屬性的內部名稱導覽物件連結與參考來指定。
* 
特定別名對應僅可在類型或其子類型上使用一次。如果第二個別名屬性是用相同對應定義,會產生錯誤。類型的 Logical Attributes Report 會列出已用於該類型的對應,包括在「類型及屬性管理」公用程式中用於別名屬性的對應。Logical Attributes Report 可從「自訂」 > 「工具」中找到。如需詳細資訊,請參閱 Customization Tools Overview (自訂工具概觀)。
如需有關如何在包括於配置圖時顯示別名屬性的資訊,請參閱屬性顯示
對應語法
對應的起點是在其上定義別名屬性的物件,且並不包括在「對應」內容值中。對應尾端的屬性的值在使用者介面中顯示為別名屬性值。
在定義對應時會使用下列分隔符號:
波浪符號 (~) 用於類型 (在左) 與屬性 (在右) 之間,可識別針對該類型定義的特定屬性。相關例外情況,請參閱下面的 at 符號 (@) 定義。
<type A>~<attribute of type A>
脫字符符號 (^) 用於屬性 (在左) 與類型 (在右) 之間,可透過該屬性導覽至該特定類型的實例。
<type A>~<attribute of type A>^<type B>
at 符號 (@) 用於屬性 (在左) 與類型 (在右) 之間,可透過針對類型定義的屬性向右導覽至該類型的實例。決定屬性定義位置時,在屬性右側顯示的 at 符號 (@) 優先於屬性左側的波浪符號 (~)。
<type A>~<attribute of type B>@<type B>
等號 (=) 用於屬性 (在左) 與屬性 (在右) 之間,可導覽至右側類型的實例,且表示左側的屬性值等於右側的屬性值。只有類型為「布林值」、「整數」、「字串」與「日期」的模型化屬性可以指定到等號 (=) 的左右兩側。
<type A>~<attribute of type A>=<attribute of type B>@<type B>
「對應」屬性值的語法如下:
「關聯」~「屬性」
其中:
<association> 為下列其中一項:
<association>
意義:
<attribute>^<type>
導覽至此物件參考的其他物件
<attribute>@<type>
導覽至參考此物件的物件
<attribute>=<attribute>@<type>
導覽至與此物件擁有相同值的物件
* 
只有類型為「布林值」、「整數」、「字串」與「日期」的模型化屬性可以指定為 <attribute>=<attribute>@<type>對應中的屬性項目。模型屬性是儲存在 LWCHardAttDefinition 表中的屬性。
<association>~<association>
導覽至跨多個 <association> 且鏈接在一起的物件
<attribute> 是針對類型定義之屬性的內部名稱。針對不會顯示在「類型及屬性管理」公用程式中之類型的屬性,使用屬性的模型化名稱。
「類型」是類型的內部名稱。針對不會顯示在「類型及屬性管理」公用程式中的類型,使用類型的類別名稱。
對應範例
下列範例適用於針對「文件」類型指定的別名屬性,其內部名稱為 wt.doc.WTDocument
例如,
masterReference^wt.doc.WTDocumentMaster~name
「對應」內容值表示會將目前 wt.doc.WTDocument 上的 masterReference 參考屬性導覽至 wt.doc.WTDocumentMaster ,並傳回 wt.doc.WTDocumentMastername 屬性,如下圖所示:
下圖顯示 wt.doc.WTDocumentwt.doc.WTDocumentMaster 兩個類型,它們由 wt.doc.WTDocumentUsageLink 連結類型連結在一起。wt.doc.WTDocumentUsageLink 連結類型擁有兩個參考屬性:usedBy (參考 wt.doc.WTDocument) 與 uses (參考 wt.doc.WTDocumentMaster)。
usedBy 參考屬性可用來在 wt.doc.WTDocument 物件與參考它的 wt.doc.WTDocumentUsageLink 物件之間進行導覽。由於 usedBy 屬性是針對要導覽之目標類型所定義,因此請使用 at 符號 (@) 分隔符號。
下列「對應」值:
usedBy@wt.doc.WTDocumentUsageLink~uses^wt.docWTDocumentMaster~name
可導覽至擁有參考目前 wt.doc.WTDocument 物件之 usedBy 屬性的 wt.doc.WTDocumentUsageLink 物件,然後導覽至這些 wt.doc.WTDocumentUsageLink 物件上 uses 屬性參考的 wt.doc.WTDocumentMaster 物件,並擷取這些 wt.doc.WTDocumentMaster 物件的名稱。
其他別名對應範例
下表提供別名屬性對應的其他範例。當屬性或類型在「類型及屬性管理」公用程式中為可檢視時,顯示名稱即包括在對應描述中。針對不會顯示在「類型及屬性管理」公用程式中之類型與類型相關屬性,會使用類型的類別名稱以及類型相關屬性的模型化名稱;您可以在本主題結尾處的常用連結物件表中找到其中許多名稱。
目前物件
對應屬性值
描述
「活動」(com.ptc.projectmanagement.plan.PlanActivity)
containerReference^wt.projmgmt.admin.Project2~containerInfo.name
導覽至目前「活動」(com.ptc.projectmanagement.plan.PlanActivity) 物件上之「前後關聯」(containerReference) 屬性所參考的「專案」(wt.projmgmt.admin.Project2) 物件,然後從這些「專案」(wt.projmgmt.admin.Project2) 物件中擷取「名稱」(containerInfo.name) 屬性。
「文件」(wt.doc.WTDocument)
describedBy@wt.part.WTPartDescribeLink~describes^wt.part.WTPart~name
導覽至擁有參考目前「文件」(wt.doc.WTDocument) 物件之 describedBy 屬性的 wt.part.WTPartDescribeLink 物件,然後導覽至這些 wt.part.WTPartDescribeLink 物件上之 describes 屬性所參考的「零件」(wt.part.WTPart) 物件,最後擷取這些「零件」(wt.part.WTPart) 物件上的 name 屬性。
「資源工作分派」(com.ptc.projectmanagement.assignment.ResourceAssignment)
parentReference^com.ptc.projectmanagement.plan.PlanActivity~deadline
導覽至目前「資源工作分派」(com.ptc.projectmanagement.assignment.ResourceAssignment) 物件上之 parentReference (parentReference) 屬性所參考的「活動」(com.ptc.projectmanagement.plan.PlanActivity) 物件,然後從這些「活動」(com.ptc.projectmanagement.plan.PlanActivity) 物件中擷取「期限」(deadline) 屬性。
「零件」(wt.part.WTPart)
describes@wt.part.WTPartDescribeLink~describedBy^wt.doc.WTDocument~publisher
(此對應假設您已針對「文件」(wt.doc.WTDocument) 物件類型建立「發佈者」(publisher) 屬性)
導覽至擁有參考目前「零件」(wt.part.WTPart) 物件之 describes 屬性的 wt.part.WTPartDescribeLink 物件,然後導覽至這些「零件」(wt.part.WTPart) 物件上之 describedBy 屬性所參考的「文件」(wt.doc.WTDocument) 物件,最後擷取這些「文件」(wt.doc.WTDocument) 物件上的「發行者」(publisher) 屬性。
「零件」(wt.part.WTPart)
name=title@wt.doc.WTDocument~description
導覽至擁有與目前「零件」(wt.part.WTPart) 物件上的「名稱」(name) 屬性相符之「標題」(title) 屬性的「文件」(wt.doc.WTDocument) 物件,然後擷取這些「文件」(wt.doc.WTDocument) 物件上的「描述」(description) 屬性。
「文件」(wt.doc.WTDocument)
usedBy@wt.doc.WTDocumentUsageLink~uses^wt.doc.WTDocumentMaster~name
導覽至擁有參考目前「文件」(wt.doc.WTDocument) 物件之 usedBy 屬性的 wt.doc.WTDocumentUsageLink 物件,然後導覽至這些 wt.doc.WTDocumentUsageLink 物件上之 uses 屬性所參考的「文件主物件」(wt.doc.WTDocumentMaster) 物件,最後擷取這些「文件主物件」(wt.doc.WTDocumentMaster) 物件上的「名稱」(name) 屬性。
常用連結物件
下表列出常用 Windchill 連結物件及其關係。此資訊在別名屬性對應中可能會很有用。
從物件
從關係
連結物件
到關係
到物件
wt.doc.WTDocument
usedBy
wt.doc.WTDocumentUsageLink
uses
wt.doc.WTDocumentMaster
wt.doc.WTDocument
describes
wt.doc.WTDocumentDependencyLink
describedBy
wt.doc.WTDocument
wt.doc.WTDocument
describedBy
wt.part.WTPartDescribeLink
describes
wt.part.WTPart
wt.part.WTPart
usedBy
wt.part.WTPartUsageLink
uses
wt.part.WTPartMaster
wt.part.WTPart
referencedBy
wt.part.WTPartReferenceLink
references
wt.doc.WTDocumentMaster
wt.part.WTPart
buildTarget
wt.epm.EPMBuildRule
buildSource
wt.epm.EPMDocument
wt.part.WTPart
describes
wt.epm.EPMDescribeLink
describedBy
wt.epm.EPMDocument
wt.part.WTPartMaster
alternates
wt.part.WTPartAlternateLink
alternateFor
wt.part.WTPartMaster
wt.part.WTPartUsageLink
substituteFor
wt.part.WTPartSubstituteLink
substitutes
wt.part.WTPartMaster
wt.epm.EPMDocument
contains
wt.epm.structure.EPMContainedIn
containedIn
wt.epm.familytable.EPMFamilyTable
wt.epm.EPMDocument
usedBy
wt.epm.structure.EPMMemberLink
uses
wt.epm.EPMDocumentMaster
wt.epm.EPMDocument
referencedBy
wt.epm.structure.EPMReferenceLink
references
wt.epm.EPMDocumentMaster
wt.epm.EPMDocument
variant
wt.epm.structure.EPMVariantLink
generic
wt.epm.EPMDocumentMaster
wt.change2.WTChangeOrder2
addressedBy
wt.change2.AddressedBy2
addresses
wt.change2.WTChangeRequest2
wt.change2.WTChangeActivity2
includedIn
wt.change2.IncludedIn2
includes
wt.change2.WTChangeOrder2