Tc Create And Update Multi

This Snap create multiple objects of any Teamcenter element of type item or derived types, such as document, part, design or ME Process. The Snap is processing the data input and can automatically call Teamcenter update for those attributes, which are not able to be processed with the create input definition in Teamcenter.

The Multi Snap allows to create multiple items from a single document and uses as few API calls as possible to improve overall performance.

Supported Accounts


Settings tab of snap to show example values.

Prerequisites

  • A valid Teamcenter account with the required permissions.

Snap views

Type Description Examples of upstream and downstream Snaps
Input

This Snap has exactly one document input view.

The required input of the snap is an array of objects including object type nad attributes for each object that needs to be created in Teamcenter.

Output

This Snap has exactly one document output view.

The output of the snap is a JSON array “result” including as much objects as should be created. Each JSON object includes two objects, one for the Item created and one for the Item Revision created.

Learn more about Error handling.

Examples

Tc Create And Update Multi: Simple create of five objects

Snap settings

Note: Learn about the common controls in the Snap settings dialog.
Field/Field set Description
Label

String
Specify a unique name for the Snap. Modify this to be more appropriate, especially if there are more than one of the same Snap in the pipeline.

Default value: Tc Create And Update Multi

Configure policy

Checkbox

Select this checkbox to run the Snap with a specific named Teamcenter policy. A policy determines the set of object properties that Teamcenter returns.

Learn more: Configure policy.

Default status: Deselected

Configure session context

Checkbox

Select this checkbox to run the Snap with a group, role, or project other than the one configured in the account.

Learn more: Configure session context.

Default status: Deselected

Objects Path

String/Expression

Specify the JSON array object containing objects to be created/updated in Teamcenter.

In JSON document the content for path can look like this:

[
  {
    "objects": [
        {
          "object_type": "Item",
          "object_name": "DocumentationTest0",
          "object_desc": "Test0"
        },
        {
          "object_type": "Item",
          "object_desc": "Test1",
          "object_name": "DocumentationTest1",
          "revision": {
            "object_desc": "Test1 revision"
          }
        }
      ]
  }
]

Default value: N/A

Example: $.objects

Map displayed to internal values

Checkbox/Expression

Allows to disable mapping of display to internal mapping. Disabling will improve performance. This is relevant for references or LOVs.

ON: Values given in input are displays and will be mapped to internal values for attribute.

OFF: No mapping of attribute values. Input document contains internal value for attribute itself.

Default value: Deselected

Example: Deselected

Handle localized properties

Checkbox/Expression

In case input document contains localized properties as an object turn this checkbox ON. Result objects will contain an JSON object "localizedProperties":{} with localized properties of created objects.

In case no localization properties are in content of input document leave checkbox OFF to avoid a loss of performance.

Input could look like this:

{
  "object_type": "Item",
  "object_desc": "Test1",
  "object_name": "Test1",
  "localizedProperties": {
     "xyz_localised_test": {
        "locales": {
           "en_US": {
              "master": true,
              "value": "Test1 eng",
              "status": "Master"
              },
           "de_DE": {
              "master": false,
              "value": "Test1 deu",
              "status": "Approved"
              }
           }
        }
     }
  }

Localization attribute has to exist in Teamcenter. Property “xyz_localised_test” is a customized attribute and will not ootb be in another Teamcenter.

Default value: Deselected

Example: Deselected

Try set multi localized properties call

Checkbox/Expression

OFF: Each properties is set by own API call.

ON: All properties are set by a single API call as a multi call.

Default value: Deselected

Example: Deselected

Always include log

Checkbox/Expression

OFF: No log information.

ON: Configure Setting to add log information to output next to resulting entitities list and original information. Log can contain this information:

"log": {
          "createAndUpdateMulti@Item": {
            "messages": [
              "Next step: getCreationInput",
              "Completed step: getCreationInput",
              "Next step: createAndRelate",
              "Completed step: createAndRelate",
              "Next step: getUpdateInfos",
              "Completed step: getUpdateInfos"
            ],
            "completed": [
              "getCreationInput",
              "createAndRelate",
              "getUpdateInfos"
            ]
          }
        }

Default value: Deselected

Example: Deselected

Configure error handling

Checkbox

Select this checkbox to define how the Snap behaves when Teamcenter returns an error. Use these settings for analysis and debugging.

Learn more: Configure error handling.

Default status: Deselected

Simplified expand

Checkbox

Select this checkbox to make the Snap look for the name given in Expand Attributes Path in the input document (for example, $expand) or in the Pipeline parameters (for example, _expand), and use that content. Expand Attributes Path then changes to a String field with the default value $.expand. In Pipeline parameters, separate the attribute names with commas.

When deselected, configure Expand Attributes Path as a string or an expression.

Default status: Deselected

Expand Attributes Path

String/Expression

Specify the JSON path to the expand attributes in the input document. Expand attributes are the list of attributes that the Teamcenter response must contain. Each name must be the technical name of a valid property in the Teamcenter data model for the expected objects. For example:

"expandAttributes": [
  "item_id",
  "item_revision_id",
  "last_mod_date",
  "object_string",
  "items_tag.uom_tag"
]

Learn more: Configuring Expand Attributes.

Default value: N/A

Example: $.expandAttributes

Build reference/lov documents

Dropdown list/Expression

Select how the Snap represents references and lists of values (LOVs) that Teamcenter returns. The Snap can return them as nested JSON objects instead of flattened IDs and internal values with additional _DISPLAY attributes:

  • References become {"_id": …, "UID": …, "_display": …} or null, including inside reference arrays.
  • LOVs become {"_value": …, "_display": …} or null, including inside LOV arrays.

The available options are:

  • Yes. The referenced object or LOV is a separate JSON object in the result. For example:
    "owning_user": {
      "_id": "TC*User*null***AgKAUUYTZLWoZA",
      "object_string": "user111 (user111)",
      "UID": "AgKAUUYTZLWoZA"
    }
  • No. The referenced object or LOV is flattened into attributes on the current result object, and synthetic attributes such as those ending in _DISPLAY are added. For example:
    "owning_user": "TC*User*null***AgKAUUYTZLWoZA",
    "owning_user_DISPLAY": "user111 (user111)"
  • Use Default. The Snap uses the default configured for the Snap Pack, which is Yes or No depending on the adapter.tc.snaplogic.expandReferencesAndLovs setting in the teamcenter_snappack.properties file.

Default value: Use Default

Example: Yes

Configure output

Checkbox

Select this checkbox to specify the Teamcenter properties that the Snap includes in the output.

This Snap offers the output settings described in Variant: type and reference related fields for suggestion.

Default status: Deselected

Snap execution

Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute. Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only. Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled. Disables the Snap and all Snaps that are downstream from it.