Hi @VladiSlav,
Please refer to this helpful article :
@VladiSlav
If you have a simple IBA, you just have to add in Parts.json the following :
{
"name":"IBA",
"internalName":"IBA",
"type":"String"
}
- Here an illustration with a custom enumtype (adding an IBA linked to a Global Enumeration).
Create an entry in Parts.json, specifying a new attribute. As it is an enumeration, I will add the following :
{
"name": "EnumString",
"internalName": "EnumString",
"type": "PTC.EnumType"
}
In Parts.json, findable in codebase\rest\ptc\domain\ProdMgmt\v2\entity\Parts.json
Then it will look like this :
{
"name":"Part",
"collectionName":"Parts",
"type":"wcType",
"wcType":"wt.part.WTPart",
"description":"Parts",
"operations":"CREATE,UPDATE,DELETE",
"attributes":[
{
"name":"Name",
"internalName":"name",
"type":"String",
"required":true
}, {
"name":"Number",
"internalName":"number",
"type":"String"
}, {
"name":"EndItem",
"internalName":"endItem",
"type":"Boolean",
"driver":true
}, {
"name":"TypeIcon",
"internalName":"type_icon",
"type":"PTC.Icon",
"readOnly":true
}, {
"name":"Identity",
"internalName":"identity",
"type":"String",
"readOnly":true
}, {
"name":"GeneralStatus",
"internalName":"statusFamily_General",
"type":"PTC.Icon",
"readOnly":true
}, {
"name":"ShareStatus",
"internalName":"statusFamily_Share",
"type":"PTC.Icon",
"readOnly":true
}, {
"name":"ChangeStatus",
"internalName":"statusFamily_Change",
"type":"PTC.Icon",
"readOnly":true
}, {
"name":"Supersedes",
"internalName":"statusFamily_Supersede",
"type":"PTC.Icon",
"readOnly":true
}, {
"name":"AssemblyMode",
"internalName":"partType",
"type":"PTC.EnumType",
"required":true
}, {
"name":"DefaultUnit",
"internalName":"defaultUnit",
"type":"PTC.EnumType",
"required":true
}, {
"name":"DefaultTraceCode",
"internalName":"defaultTraceCode",
"type":"PTC.EnumType",
"required":true
}, {
"name":"Source",
"internalName":"source",
"type":"PTC.EnumType",
"required":true
}, {
"name":"ConfigurableModule",
"internalName":"genericType",
"type":"PTC.EnumType"
}, {
"name":"GatheringPart",
"internalName":"hidePartInStructure",
"type":"Boolean",
"required":true
}, {
"name":"PhantomManufacturingPart",
"internalName":"phantom",
"type":"Boolean",
"required":true
}, {
"name":"BOMType",
"internalName":"variation1",
"type":"PTC.EnumType"
}, {
"name":"AlternateNumber",
"internalName":"variation2",
"type":"PTC.EnumType"
},{
"name": "EnumString",
"internalName": "EnumString",
"type": "PTC.EnumType"
}
],
"inherits":[
{
"name": "versioned"
}, {
"name": "contextManaged"
}, {
"name": "lifecycleManaged"
}, {
"name": "viewManageable"
}, {
"name": "workable"
}, {
"name": "representable"
}, {
"name": "organizationOwned"
}, {
"name": "foldered"
}
],
"navigations":[
{
"name":"Uses",
"target":"PartUses",
"type":"PartUse",
"isCollection":true,
"containsTarget":true
}, {
"name":"UsedBy",
"target":"Parts",
"type":"Part",
"isCollection":true
}, {
"name":"DescribedBy",
"target":"PartDescribeLinks",
"type":"PartDescribeLink",
"isCollection":true,
"containsTarget":true
}, {
"name":"References",
"target":"PartReferenceLinks",
"type":"PartReferenceLink",
"isCollection":true,
"containsTarget":true
}
],
"functions":[],
"actions":[
{
"name":"GetBOM",
"description":"Get Bill Of Materials",
"parameters": [{
"name":"part",
"type":"Part",
"isNullable":false,
"isCollection":false
}, {
"name":"navigationCriteriaId",
"type":"String",
"isNullable":true,
"isCollection":false
}],
"returnType": {
"type":"BOM",
"isCollection":false
}
}
]
}
Without restarting Windchill :
GET http://pdm10.de/Windchill/servlet/odata/ProdMgmt/Parts('VR:wt.part.WTPart:2874036') In Postman
Give this output :
{
"@odata.context": "http://pdm10.de/Windchill/servlet/odata/v2/ProdMgmt/$metadata#Parts",
"@odata.type": "#PTC.ProdMgmt.AsArticle",
"ID": "OR:wt.part.WTPart:2874037",
"Name": "MyPar",
"Number": "0000071301",
"EndItem": false,
"TypeIcon": {
"Path": "http://pdm10.de/Windchill/netmarkets/images/config_part.gif",
"Tooltip": "Configurable Module"
},
"Identity": "0000071301, MyPar, Demo Organization, A (Design)",
"GeneralStatus": {
"Path": "http://pdm10.de/Windchill/com/ptc/core/htmlcomp/images/checkedout_byyou9x9.gif",
"Tooltip": "Working copy, checked-out to you"
},
"ShareStatus": null,
"ChangeStatus": null,
"Supersedes": null,
"AssemblyMode": {
"Value": "separable",
"Display": "Separable"
},
"DefaultUnit": {
"Value": "ea",
"Display": "each"
},
"DefaultTraceCode": {
"Value": "0",
"Display": "Untraced"
},
"Source": {
"Value": "make",
"Display": "Make"
},
"ConfigurableModule": {
"Value": "dynamic",
"Display": "Yes"
},
"GatheringPart": false,
"PhantomManufacturingPart": false,
"BOMType": null,
"AlternateNumber": null,
"EnumString": {
"Value": "SteelSheets",
"Display": "Steel Sheets"
},
"View": "Design",
"CheckoutState": "Working copy, checked-out to you",
"CheckOutStatus": "cat-working-copy",
"Comments": null,
"State": {
"Value": "INWORK",
"Display": "In Work"
},
if it does not work please expose here how you are driving this use case.
best regards
Hicham