下面是一个 JavaScript 服务,将通过演示输入启动 GetSelectedItemsFromSelectedParts 服务。
这两个信息表将作为 JSON 结构进行填充。
const selectedParts ={
dataShape: {
fieldDefinitions: {
idPath: {
name: "idPath",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_0",
aspects: {}
},
propGroup: {
name: "propGroup",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_1",
aspects: {}
},
propName: {
name: "propName",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_2",
aspects: {}
},
propValue: {
name: "propValue",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_3",
aspects: {}
}
}
},
rows: [
{
"idPath": "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToPartLink:11161@1574/0:8671bacd-1a38-4319-9550-b3ef1410c2f0",
"_isSelected": false
}
],
name: "",
description: ""
};
const structurePropertyValues = {
dataShape: {
fieldDefinitions: {
idPathRoot: {
name: "idPathRoot",
description: "idPathRoot",
baseType: "STRING",
ordinal: 0,
alias: "_0",
aspects: {}
},
idPath: {
name: "idPath",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_1",
aspects: {}
},
propGroup: {
name: "propGroup",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_2",
aspects: {}
},
propName: {
name: "propName",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_3",
aspects: {}
},
propValue: {
name: "propValue",
description: "",
baseType: "STRING",
ordinal: 1,
alias: "_4",
aspects: {}
}
}
},
rows: [
{
idPathRoot: "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToConsumableLink:3341",
idPath: "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToConsumableLink:3341",
propGroup: "WindchillPart",
propName: "part_name",
propValue: "Tool-Table"
},
{
idPathRoot: "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToPartLink:11161",
idPath: "/MPMOperationUsageLink:1371/MPMOperationUsageLink:1367/MPMOperationToPartLink:11161@1574",
propGroup: "WindchillMPMLink",
propName: "operationToPartUniqueId",
propValue: "MPMOperationToPartLink:11161"
}
]
};
// result: INFOTABLE dataShape: ""
result = Things["PTC-PLM.Windchill.BillOfProcess.Utility"].GetSelectedItemsFromSelectedParts({
selectedParts: selectedParts,
structurePropertyValues: structurePropertyValues /* INFOTABLE */,
version: "1" /* STRING */
});
{
"timeStamp": "2025-02-19 10:09:44.593",
"data": [
{
"itemListsData": [
{
"items": [
{
"CrossSelectionId": {
"value": "MPMOperationToPartLink:11161"
}
}
],
"objectType": "PTC.ProdMgmt.Part.Custom.Adapter"
}
],
"adapter": {
"instanceName": "windchill",
"thingName": "PTC.WCAdapter"
}
}
],
"statusMessage": "OK",
"status": "200"
}