建立自己的導覽條件範例
在製作 JSON 有效負載以篩選轉換後的製程計劃時,查看使用您自己的資料的範例很有用。您可以建立一個範例,在其中包括所支援的導覽條件類型的某些組合,或包括所有導覽條件類型。
若要建立自己的導覽條件範例,請執行下列步驟:
1. Windchill MPMLink 中建立及儲存您的篩選器。如需有關 Windchill MPMLink 篩選器設定的詳細資訊,請參閱每種導覽條件類型的範例主題:基準線日期生失效生命週期選項零件標籤序列生失效
2. Windchill MPMLink 擷取已存篩選器的導覽條件。若需進一步資訊,可參閱 擷取已存篩選器的導覽條件
3. 在將回傳的導覽條件用作 ConvertFromProcessPlanID 服務上輸入參數的 JSON 有效負載之前,應先對其進行清理:
從已存篩選器的根項目中移除以下鍵:
{
"Centricity": "...",
"@odata.context": "...",
"ID": "...",
"LastModified": "...",
"Name": "...",
"SharedToAll": "..."
"CreatedOn": "..."
}
移除以下鍵的所有實例:
{ "DisableRuleChecking": "..." }
* 
HideUnresolvedDependents 鍵對製程計劃轉換沒有任何影響,無論其設定為何 (true 或 false)。在轉換中不會處理未解決的相依物件。JSON 有效負載可以保留或省略此鍵。
已清理的導覽條件現已準備就緒,可用作 ConvertFromProcessPlanID 服務上輸入參數的 JSON 有效負載。
範例—原始導覽條件
下列範例顯示從 Windchill MPMLink 的已儲存篩選器傳回的原始導覽條件。此篩選器已儲存自製程計劃的「結構」標籤上的「篩選」動作集。其包括多種類型的導覽條件。您必須先清理此內容,然後才能將其用作 processPlanNavigationCriteria 輸入參數的 JSON 有效負載:
{
"ApplicableType": "PTC.MfgProcMgmt.ProcessPlan",
"ApplyToTopLevelObject": true,
"Centricity": false,
"ConfigSpecs": [{
"@odata.type": "#PTC.NavCriteria.WTPartBaselineConfigSpec",
"Baseline": "wt.vc.baseline.ManagedBaseline:284734"
},
{
"@odata.type": "#PTC.NavCriteria.WTPartStandardConfigSpec",
"WorkingIncluded": false,
"View": "Design",
"LifeCycleState": {
"Value": "RELEASED",
"Display": "Released"
},
"Variation1": {
"Value": "production",
"Display": "Production"
},
"Variation2": {
"Value": "002",
"Display": "002"
}
},
{
"@odata.type": "#PTC.NavCriteria.WTPartEffectivityUnitConfigSpec",
"EffectiveUnit": "1",
"EffectivityType": {
"Value": "MSN",
"Display": "MSN"
},
"EffectiveContext": "wt.part.WTPartMaster:245852",
"View": "Design",
"Variation1": {
"Value": "production",
"Display": "Production"
},
"Variation2": {
"Value": "001",
"Display": "001"
}
},
{
"@odata.type": "#PTC.NavCriteria.WTPartEffectivityDateConfigSpec",
"EffectiveDate": "2019-12-02T05:00:00Z",
"EffectiveContext": "wt.part.WTPartMaster:246691",
"View": "Design",
"Variation1": {
"Value": "production",
"Display": "Production"
},
"Variation2": {
"Value": "001",
"Display": "001"
}
}
],
"CreatedOn": "2019-11-15T19:52:32Z",
"Filters": [{},
{
"@odata.type": "#PTC.NavCriteria.OptionFilter",
"DisableRuleChecking": false,
"OverrideOptionSetRevision": "OR:com.ptc.windchill.option.model.OptionSet:294292",
"OptionFilterConfigSpecs": [{
"@odata.type": "#PTC.NavCriteria.OptionFilterConfigSpec",
"LifeCycleState": null,
"LatestActive": true,
"LifeCycleActive": false,
"EffActive": false,
"EffectiveDate": null
}],
"FilterMode": {
"InternalCode": 1,
"Name": "Standard"
},
"ChoiceValues": [{
"ID": "OR:com.ptc.windchill.option.model.Choice:246812",
"Name": "AUTOMATIC"
}]
}
],
"HideUnresolvedDependents": false,
"ID": "OR:wt.filter.NavigationCriteria:284749",
"LastModified": "2019-12-02T16:15:58Z",
"Name": "mega_dwu_filter",
"SharedToAll": false,
"UseDefaultForUnresolved": false
}
範例—已清理的 JSON 有效負載
下列代碼顯示上一個範例中的已清理內容。您可以將其用作 ConvertFromProcessPlanID 服務processPlanNavigationCriteria 輸入參數的 JSON 有效負載:
{
"ApplicableType": "PTC.MfgProcMgmt.ProcessPlan",
"ApplyToTopLevelObject": true,
"ConfigSpecs": [{
"@odata.type": "#PTC.NavCriteria.WTPartBaselineConfigSpec",
"Baseline": "wt.vc.baseline.ManagedBaseline:284734"
},
{
"@odata.type": "#PTC.NavCriteria.WTPartStandardConfigSpec",
"WorkingIncluded": false,
"View": "Design",
"LifeCycleState": {
"Value": "RELEASED",
"Display": "Released"
},
"Variation1": {
"Value": "production",
"Display": "Production"
},
"Variation2": {
"Value": "002",
"Display": "002"
}
},
{
"@odata.type": "#PTC.NavCriteria.WTPartEffectivityUnitConfigSpec",
"EffectiveUnit": "1",
"EffectivityType": {
"Value": "MSN",
"Display": "MSN"
},
"EffectiveContext": "wt.part.WTPartMaster:245852",
"View": "Design",
"Variation1": {
"Value": "production",
"Display": "Production"
},
"Variation2": {
"Value": "001",
"Display": "001"
}
},
{
"@odata.type": "#PTC.NavCriteria.WTPartEffectivityDateConfigSpec",
"EffectiveDate": "2019-12-02T05:00:00Z",
"EffectiveContext": "wt.part.WTPartMaster:246691",
"View": "Design",
"Variation1": {
"Value": "production",
"Display": "Production"
},
"Variation2": {
"Value": "001",
"Display": "001"
}
}
],
"Filters": [{},
{
"@odata.type": "#PTC.NavCriteria.OptionFilter",
"OverrideOptionSetRevision": "OR:com.ptc.windchill.option.model.OptionSet:294292",
"OptionFilterConfigSpecs": [{
"@odata.type": "#PTC.NavCriteria.OptionFilterConfigSpec",
"LifeCycleState": null,
"LatestActive": true,
"LifeCycleActive": false,
"EffActive": false,
"EffectiveDate": null
}],
"FilterMode": {
"InternalCode": 1,
"Name": "Standard"
},
"ChoiceValues": [{
"ID": "OR:com.ptc.windchill.option.model.Choice:246812",
"Name": "AUTOMATIC"
}]
}
],
"UseDefaultForUnresolved": false
}
這是否有幫助?