4.3.3.2.2.2. Additional Task: Move to Dynamic Folder

If you want to use dynamically created folders, you'll need the "TC_HookService_MoveToNewFolder".

  1. Open PARTadmin and filter by "MoveToNewFolder".

  2. Enable the "Additional Task" and set the desired values for "TC_HookService_MoveToNewFolder_DESTINATION_FOLDER" and "TC_HookService_MoveToNewFolder_Flags".

    ifnxteamcenter.cfg

    [CreationOptions] 
    PdmOnCheckin_04.EXECUTE=_TC_HOOK_SERVICE.moveToNewFolder 
    TC_HookService_MoveToNewFolder_DESTINATION_FOLDER=?"Home/DaBe/"+_Format_0
    ("<PREFIXLIST(/)>").value() + "/" + _FORMAT_0("<ATTR(NN)>").value() 
    TC_HookService_MoveToNewFolder_Flags=13 

    TC_HookService_MoveToNewFolder_Flags is specified as <bitfield>. 13 = 1+4+8

    #:HELP; The parameter <Bitfield> for moveToNewFolder: 
    #       1: create not existing folders? 
    #       2: use Item owner as source folder user? 
    #          (TC_HookService_MoveToNewFolder_SourceFol  der_User will be ignored) 
    #       4: use Item owner as destination folder user? 
    #          (TC_HookService_MoveToNewFolder_DestinationFolder_User will be ignored) 
    #       8: get sorce folder(s) from Item? 
    #          (TC_HookService_MoveToNewFolder_SOURCE_FOLDER will be ignored) 

    Examples:

    13 uses options 1, 4, and 8.

    12 uses options 4 and 8.

    5 uses options 1 and 4.

    etc.

  3. Perform a new export.

    -> The item is moved to the configured folder.

4.3.3.2.2.2.1. Troubleshooting: Problem saving the document when using TC_HOOK_SERVICE.moveToNewFolder
  • Problem:

    When attempting to move a document using TC_HOOK_SERVICE.moveToNewFolder, an error message appears.[62]

  • Cause: It is a Workflow issue. IfProeTeamcenter saves the item initially in the folder specified in the configuration key TC_TmpFolder; by default is the Newstuff folder of the current user. There is the item at that time.

    The TC_TargetFolder key is applied in EndCheckinTransaction (the item is moved), specifically after Checkin1 (PdmOnCheckin_XX). In this case, with the MoveToNewFolder hook service active, an attempt is made in PdmOnCheckin_01 to move the part from TC_HOOKSERVICE_MOVETONEWFOLDER_SOURCE_FOLDER=Home/QA/GOHR/CREO to TC_HOOKSERVICE_MOVETONEWFOLDER_DESTINATION_FOLDER=Home/QA/3Dfindit. This cannot work because the item is still located in the TC_TmpFolder (in this case, Newstuff).

    Usually, MoveToNewFolder is not required because IfProeTeamcenter the files to EndCheckinTransaction.

  • Solution:

    However, if you want to move the parts to a folder that does not belong to the current user, or if there is another valid reason not to use the built-in move function, enter the value of TC_TmpFolder in the key TC_HOOKSERVICE_MOVETONEWFOLDER_SOURCE_FOLDER and do not set TC_TargetFolder.