3.3.2.2.2.2. Additional Task: Move to Dynamic Folder

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

  1. Open PARTadmin and filter for "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 to write 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 will use options 1,4,8

    12 will use options 4,8.

    5 will use option 1 and 4.

    etc.

  3. Perform a new export.

    -> The Item will be moved to the configured folder.

3.3.2.2.2.2.1. Problem solving: Problem while storing document when using TC_HOOK_SERVICE.moveToNewFolder
  • Problem:

    Error message shows up trying to move document using TC_HOOK_SERVICE.moveToNewFolder.[59]

  • Reason: This is a Workflow problem. IfProeTeamcenter initially stores the Item in the folder given by the config key TC_TmpFolder, which by default is the current user's Newstuff folder. That is where the Item is currently located.

    The key TC_TargetFolder is applied (Item is moved) in EndCheckinTransaction, which is executed after Checkin1 (PdmOnCheckin_XX). In the case, with active MoveToNewFolder HookService in PdmOnCheckin_01, you try to move the part from TC_HOOKSERVICE_MOVETONEWFOLDER_SOURCE_FOLDER=Home/QA/GOHR/CREO to TC_HOOKSERVICE_MOVETONEWFOLDER_DESTINATION_FOLDER=Home/QA/3DFindIT. This can't work, as the Item is still in the TC_TmpFolder (in this case Newstuff).

    Normally MoveToNewFolder is not required as IfProeTeamcenter moves the files in EndCheckinTransaction.

  • Solution:

    However, if you want move the parts to a Folder not belonging to the current user or there is any other valid reason to not use the integrated move, you have to enter the TC_TmpFolder value in the key TC_HOOKSERVICE_MOVETONEWFOLDER_SOURCE_FOLDER and not to set TC_TargetFolder.