powered by CADENAS

Manual

Manual

3.3.10.5. Teamcenter additional functions (teamcenter_public_api.vbb)

General Info

The Teamcenter Public API can be used in order to perform certain actions on a Teamcenter Server (query, manipulate data).

In the following the most important methods (configurable via configuration file .cfg) are described. All other information is available under %CADENAS_SETUP%\scripts\plm\autoexec\teamcenter_public_api.vbb.

The described methods can be used for example when Teamcenter custom code has to be written at the customer.

Among others the following functions are available (directly controlled via configuration file):

  • MoveToNewFolder: Add Teamcenter Item to a folder / move it in a folder

  • ChangeOwnership: Change user of a Teamcenter Item

  • SetReleaseStatus: Set release status of a Teamcenter Item

  • CreateProcessInstance: Start a workflow in Teamcenter and assign it to a Teamcenter Item

  • GetXRevisionId: If active, hereby always the latest revision can be loaded – independent of the revision deposited in PLMTable2/cfg

  • CreateAndRelateItem: Create a Teamcenter Item (additional – is only for administration/grouping - e.g. MasterItem) and add the item(s) just created by the export to it.

    Furthermore it is possible to use the following in the[ReturnMapping]section of the respective interface:

    ERPTABLE.<COLUMNNAME>=?"'%Master_Item_Id%'"

    The part before the '=' states table and column as usual and the part behind the placeholder to be used for this function. Thereby the ItemId (which possibly will not be created till the generation in Teamcenter) can be saved in the PLINKDB. If the part is exported for another CAD-PDM combination later, here the value for ItemId can be read and the new Item is added to the same MasterItem then.

Precondition for the usage of additional functions

In the configuration files of the Teamcenter PDM interfaces (ifnxteamcenter.cfg, ifproeteamcenter.cfg, ifseteamcenter.cfg, ifinvteamcenter.cfg) there is a section named [PDM], where the following keys are available:

  • PdmOnCheckin (additional functions for newly checked in items) (standard)

    PdmOnCheckin=_START_CHAINCALL(_ACTIVE_IF_MODULE.checkin1(para.item(0)) , 1 , 1)
    .chainCall(_TC_HOOK_SERVICE.completeHookService(para.item(0)) , 1, 0).finish()

    OR

    PdmOnEndCheckinTransaction (additional functions for all items of the exports)

    PdmOnEndCheckinTransaction=_START_CHAINCALL(_ACTIVE_IF_MODULE.endCheckinTransaction
    (para.item(0)) , 1 , 1).chainCall(_TC_HOOK_SERVICE.completeHookServiceList
    (para.item(0)) , 1, 0).finish()

    [Note] Note

    One of these keys has to be set, in order to be able to use the additional functions described in the following.

  • PdmOnBeginCheckoutTransaction

    [Note] Note

    This key has to be set, if the key (the additional function) GetXRevisionId is used.

    PdmOnBeginCheckoutTransaction=_START_CHAINCALL(_TC_HOOK_SERVICE.getXRevisionIdList
    (para.item(0)) , 0, 0).chainCall(_ACTIVE_IF_MODULE.beginCheckoutTransaction
    (para.item(0)) , 1 , 1).finish()

Notes

2-Tier Teamcenter Server without WebTier: A IIOP connection has to be used. Thereto possibly a special script of the 2-Tier RichClients has to be copied/adjusted, in order to start the service on a certain port.

Whether the configuration keys, described below, are optional or not, you can see in the documentation, in the file teamcenter_public_api.vbb. There further technical descriptions of the individual functions are found and in addition further methods which are not mentioned here.

Keys of the additional functions in detail

[Note] Note

