Remove project from object

This example pipeline demonstrates how to remove a project assignment from an object.


Pipeline consisting of JSON Generator Snap, Tc Create Snap, Tc Project Assign Snap and Tc Project Remove Snap.

Object has an assignment to an project. This can be done by executing first three Snaps in shown pipeline which are described in Assign project to object . The assigned project can be removed with the Tc Project Remove Snap. Again value for field “Project” is hard coded. Output of Tc Project Assign Snap is input document for Tc Project Remove Snap.

[
  {
    "_id": "TC*Part Revision*null***AqAAANbH7hAnmD",
    "item_id": "052853",
    "item_revision_id": "A",
    "object_desc": "Test Create with Snap",
    "object_name": "SL_Test_010426",
    "object_string": "052853/A;1-SL_Test_010426",
    "object_type": "Part Revision",
    "object_type_DISPLAY": "Part Revision",
    "project_list": [
      "TC*TC_Project*null***Q2KAAAmY7hAnmD"
    ],
    "UID": "AqAAANbH7hAnmD",
    "original": {
      "_id": "TC*Part Revision*null***AqAAANbH7hAnmD",
      "item_id": "052853",
      "item_revision_id": "A",
      "object_desc": "Test Create with Snap",
      "object_name": "SL_Test_010426",
      "object_string": "052853/A;1-SL_Test_010426",
      "object_type": "Part Revision",
      "object_type_DISPLAY": "Part Revision",
      "project_list": [],
      "UID": "AqAAANbH7hAnmD",
      "original": {
        "object_type": "Part",
        "attributes": {
          "object_desc": "Test Create with Snap",
          "object_name": "SL_Test_010426"
        },
        "expandAttributes": [
          "object_type",
          "object_name",
          "object_string",
          "object_desc",
          "item_id",
          "item_revision_id",
          "project_list"
        ]
      }
    }
  }
]

Steps

1: In the snap configuration following values has to fed into fields:

  • $UID to Object ID
  • $original.original.expandAttributes to Expand Attributes Path
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 of Tc Project Remove Snap.

[
  {
    "_id": "TC*Part Revision*null***AqAAANbH7hAnmD",
    "item_id": "052853",
    "item_revision_id": "A",
    "object_desc": "Test Create with Snap",
    "object_name": "SL_Test_010426",
    "object_string": "052853/A;1-SL_Test_010426",
    "object_type": "Part Revision",
    "object_type_DISPLAY": "Part Revision",
    "project_list": [],
    "UID": "AqAAANbH7hAnmD",
    "original": {
      "_id": "TC*Part Revision*null***AqAAANbH7hAnmD",
      "item_id": "052853",
      "item_revision_id": "A",
      "object_desc": "Test Create with Snap",
      "object_name": "SL_Test_010426",
      "object_string": "052853/A;1-SL_Test_010426",
      "object_type": "Part Revision",
      "object_type_DISPLAY": "Part Revision",
      "project_list": [
        "TC*TC_Project*null***Q2KAAAmY7hAnmD"
      ],
      "UID": "AqAAANbH7hAnmD",
      "original": {
        "_id": "TC*Part Revision*null***AqAAANbH7hAnmD",
        "item_id": "052853",
        "item_revision_id": "A",
        "object_desc": "Test Create with Snap",
        "object_name": "SL_Test_010426",
        "object_string": "052853/A;1-SL_Test_010426",
        "object_type": "Part Revision",
        "object_type_DISPLAY": "Part Revision",
        "project_list": [],
        "UID": "AqAAANbH7hAnmD",
        "original": {
          "object_type": "Part",
          "attributes": {
            "object_desc": "Test Create with Snap",
            "object_name": "SL_Test_010426"
          },
          "expandAttributes": [
            "object_type",
            "object_name",
            "object_string",
            "object_desc",
            "item_id",
            "item_revision_id",
            "project_list"
          ]
        }
      }
    }
  }
]

Output document shows now empty “project_list”. The project was removed.