Tc Requirement Structure Create: Create Requirement Structure

This example shows the input document that creates a requirement structure together with its elements.

In the snap configuration following values has to fed into fields

  • $ to Structure Data Path
  • $.expandAttributes to Expand Attributes Path

The JSON object “lineObject” contains information about to be created Teamcenter object. Mandatory is “object_type” as it defines the type of the object to be created. In case of mandatory attributes for creation these attributes have to be defined in “lineObject” too. Requirement objects can contain rich content. This content can be send to Snap in JSON property “[richContent]” as demonstrated for paragraph P1. Since a structure shall be composed with the Snap “Tc Requirement Structure Create” the subelements are organized in “children” list in top element. Next to “lineObject” the JSON element “lineData” can contain attributes for relation between sub and top element.

[
   {
        "lineObject": {
        "object_type": "RequirementSpec",
        "object_name": "SnapTestSpec",
        "object_desc": "Spec Desc"
      },
      "children": [
        {
          "lineObject": {
            "object_type": "Paragraph",
            "object_name": "P1",
            "object_desc": "P1 Desc",
            "[richContent]": "<p>Req1 Desc</p> <p><b>Some Content</b></p>"
          },
          "lineData": {
          },
          "children": [
            {
              "lineObject": {
                "object_type": "Requirement",
                "object_name": "Req1",
                "object_desc": "Req1 Desc"
              },
              "lineData": {
              }
            }
          ]
        },
        {
          "lineObject": {
            "object_type": "Paragraph",
            "object_name": "P2",
            "object_desc": "P2 Desc"
          },
          "lineData": {
          },
          "children": [
            {
              "lineObject": {
                "object_type": "Requirement",
                "object_name": "Req2",
                "object_desc": "Req2 Desc"
              },
              "lineData": {
              }
            }
          ]
        }
      ],
      "expandAttributes": [
        "object_name",
        "object_desc",
        "object_type",
        "object_string"
      ]
    }
]

This will create a new requirement structure like:

SnapTestSpec |--P1 |--Req1 Desc |--P2 |--Req2 Desc

Snap configuration

Snap output


Settings tab of Snap using content of input document for fields.

[
  {
    "lineObjectInput": {
      "object_desc": "Spec Desc",
      "object_name": "SnapTestSpec",
      "object_type": "RequirementSpec"
    },
    "lineObject": {
      "_id": "TC*RequirementSpec Revision*null***AqEAAtTW7hAnmD",
      "object_desc": "Spec Desc",
      "object_name": "SnapTestSpec",
      "object_string": "053026/A;1-SnapTestSpec",
      "object_type": "RequirementSpec Revision",
      "object_type_DISPLAY": "Requirement Specification Revision",
      "UID": "AqEAAtTW7hAnmD"
    },
    "bomLine": {
      "_id": "TC*Fnd0RequirementBOMLine*null***BOM::61955",
      "object_string": "053026/A;1-SnapTestSpec",
      "UID": "BOM::61955"
    },
    "children": [
      {
        "action": "added",
        "lineObjectInput": {
          "[richContent]": "<p>Req1 Desc</p> <p><b>Some Content</b></p>",
          "object_desc": "P1 Desc",
          "object_name": "P1",
          "object_type": "Paragraph"
        },
        "lineData": {
        },
        "lineObject": {
          "_id": "TC*Paragraph Revision*null***A_IAAtTW7hAnmD",
          "object_desc": "P1 Desc",
          "object_name": "P1",
          "object_string": "053027/A;1-P1",
          "object_type": "Paragraph Revision",
          "object_type_DISPLAY": "Paragraph Revision",
          "UID": "A_IAAtTW7hAnmD"
        },
        "bomLine": {
          "_id": "TC*Fnd0RequirementBOMLine*null***BOM::61957",
          "object_string": "053027/A;1-P1",
          "UID": "BOM::61957"
        },
        "children": [
          {
            "action": "added",
            "lineObjectInput": {
              "object_desc": "Req1 Desc",
              "object_name": "Req1",
              "object_type": "Requirement"
            },
            "lineData": {
            },
            "lineObject": {
              "_id": "TC*Requirement Revision*null***gCIAAtTW7hAnmD",
              "object_desc": "Req1 Desc",
              "object_name": "Req1",
              "object_string": "REQ-000303/A;1-Req1",
              "object_type": "Requirement Revision",
              "object_type_DISPLAY": "Requirement Revision",
              "UID": "gCIAAtTW7hAnmD"
            },
            "bomLine": {
              "_id": "TC*Fnd0RequirementBOMLine*null***BOM::61961",
              "object_string": "REQ-000303/A;1-Req1",
              "UID": "BOM::61961"
            }
          }
        ]
      },
      {
        "action": "added",
        "lineObjectInput": {
          "object_desc": "P2 Desc",
          "object_name": "P2",
          "object_type": "Paragraph"
        },
        "lineData": {
        },
        "lineObject": {
          "_id": "TC*Paragraph Revision*null***QuGAAtTW7hAnmD",
          "object_desc": "P2 Desc",
          "object_name": "P2",
          "object_string": "053028/A;1-P2",
          "object_type": "Paragraph Revision",
          "object_type_DISPLAY": "Paragraph Revision",
          "UID": "QuGAAtTW7hAnmD"
        },
        "bomLine": {
          "_id": "TC*Fnd0RequirementBOMLine*null***BOM::61959",
          "object_string": "053028/A;1-P2",
          "UID": "BOM::61959"
        },
        "children": [
          {
            "action": "added",
            "lineObjectInput": {
              "object_desc": "Req2 Desc",
              "object_name": "Req2",
              "object_type": "Requirement"
            },
            "lineData": {
            },
            "lineObject": {
              "_id": "TC*Requirement Revision*null***gOPAAtTW7hAnmD",
              "object_desc": "Req2 Desc",
              "object_name": "Req2",
              "object_string": "REQ-000304/A;1-Req2",
              "object_type": "Requirement Revision",
              "object_type_DISPLAY": "Requirement Revision",
              "UID": "gOPAAtTW7hAnmD"
            },
            "bomLine": {
              "_id": "TC*Fnd0RequirementBOMLine*null***BOM::61963",
              "object_string": "REQ-000304/A;1-Req2",
              "UID": "BOM::61963"
            }
          }
        ]
      }
    ],
    "original": {
      "lineObject": {
        "object_type": "RequirementSpec",
        "object_name": "SnapTestSpec",
        "object_desc": "Spec Desc"
      },
      "children": [
        {
          "lineObject": {
            "object_type": "Paragraph",
            "object_name": "P1",
            "object_desc": "P1 Desc",
            "[richContent]": "<p>Req1 Desc</p> <p><b>Some Content</b></p>"
          },
          "lineData": {
          },
          "children": [
            {
              "lineObject": {
                "object_type": "Requirement",
                "object_name": "Req1",
                "object_desc": "Req1 Desc"
              },
              "lineData": {
              }
            }
          ]
        },
        {
          "lineObject": {
            "object_type": "Paragraph",
            "object_name": "P2",
            "object_desc": "P2 Desc"
          },
          "lineData": {
          },
          "children": [
            {
              "lineObject": {
                "object_type": "Requirement",
                "object_name": "Req2",
                "object_desc": "Req2 Desc"
              },
              "lineData": {
              }
            }
          ]
        }
      ],
      "expandAttributes": [
        "object_name",
        "object_desc",
        "object_type",
        "object_string"
      ]
    }
  }
]