Converting Process Plans from Windchill MPMLink > Supporting Windchill Custom Attributes
Supporting Windchill Custom Attributes
Additional configurations are needed to import values from Windchill that are not being imported as part of the out-of-the-box Operator Advisor conversion process. These values could be from Windchill attributes not already mapped to the Operator Advisor data model, or custom Windchill attributes, also known as soft attributes.
The following example imports the values of MyCustomAttribute, which is a string data type custom attribute on a Windchill MPMLink operation.
1. Verify that the attribute values are being returned in REST calls. Execute the following command against the Windchill MPMLink REST services, using either the MPMLink OData connector thing (PTC.SCA.SCO.MPMLink_ODataConnector) or directly with a REST client, and verify that MyCustomAttribute is being returned:
GET /servlet/odata/MfgProcMgmt/Operations('ID')
2. Update the related <Operator_Advisor_object>_AP data shape. For more information, see Adding Custom Properties and Data Shapes.
In this example, we are adding values from MyCustomAttribute to a new String data type field on the PTC.SCA.SCO.WorkDefinition_AP data shape called MyCustomField.
3. Update the corresponding database table to add a new column. In this example, execute the AddColumn service on the database thing configured for your system, with the following input parameters:
dataShapeNameWorkDefinition_AP
fieldNameMyCustomField
4. Verify that a column for the new field is available in the database, by executing a Get service related to the main data shape. In this example, execute the GetWorkDefinition service from the PTC.SCA.SCO.DefaultProductionOrderManager thing and verify that the results include a MyCustomfield column.
5. On the MPMLink work definition converter (PTC.SCA.SCO.MPMLinkWorkDefinitionConverter), override the TranslateODataBOPToWDJson service. Locate the extractWorkDefinition method, and append the new property to the wd object. In our example, append the following to the wd object:
"MyCustomField": op_holder["MyCustomAttribute"],
Values for the MyCustomAttribute property on Windchill MPMLink operations are now included when process plan information is pulled from Windchill MPMLink and converted into Operator Advisor work definitions and related information.
Was this helpful?