Updating Attributes of Process Plan
To update the attributes of an existing process plan object or its subtype, you must first check out the object. Similarly, you can also update the attributes of an existing standard procedure object or its subtype.
You can also optionally update a process plan or standard procedure in the context of change.
If you perform Undo Checkout on the process plan object, the changes are rolled back. When you update the process plan object, the version of the process plan object will be iterated upon checking it in. You can specify the OID of any iteration/revision/view of the process plan object or its subtype. You can update modeled and all other types of attributes, including IBAs such as enumerated lists.
To update an attribute, you must specify the value with its valid internal name. If a constraint is applied to the attribute, you must specify the internal name of the value specified in the constraint.
If you want to clear the value of an attribute, you can specify its value as null in the request.
If you do not specify an attribute in the request body, then the attribute retains its existing value.
* 
You cannot modify the following attributes: Name, Number, Standard, Category, Unit, Occurrence Allocation From Any Level.
Example: Updating Attributes of a Specific Process Plan
This example shows you how to update the attributes of a specific Process Plan object. Use the following PATCH URI with the request body.
URI
PATCH /Windchill/servlet/odata/MfgProcMgmt/ProcessPlans('OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:44148884')
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ProcessPlanQuantity": 2,
"Description": "Updated_Process_Plan",
"LongDescription": "This is an updated process plan for testing.",
"CustomAttribute": "UpdatedTest1"
}
* 
Similarly, you can update the attributes of a specific Standard Procedure object by specifying its OID in the request URI.
Example: Updating Attributes of Multiple Process Plans
This example shows you how to update the attributes of three Process Plan objects specified in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/UpdateProcessPlans
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Process Plans": [
{
"ID": "OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:44148884",
"ProcessPlanQuantity": 2,
"Description": "Updated_Process_Plan1",
"LongDescription": "This is an updated process plan for testing.",
"CustomAttribute": "UpdatedTest1",
"Comments": "PP1"
},
{
"ID": "OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:4414870",
"ProcessPlanQuantity": 3,
"Description": "Updated_Process_Plan2",
"CustomAttribute": "UpdatedTest2",
"Comments": "PP2"
},
{
"ID": "OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:4414270",
"ProcessPlanQuantity": 3,
"Description": "Updated_Process_Plan2",
"CustomAttribute": "UpdatedTest2",
"Comments": "PP3"
}
]
}
* 
Similarly, you can update the attributes of multiple Standard Procedures by specifying their OIDs in the request body. You can update the attributes of Standard Procedure and Process Plan objects simultaneously by specifying their respective OIDs in the same request body.
Updating Process Plans in Context of Change
This example shows you how to update two Process Plans in the context of Change. In this example, one change task object is specified for each Process Plan object in the request body. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/UpdateProcessPlans
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ProcessPlans": [
{
"ID": "OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:200061",
"Description": "Description1",
"ResultedByObjects@odata.bind": [
"ChangeTasks('VR:wt.change2.WTChangeActivity2:205227')"
]
},
{
"ID": "OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:200465",
"Description": "Description2",
"LongDescription": "This is an updated process plan for testing.",
"ResultedByObjects@odata.bind": [
"ChangeTasks('VR:wt.change2.WTChangeActivity2:205227')"
]
}
]
}
The request updates and adds the modified Process Plan object as a Resultant object to the specified Change object.
Similarly, you can update a single or multiple Standard Procedures in the context of Change by specifying its OIDs in the request body.
Was this helpful?