Create a part and update it

This example pipeline demonstrates how to create a part and then update one of its attributes.


Pipeline consisting of JSON Generator Snap, Tc Create Snap, JSON Generator Snap and Tc Update Snap.

Steps

1: Input for the creation is stored in JSON Generator. The stored JSON document contains data necessary for creating a Part.

Snap configuration

Snap output


Settings of JSON Generator Snap.

[
  {
    "object_type": "Part",
    "attributes": {
		"object_desc": "Test Create with Snap",
		"object_name": "Test 0204262",
		"fnd0CurrentLocationCode": "55"
	},
	"expandAttributes": [
		"object_name",
		"object_string",
		"object_desc",
		"object_type",
		"item_id",
		"item_revision_id",
		"creation_date", 
		"fnd0CurrentLocationCode",
		"checked_out"
	]
  }
]

2: In the snap configuration following values has to fed into fields of the Tc Create Snap:

  • $object_type to field Object Type
  • $attributes to field Object Attributes Path
  • $expandAttributes to field Expand Attributes Path

Snap configuration

Snap output


Settings of Tc Create Snap. Checkboxes to relate to Newstuff and to return revision are ON.

[
  {
    "_id": "TC*Part Revision*null***AWPAANsp7hAnmD",
    "checked_out": " ",
    "creation_date": "2026-04-02T09:13:56Z",
    "fnd0CurrentLocationCode": null,
    "item_id": "052859",
    "item_revision_id": "A",
    "object_desc": "Test Create with Snap",
    "object_name": "Test 0204262",
    "object_string": "052859/A;1-Test 0204262",
    "object_type": "Part Revision",
    "object_type_DISPLAY": "Part Revision",
    "UID": "AWPAANsp7hAnmD",
    "original": {
      "object_type": "Part",
      "attributes": {
        "object_desc": "Test Create with Snap",
        "object_name": "Test 0204262",
        "fnd0CurrentLocationCode": "55"
      },
      "expandAttributes": [
        "object_name",
        "object_string",
        "object_desc",
        "object_type",
        "item_id",
        "item_revision_id",
        "creation_date",
        "fnd0CurrentLocationCode",
        "checked_out"
      ]
    }
  }
]

Output document contains data of newly created object. The attribute “fnd0CurrentLocationCode” is still null since it is an attribute which can not be set while create in Teamcenter.

3: The resulting object includes ID information which can be taken in JSON Generator Snap document.

Note:

UIDs in Teamcenter are as the name says UNIQUE. The UIDs in the example only exist in our Teamcenter system as expected for our example. Same is valid for Adapter ID "_id" since its base is the UID.

Snap configuration

Snap output


Settings tab of second JSON Generator Snap.

[
  {
    "_id": $._id,
	"object_type":$.object_type,
    "updateAttributes":{
		"object_desc": "Test Update with Snap",
		"fnd0CurrentLocationCode": "24"
	},
	"expandAttributes": [
		"object_type",
		"object_name",
		"object_string",
		"object_desc",
		"item_id",
		"item_revision_id",
		"creation_date", 
		"fnd0CurrentLocationCode",
		"checked_out"
	]
  }
]

The stored JSON document stores “id” and “object_type“ value and contains data to be updated for the Part.

4: In the snap configuration following values has to fed into fields of the Tc Update Snap:

  • $_id to field Object ID
  • $object_type to field Object Type
  • $updateAttributes to field Object Attributes Path
  • $expandAttributes to field Expand Attributes Path

Snap configuration

Snap output


Settings of Tc Update Snap.

[
  {
    "_id": "TC*Part Revision*null***AWPAANsp7hAnmD",
    "checked_out": " ",
    "creation_date": "2026-04-02T09:13:56Z",
    "fnd0CurrentLocationCode": "24",
    "item_id": "052859",
    "item_revision_id": "A",
    "object_desc": "Test Update with Snap",
    "object_name": "Test 0204262",
    "object_string": "052859/A;1-Test 0204262",
    "object_type": "Part Revision",
    "object_type_DISPLAY": "Part Revision",
    "UID": "AWPAANsp7hAnmD",
    "original": {
      "_id": "TC*Part Revision*null***AWPAANsp7hAnmD",
      "object_type": "Part Revision",
      "updateAttributes": {
        "object_desc": "Test Update with Snap",
        "fnd0CurrentLocationCode": "24"
      },
      "expandAttributes": [
        "object_type",
        "object_name",
        "object_string",
        "object_desc",
        "item_id",
        "item_revision_id",
        "creation_date",
        "fnd0CurrentLocationCode",
        "checked_out"
      ],
      "original": {
        "_id": "TC*Part Revision*null***AWPAANsp7hAnmD",
        "checked_out": " ",
        "creation_date": "2026-04-02T09:13:56Z",
        "fnd0CurrentLocationCode": null,
        "item_id": "052859",
        "item_revision_id": "A",
        "object_desc": "Test Create with Snap",
        "object_name": "Test 0204262",
        "object_string": "052859/A;1-Test 0204262",
        "object_type": "Part Revision",
        "object_type_DISPLAY": "Part Revision",
        "UID": "AWPAANsp7hAnmD",
        "original": {
          "object_type": "Part",
          "attributes": {
            "object_desc": "Test Create with Snap",
            "object_name": "Test 0204262",
            "fnd0CurrentLocationCode": "55"
          },
          "expandAttributes": [
            "object_name",
            "object_string",
            "object_desc",
            "object_type",
            "item_id",
            "item_revision_id",
            "creation_date",
            "fnd0CurrentLocationCode",
            "checked_out"
          ]
        }
      }
    }
  }
]

Output JSON document provides an example of the response returned when updating a Part Revision in Teamcenter. Now attribute “fnd0CurrentLocationCode” has a value set and object_desc is updated too.