创建专属导航条件示例
在构建 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
}
这对您有帮助吗?