Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC BOM Transformation Domain > Checking in/Checking Out/Revising/Changing the State of Extended Data Objects
Checking in/Checking Out/Revising/Changing the State of Extended Data Objects
These examples show how to check in, check out, revise, and perform state change operations on Extended Data objects:
Example: Checking out an Extended Data Object
The following example shows how you can check out an extended data object using the following POST URI with the request body. You must specify the checkout note in the request body.
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
URI
POST Windchill/servlet/odata/BomTransformation/ExtendedDatas('OR:com.ptc.windchill.enterprise.data.EnterpriseData:204494')/PTC.BomTransformation.CheckOut
Request Body
{
"CheckOutNote": "Checked out"
}
Example: Undo Checkout of an Extended Data Object
This example shows you how to undo check out of an extended data object. Use the POST URI.
URI
POST Windchill/servlet/odata/BomTransformation/ExtendedDatas('OR:com.ptc.windchill.enterprise.data.EnterpriseData:204494')/PTC.MfgProcMgmt.UndoCheckOut
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Example: Checking in an Extended Data Object
The following example shows how you can check in an extended data object using the following POST URI with the request body.
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
URI
POST Windchill/servlet/odata/BomTransformation/ExtendedDatas('OR:com.ptc.windchill.enterprise.data.EnterpriseData:204493')/PTC.BomTransformation.CheckIn
Request Body
{
"KeepCheckedOut": "false",
"CheckInNote": "check in",
"CheckOutNote": ""
}
Example: Changing the State of an Extended Data Object
The following example shows how you can change the (life cycle) state of a specific extended data object with multiple versions. In this request, you can specify only the latest iteration of a particular revision of the object. For example, consider an extended data object with three iterations of its Revision A – A.1, A.2 and A.3. The request changes the state only for A.3. Use the following POST URI with the request body. In this example the state is specified in the request body.
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
URI
POST Windchill/servlet/odata/BomTransformation/ExtendedDatas('OR:com.ptc.windchill.enterprise.data.EnterpriseData:204493')/PTC.BomTransformation.SetState
Request Body
{
"State": {
"Value": "INWORK",
"DISPLAY": "In Work"
}
}
Example: Changing the State of Multiple Extended Data Objects
The following example shows how you can change the (life cycle) state of two extended data objects with multiple versions. For example, if one extended data object has versions A.1 and A.2 and the other extended data object has versions C.1, C.2, and C.3, then the request changes the state only for A.2 and C.3, respectively. Use the following POST URI with the request body. In this example, the state is specified in the request body.
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
URI
POST Windchill/servlet/odata/BomTransformation/SetStateExtendedDatas
Request Body
{
"ExtendedDatas": [
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:206762"
},
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:208322"
}
],
"State": {
"Value": "CANCELLED",
"Display": "Cancelled"
}
}
Example: Revising an Extended Data Object
The following example shows how you can revise a specific extended data object to the desired Revision directly. For example, if the existing Revision of the object is B, then the request revises the specified extended data object to Revision G, directly. Use the following POST URI with the request body.
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
URI
POST Windchill/servlet/odata/BomTransformation/ExtendedDatas('OR:com.ptc.windchill.enterprise.data.EnterpriseData:240734')/PTC.BomTransformation.Revise
Request Body
{
"VersionId": "G"
}
Example: Revising Multiple Extended Data Objects
This example shows you how to increment the revision of each of the two extended data objects, by one. For example, if you specify the OID of one extended data object of Revision M and the OID of other extended data object of Revision C in the request body, then the request revises the objects to Revision N and Revision D, respectively. Use the following POST URI with the request body.
* 
If you want to revise each of the two objects simultaneously from Revision A to J, then you must send the request nine times by replacing the older Revision OIDs of the objects with their newer Revision OIDs in each subsequent request. For example, if you send the first request that revises the objects from Revision A to B, then in the second request, you must specify the OIDs of Revision B in the request body to revise the objects from Revision B to C. Similarly, in the third request, you must specify the OIDs of Revision C to revise the objects from Revision C to D, and so on.
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
URI
POST Windchill/servlet/odata/BomTransformation/ReviseExtendedDatas
Request Body
{
"ExtendedDatas": [
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:999567"
},
{
"ID": "OR:com.ptc.windchill.enterprise.data.EnterpriseData:999234"
}
]
}