The following keys have to be set in the section [CreationOptions].

  • Teamcenter Login (keys which are required for all other additional functions)

    • User:

      Caution: Only one value per key supported here (no categories) ! Caution: This user must have the right to access the objects owned by the user logged in to TC in NX.

      TC_HookService_Login_USER= <<here the User Name to be used for the Teamcenter Login
      has to be deposited>>

    • Password:

      Caution: Only one value per key supported here (no categories) !

      TC_HookService_Login_PASS= <<here the Password to be used for the Teamcenter Login
      has to be deposited>>

    • Host:

      Caution: Only one value per key supported here (no categories) !

      TC_HookService_Login_HOST= <<here the Host to be used for the Teamcenter Login
      has to be deposited – 2Tier -> IIOP | 4Tier -> HTTP>>

  • MoveToNewFolder

    • The folder that will be used for moveToNewFolder (-> if this is empty moveToNewFolder will only bind the item to the folder given by TC_DESTINATION_FOLDER).

      Otherwise this must be the Teamcenter folder the item to move is stored in -> MoveToNewFolder will remove the item from this folder before binding it to <TC_HookService_MoveToNewFolder_DESTINATION_FOLDER>. E.g. "Home/Folder0"

      TC_HookService_MoveToNewFolder_SOURCE_FOLDER=

    • The folder that will be used for moveToNewFolder as destination folder. MoveToNewFolder binds the item to this folder. E.g. "Home/Folder1"

      TC_HookService_MoveToNewFolder_DESTINATION_FOLDER(is3dPart)= 

    • The parameter <Bitfield> for moveToNewFolder. For details see moveToNewFolder method description.

      TC_HookService_MoveToNewFolder_Flags=

    • The user that will be used for moveToNewFolder (-> user is owner of the source folder). E.g. "infodba"

      TC_HookService_MoveToNewFolder_SourceFolder_User=

    • The user that will be used for moveToNewFolder (-> user is owner of the destination folder). E.g. "infodba"

      TC_HookService_MoveToNewFolder_DestinationFolder_User=

    • If moveToNewFolder has to create a new folder the description will be set to this value. Default is: "Folder created by CADENAS".

      TC_HookService_MoveToNewFolder_CREATE_FOLDER_DESCRIPTION=

  • ChangeOwnership

    • The user that will be used for changeOwnership (-> user will be the new owner of the item). E.g. "infodba"

      TC_HookService_ChangeOwnership_User=

    • TC_HookService_ChangeOwnership_Group will be used together with TC_HookService_ChangeOwnership_User for changeOwnership.

      (analog to TC_HookService_ChangeOwnership_User). E.g. "Engineering"

      TC_HookService_ChangeOwnership_Group=

    • The parameter <Bitfield> for ChangeOwner. For details see ChangeOwner method description.

      TC_HookService_ChangeOwnership_Flags=

  • SetReleaseStatus

    • The parameter <newReleaseType> for setReleaseStatus. For details see setReleaseStatus method description.

      Commented out -> setReleaseStatus will not work. "" as value is supported.

      Different values for different items of one export possible.

      TC_HookService_setReleaseStatus_newReleaseType=

    • The parameter <operation> for setReleaseStatus. For details see setReleaseStatus method description.

      Different values for different items of one export possible.

      TC_HookService_setReleaseStatus_operation=

    • The parameter <oldReleaseType> for setReleaseStatus. For details see setReleaseStatus method description.

      Different values for different items of one export possible.

      TC_HookService_setReleaseStatus_oldReleaseType=

    • The parameter <Bitfield> for setReleaseStatus. For details see setReleaseStatus method description.

      TC_HookService_setReleaseStatus_Flags=

  • CreateProcessInstance

    • The parameter <startImmediately> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_startImmediately=

    • The parameter <observerKey> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_observerKey=

    • The parameter <name> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_name=

    • The parameter <subject> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_subject=

    • The parameter <processTemplate> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Mandatory.

      TC_HookService_createProcessInstance_processTemplate=

    • The parameter <description> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_description=

    • The parameter <processOwner> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_processOwner=

    • The parameter <deadline> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_deadline=

    • The parameter <container> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_container=

    • The parameter <relationType> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_relationType=

    • The parameter <processAssignmentList> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_processAssignmentList=

    • The parameter <dependencyTask> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_dependencyTask=

    • The parameter <remoteParent> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_remoteParent=

    • The parameter <remoteParentAppGuid> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_remoteParentAppGuid=

    • The parameter <remoteParentURL> for createProcessInstance. For details see createProcessInstance method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createProcessInstance_remoteParentURL=

    • The parameter <Bitfield> for createProcessInstance. For details see createProcessInstance method description.

      TC_HookService_createProcessInstance_Flags=

  • GetXRevisionId

    • Defines which RevisionID is put into PLMTable2 by getXRevisionId. Values: {"first","latest")(default is "latest"}

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_getXRevisionId_TargetRevision=

  • CreateAndRelateItem

    ### Item creation ###

    • Controls if the method is executed by the CompleteHookService-methods. Values: {"1","0")(default is "0"}

      Different values for different items of one export possible. Mandatory.

      TC_HookService_createItem_EXECUTE=

    • The itemId of the item (MasterItem) to create. Default is "" (get Id from Teamcenter). For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_itemId=

    • The revisionId of the item (MasterItem) to create. Default is "" (get Id from Teamcenter). For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_revisionId=

    • The itemtype of the item (MasterItem) to create. Default is "Item". For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_type=

    • The name for the item (MasterItem) to create. Default is "". For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_name=

    • The description for the item (MasterItem) to create. Default is "". For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_description=

    • The clientId for the createItem call. Default is "". For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_clientId= 

    • The UOM for the createItem call. Default is "". For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_UOM=

    #### Link MasterItem to folder ####

    • The parent folder for the new item. Default is "". For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_parentFolderPath=

    • The owner of the parent folder. Default is "" (use logged in user). For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_parentFolderOwner= 

    • The description for the parent folder (if it has to be created). Default is "". For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_parentFolderDesc=

    ### Link <it> to the (new) MasterItem ###

    • This key controls if and how the item this method is called for gets linked to the (new) MasterItem. No Default.

      For details see createAndRelateItem method description.

      Different values for different items of one export possible. Not mandatory.

      TC_HookService_createItem_childRelation=