Creating Multiple Operations for an Operation Holder
You can create single or multiple Operations or their subtypes for an Operation Holder, by specifying the required and other OOTB attributes in the request body. You can also specify modeled and other types of attributes, including IBAs such as enumerated lists. To create an Operation, you must first check out the Operation Holder.
You can also assign single-valued or multi-valued security labels for single or multiple Operations.
Example: Creating Multiple Operations for a Process Plan
This example shows you how to create two Operations for a Process Plan object specified in the request URI. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/OperationHolders('OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:195192')/PTC.MfgProcMgmt.CreateOperationsInContext
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Operations": [
{
"Name": "OPERATION_test1",
"OutSourced": true,
"SubOperationTimeIncluded": false,
"ERPSubOperationPublished": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:112989')",
"Scheduled": false,
"SubOperationInWorkInstruction": false,
"Quantity": 1,
"InspectionNeeded": false,
"Category": {
"Value": "production",
"Display": "Production"
},
"Unit": "ea",
"Description": "operation1",
"LongDescription": "LongDescription1",
"DefaultTraceCode": "L"
},
{
"Name": "OPERATION_test2",
"OutSourced": true,
"SubOperationTimeIncluded": false,
"ERPSubOperationPublished": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:112989')",
"Scheduled": false,
"SubOperationInWorkInstruction": false,
"Quantity": 1,
"InspectionNeeded": false,
"Category": {
"Value": "production",
"Display": "Production"
},
"Unit": "ea",
"Description": "operation2",
"LongDescription": "LongDescription2",
"DefaultTraceCode": "L"
}
]
}
Example: Creating a Standard Operation Subtype
This example shows you how to create a single Operation subtype for a Process Plan object specified in the request URI. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/OperationHolders('OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:195192')/PTC.MfgProcMgmt.CreateOperationsInContext
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Operations": [
{
"Name": "single_OPERATION_test",
"OutSourced": true,
"SubOperationTimeIncluded": false,
"ERPSubOperationPublished": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:112989')",
"Scheduled": false,
"@odata.type": "#org.rnd.SubTypeOperation",
"CustomAttrybute": "test",
"SubOperationInWorkInstruction": false,
"Quantity": 1,
"InspectionNeeded": false,
"Category": {
"Value": "production",
"Display": "Production"
},
"Unit": "ea",
"Description": "subtype",
"LongDescription": "LongDescription",
"DefaultTraceCode": "L"
}
]
}
Example: Assigning Single-valued Security Labels
This example shows you how to assign single-valued security labels while creating two Operations for a Process Plan specified in the request URI. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/OperationHolders('OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:195192')/PTC.MfgProcMgmt.CreateOperationsInContext
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Operations": [
{
"Name": "OPERATION_test1",
"OutSourced": true,
"SubOperationTimeIncluded": false,
"ERPSubOperationPublished": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:112989')",
"Scheduled": false,
"SubOperationInWorkInstruction": false,
"Quantity": 1,
"InspectionNeeded": false,
"Category": {
"Value": "production",
"Display": "Production"
},
"Unit": "ea",
"Description": "operation1",
"LongDescription": "LongDescription1",
"DefaultTraceCode": "L",
"EXPORTCONTROL": "LNC"
},
{
"Name": "OPERATION_test2",
"OutSourced": true,
"SubOperationTimeIncluded": false,
"ERPSubOperationPublished": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:112989')",
"Scheduled": false,
"SubOperationInWorkInstruction": false,
"Quantity": 1,
"InspectionNeeded": false,
"Category": {
"Value": "production",
"Display": "Production"
},
"Unit": "ea",
"Description": "operation2",
"LongDescription": "LongDescription2",
"DefaultTraceCode": "L",
"EXPORTCONTROL": "LNC"
}
]
}
Example: Assigning Multi-valued Security Labels
This example shows you how to assign multi-valued security labels while creating two Operations for a Process Plan specified in the request URI. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/OperationHolders('OR:com.ptc.windchill.mpml.processplan.MPMProcessPlan:195192')/PTC.MfgProcMgmt.CreateOperationsInContext
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Operations": [
{
"Name": "OPERATION_test1",
"OutSourced": true,
"SubOperationTimeIncluded": false,
"ERPSubOperationPublished": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:112989')",
"Scheduled": false,
"SubOperationInWorkInstruction": false,
"Quantity": 1,
"InspectionNeeded": false,
"Category": {
"Value": "production",
"Display": "Production"
},
"Unit": "ea",
"Description": "operation1",
"LongDescription": "LongDescription1",
"DefaultTraceCode": "L",
"EXPORTCONTROL": "LNC,CUSTOM"
},
{
"Name": "OPERATION_test2",
"OutSourced": true,
"SubOperationTimeIncluded": false,
"ERPSubOperationPublished": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:112989')",
"Scheduled": false,
"SubOperationInWorkInstruction": false,
"Quantity": 1,
"InspectionNeeded": false,
"Category": {
"Value": "production",
"Display": "Production"
},
"Unit": "ea",
"Description": "operation2",
"LongDescription": "LongDescription2",
"DefaultTraceCode": "L",
"EXPORTCONTROL": "LNC,CUSTOM"
}
]
}