
TCIXpgPostProcess
=================

The TCIXpgPostProcess module implements the CAA User Exit for XPDM Transfer (see CAA Documentation: 
Integration -> External Integration -> xPDM -> Exchange Services -> Basic Scenarios -> Post-processing xPDM Transfer).
TCIXpgPostProcess implements several use cases.

1.  Set Version
    After importing a structure via XPG to 3DEXPERIENCE V6 this user exit scans the imported structure and sends the versions 
    of the 3DEXPERIENCE objects back to TCI using a http request.

2.  Check Import
    After importing a structure via XPG to 3DEXPERIENCE V6 this user exit scans the imported structure, checks the types of 
    the created objects and sends the 3DEXPERIENCE identification set (Type, Name, Revision, Minorversion) of each object back to TCI. 

3.  Additional V6 Data
    Use this function to handle TC structures which hold some Items that where imported from V6. XPDM cannot build in these Items
    into the new (updated) V6 structure. This post process adds the V6 items to the imported structure.     

4.  Repair Instance
    In some cases XPG import does not replace an instance of a child object with the current version of the child (relation
    points to the wrong child) This function reroutes the relation to the correct child.
    It is only possible to use this function if "Check Import" is also activated 
    (TCIXpgPostProcess_CHECKIMPORT=ON and (TCIXpgPostProcess_REPAIRINSTANCE=ON or TCIXpgPostProcess_FORCERELATIONCHECK=ON)).
	To do the relation check/repair only for specific relations it is possible to mark the ProductInst with the following Property: 
    <ProductInst ...>  
      ...   
      <Property name="XCI_INSTANCE_CHILD_CHANGED" type="string">
         <Value>True</Value>
      </Property>
    </ProductInst>   	
	
   
5.  Set Maturity of Rep Children
    Applicative data in V5 CATProducts like Mechanism causes XPDM to create additional elements which are linked via VPLMrel/VPMRepInstance
    to the parent product. These elements always use their default maturity state. With this functionality it is possible to 
    set the maturity of these objects to a state that corresponds to the state of the parent Product.
    It is possible to exclude "Product" objects from inspection by setting the following property to the Product:
    <Product ...>  
      ...   
      <Property name="TCI_NOAPPDATA" type="string">
         <Value>True</Value>
      </Property>
    </Product>     
    It is also possible to exclude objects of special types from changing their Maturity state.
    If the additional elements use different policies with different state names than the parent Product, you need a mapping 
    between policy/state of the Base Product and the additional elements (target). The mapping has to be defined in TCIXpgConfig.xml.
    
5a. Set Maturity of additional Rep at 3DPart
    Appicative data in V5 CATParts causes  XPDM to create additional elements which are linked via VPLMrel/VPMRepInstance
    to the parent product. These elements always use their default maturity state. With this functionality it is possible to 
    set the maturity of these objects to a state that corresponds to the state of the parent Product.
    It is possible to exclude "Product" objects from inspection by setting the following property to the Product:
    <Product productType = "3DPart" ...>  
      ...   
      <Property name="TCI_NOAPPDATA" type="string">
         <Value>True</Value>
      </Property>
    </Product>     
    The maturity mappings and the exclusion types are used from 5.

6.  Set Maturity of Rep
    If the Teamcenter state is changed from FROZEN to RELEASED the modification date of the dataset itself is not modified. Therefore 
    the XPDM importer does not observe the needed change of the maturity. With this functionality it is possible to update the maturity 
    of a representation. 
 
7.  Create Expand Filter (only 3DX2017x and later)
    It is possible to send a filtered structure to 3DEXPERIENCE and and store the current expand state in a Filter (PLMWspPVS).
    To create or update an exsisting filter the Info TCIStructureName has to be set in the InfoHeader section of metadata.xml:
     <InfoHeader>
         ...
         <Info name="TCIStructureName"  value="..."/>
     </InfoHeader>
     <ProductStructure rootRefs="ID_0" updateChildMode="IgnoreExistingNotProvided">
        ...
    To make sure the filter gets a unique name the tool uses the value of TCIStructureName and Name and Revision of the top level Product.
    The name of the created / updated filter follows the following convention:
    <Name>_<Revision>_<TCIStructureName>
    If the Info TCIStructureName is not set, no Filter will be created / updated.
    
8.  Write extra properties for PostProcessXPDMExport.
    If TCIXpgPostProcess_EXPORT_PROPERTIES is set to ON 
    VPLMtyp, MajorRevision, and MinorRevision Properties are added to References and RepReferences in the XPDM Metadata file.
   
9.  Add configured material to 3DParts which don't have a material yet.
    If TCIXpgPostProcess_MATERIAL is set to ON and TCIXpgPostProcess_MATERIAL_TYPE and 
    TCIXpgPostProcess_MATERIAL_NAME are set to an existing 3DEXPERIENCE Core Material type and name,
    the material is added if needed.
   
10. Integration Cobot Batch
    If 3DExperience LA Package "Integration Cobot (Delivery Command)" is installed, it is possible to start the "PLMCobotIntegrationBatch" 
    asynchronous at the end of the post process. The Products to be handled can be directly specified in the metadata.xml file or 
    configured by some attributes of the Product.
	
11. Add missing instances.
    If working in CATProduct mode and also importing XCADs like JTs into the structure, XPDM does not create the relation between the parent 
    Product and the Product representing the XCAD (because the V5 CATProduct does not point to the XCAD). To create / update the relation 
	set the following Property to the related ProductInst tags in the metadata.xml file: 
		<ProductInst ...>
			<Property type="string" name="XCI_CHECKADDRELATION">
				<Value>TRUE</Value>
			</Property> 
			...
		</ProductInst>
	To handle all ProductInst relations activate the setting TCIXpgPostProcess_FORCEADDINSTANCES=ON in the TCIXpgConfig.xml file.
	To disable the functionality (even if the Property "CheckAddRelation" is set for some ProductInst tags), activate the setting
	TCIXpgPostProcess_ADDMISSINGINSTANCES=OFF to the TCIXpgConfig.xml file.

12. Check relation (no repair)
    If re-importing a structure with a missing ProductInst relation in 3DX, there are some cases where the relation is still missing after
    a second import. If a missing relation is detected, the XPDM import will fail. The check result for the ProductInst holds the 
    attribute "checkInstance" and in case of failue some warning text.
 
    <XPDMElement id = "..." UniqueID = "..." xpdmType = "ProductInst" xpdmMapped = "FALSE" checkInstance = "SUCCESS" V6ObjectTypeState = "Ok"/>

    <XPDMElement id = "..." UniqueID = "..." xpdmType = "ProductInst" xpdmMapped = "FALSE" checkInstance = "FAILED" V6ObjectTypeState = "NotOk">
        <Warning>Some warning text</Warning>
    </XPDMElement>	
	
	To enable this check activate the setting TCIXpgPostProcess_CHECKRELATIONWITHOUTREPAIR=ON. It is only possible to use this function if 
	"Check Import" is also activated (TCIXpgPostProcess_CHECKIMPORT=ON)
   
Installation:
=============

- The package has to be installed on every XPGClientService host.

- Prerequisites:
 
   To use the TCIXpgPostProcess functionality the following 3DEXPERIENCE libraries have to be copied to each XPGClientService host
   (only used if "Repair Instance", "Set Maturity of Rep Children", "Set Maturity of Rep" or "Add configured material" is configured,
    or if "Synchronize bookmark structure" is used in TSI3DXBatch):

   eMatrixServletRMI.jar
   (you can find this file on the 3DEXPERIENCE server host: <3DEXPERIENCE installation Dir>\server\win_b64\docs\java)



- Installation 
   
   Run XCI_3DX_BATCH_R<XXX>_<XXX>\install\windows_64\setup.exe and follow the instructions

- Post Installation
   (only needed if an MQL command is used, )
   
   - copy the file eMatrixServletRMI.jar to ...\XCI_3DX_BATCH_R<XXXX>_V<XXX>\win_b64\fromServer\docs\java
   
   - In some cases the following files in ...\XCI_3DX_BATCH_R<XXXX>_V<XXX>\win_b64\fromServer\code\bin\ may have to be replaced with 
     updated files from your 3DX Server installation after installation of a 3DX Fix Pack
     (you can check the installation with CheckServerConnection.bat):  
     mxUtil.dll, vgalaxy7k.dll
     (you can find these files on the 3DEXPERIENCE server host: <3DEXPERIENCE installation Dir>\studio\win_b64\code\bin)
      eMatrixMqlU.dll
     (you can find these files on the 3DEXPERIENCE server host: <3DEXPERIENCE installation Dir>\adk\win_b64\code\bin) 
  

Configuration:
==============

Create encrypted password (only used if "Repair Instance" or "Set Maturity of Rep Children" is configured ):
  The TCIXpgPostprocessing needs a direct (MQL) login to the 3DEXPERIENCE server. To use the post-processing it is necessary 
  to store the login information in the environment. As it is not allowed to store a plain password, TCIXpgPostprocess
  uses an encrypted password.
  Use the script "EncryptPassword.bat" to encypt the 3DEXPERIENCE password. If you use the 3DEXPERIENCE environment file 
  <Your Path>\TCI_3DX_XPP_<3DX-version>_<XCI-version>\config\TCI_3DX_XPP_Env.txt (created during the installation of this module)
  you can just double click the batch file. If you use a different environment file you drag and drop your environment file on the 
  script "EncryptPassword.bat", or use a command window: 
  C:\<Your Path>\TCI_3DX_XPP_<3DX-version>_<XCI-version>\config\EncryptPassword.bat <path>\<your env-file.txt>
  
  You have to encrypt the password using the same Windows OS user that runs the XPDM import/export (XPGClientBatch service, 
  or TSI3DXBatch). The encrypted password can be used on different hosts, as long as the import uses the same Windows user.
  
  You will be asked for the password to encrypt:
                
            Encrypt 3DEXPERIENCE password
            type password:
  
  After typing in your password the encryption is executed:
            starting encryption ...

            Encrypting password: ***************************************************
            Encrypted  password: <26e5d4eencrpted331846533ppassworddcbe21975ssample>

            Insert encrypted password in TCIXpgConfig.xml

            Press any key to continue . . .

TCIXpgPostprocessing comes with the configuration file "<tool install base>\win_b64\reffiles\TCIXpgConfig.xml". 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TCIXpgConfig>

    <!-- ********************************************************************************* -->
    <!-- *** General settings                                                          *** -->
    <!-- ********************************************************************************* -->

    <!-- *** Debug settings: normal debug: ON, profiling debug ONT *********************** -->
    <!-- <Attribute name="TCIXpgPostProcess_DEBUG" value="ON" /> -->

    <!-- *** sort the output when using TCIXpgPostProcess_DEBUG=ONT ********************** -->
    <!-- *** default: tnr=TimeNochildReverse ********************************************* -->
    <!-- <Attribute name="TCIXpgPostProcess_PERFORMANCE_SORT" value="tnr" /> -->    


    <!-- ********************************************************************************* -->
    <!-- *** The following settings are used uring XPDM import                         *** -->
    <!-- *** If you only use these functions no additional 3DEXPERIENCE libraries have *** -->
    <!-- *** to be copied to this installation                                         *** -->
    <!-- ********************************************************************************* -->

    <!-- *** Enable check import ********************************************************* -->
    <Attribute name="TCIXpgPostProcess_CHECKIMPORT" value="ON"/>

    <!-- *** XCI Server url needed for CHECKIMPORT *************************************** -->
    <Attribute name="TCIXpgPostProcess_SERVERURL" value="https://xci-erver.com:8080/XCI"/>

    <!-- *** Max retry count to send the result for CHECKIMPORT to the server ************ -->
    <!-- *** default value "3"                                                         *** -->
    <!-- <Attribute name="TCIXpgPostProcess_SERVER_RESPONSE_MAXRETRYCOUNT" value="3"/> -->

    <!-- *** Timeout (sec) to retry to send restult for CHECKIMPORT to the server ******** -->
    <!-- *** after each retry the timeout will be doubled (maximum 3600 sec)           *** -->
    <!-- <Attribute name="TCIXpgPostProcess_SERVER_RESPONSE_RETRYTIMEOUT" value="30"/> -->    

    <!-- *** Ignore response from server for CHECKIMPORT ********************************* -->
    <!-- <Attribute name="TCIXpgPostProcess_IGNORE_SERVER_RESPONSE" value="ON" /> -->  
	
    <!-- *** Add instances not added by XPDM ********************************************* -->
	<!-- *** If you work in Product mode, and you also import XCADs like jt into the   *** -->
	<!-- *** structure XPDM does not create the relation in V6. By default, the        *** -->
	<!-- *** relations to be checked should be marked in the metadata.xml file:        *** -->
	<!-- ***  <ProductInst ... >                                                       *** -->
	<!-- ***      <Property type="string" name="XCI_CHECKADDRELATION">                 *** -->
	<!-- ***          <Value>TRUE</Value>                                              *** -->
	<!-- ***      </Property>                                                          *** -->
	<!-- ***	  ...                                                                  *** -->
	<!-- ***  </ProductInst>                                                           *** -->
	<!-- *** To handle all relations (time consuming) you can use                      *** --> 
	<!-- <Attribute name="TCIXpgPostProcess_FORCEADDINSTANCES" value="ON" /> -->

    <!-- *** Disable to add relations marked with "XCI_CHECKADDRELATION", this setting *** -->
	<!-- *** also overrules "TCIXpgPostProcess_FORCEADDINSTANCES"                      *** -->
	<!-- <Attribute name="TCIXpgPostProcess_ADDMISSINGINSTANCES" value="OFF" />-->

    <!-- *** Add additional Instances in the Postprocessing ****************************** -->
    <!-- <Attribute name="TCIXpgPostProcess_ADDITIONALINSTANCEDATA" value="ON" /> -->

    <!-- *** Enable Merge Effectivities ************************************************** -->  
    <!-- <Attribute name="TCIXpgPostProcess_MERGEEFFECTIVITY" value="ON" /> -->

    <!-- *** To set effectivities only load the required objects in EditMode  ************ -->
    <!-- *** (default: ON)If disabled load the complete sub assemblies in EditMode ******* -->
    <!-- <Attribute name="TCIXpgPostProcess_SETEFFECTIVITY_USECONFIGOPENER" value="OFF"/> -->
    
    <!-- *** In some cases this post process modifies some objects. ********************** -->
    <!-- *** If set TCIXpgPostProcess_SAVE_BAG_ONLY=ON (default) do not use a general  *** -->
    <!-- *** save of all modified objects, but only of the objects opened in this      *** -->
    <!-- *** PostProcess.                                                              *** -->
    <!-- *** To use general save you can use TCIXpgPostProcess_SAVE_BAG_ONLY=OFF       *** -->
    <!-- *** In general the tool should save the same objects.                         *** -->
    <!-- *** Note: The general save causes a crash in some configurations.             *** -->
    <!-- <Attribute name="TCIXpgPostProcess_SAVE_BAG_ONLY" value="OFF" /> -->

    <!-- *** Disable creation of Filter (PLMWspPVS) ************************************** -->
    <!-- <Attribute name="TCIXpgPostProcess_CREATEFILTER" value="OFF" /> -->
    
    <!-- *** Add a defined material to 3DPart if the 3DPart has no material applied yet ** -->
    <!-- <Attribute name="TCIXpgPostProcess_MATERIAL" value="ON"/> -->

    <!-- *** Type for Material, if not set use "CATMatReference" ************************* -->
    <!-- <Attribute name="TCIXpgPostProcess_MATERIAL_TYPE" value="dsc_matref_ref_Core"/> -->

    <!-- *** Change the following Attributes if there are time out problems when ********* -->
    <!-- *** connecting the server ******************************************************* -->
    <!-- <Attribute name="TCIXpgPostProcess_SERVER_RESOLVE_TIMEOUT" value="0" /> -->
    <!-- <Attribute name="TCIXpgPostProcess_SERVER_CONNECT_TIMEOUT" value="60" /> -->
    <!-- <Attribute name="TCIXpgPostProcess_SERVER_SEND_TIMEOUT" value="30" /> -->
    <!-- <Attribute name="TCIXpgPostProcess_SERVER_RECEIVE_TIMEOUT" value="300" /> -->


    <!-- ********************************************************************************* -->
    <!-- *** The following settings are using extra MQL during XPDM import. If you use *** -->
    <!-- *** one of these functions, the additional 3DEXPERIENCE server libraries      *** -->
    <!-- *** have to be copied to this installation.                                   *** -->
    <!-- *** In this case also the connection settings to the 3DEXPERIENCE server      *** -->
    <!-- *** has to be configured                                                      *** -->
    <!-- ********************************************************************************* -->
    
    <!-- *** Extra check for relations *************************************************** -->
    <!-- *** not needed when using CATProducts ******************************************* -->
    <!-- <Attribute name="TCIXpgPostProcess_FORCERELATIONCHECK" value="ON" /> -->    

    <!-- *** Enable Repair Instance functionality **************************************** -->
    <!-- <Attribute name="TCIXpgPostProcess_REPAIRINSTANCE" value="ON"/> -->
	
	<!-- *** Extra check for relations *************************************************** -->
	<!-- *** Use MQL to check relations. XPDM Import will fail with Code 929 if a      *** -->
    <!-- *** ProductInst is not found or points to a wrong child                       *** -->
    <!-- <Attribute name="TCIXpgPostProcess_CHECKRELATIONWITHOUTREPAIR" value="ON" /> -->		
    
    <!-- *** Enable "Set Maturity of Rep Children" *************************************** -->
    <!-- *** If the rep children use different policies with different stats, you have *** -->
    <!-- *** to define a mapping table from the base to the target. If the state names *** -->
    <!-- *** are identical, no mapping table is required ********************************* -->
    <!--    <Attribute name="TCIXpgPostProcess_SETMATURITYOFAPPCHILD" value="ON">
                <BasePolicy name="VPM_SMB">
                    <TargetPolicy name="X1_VPM_SMB">
                        <StateMapping base="RELEASED" target="PUBLIC"/>
                        <StateMapping base="IN_WORK" target="PRIVATE"/>
                        <StateMapping base="PRIVATE" target="PRIVATE"/>
                    </TargetPolicy> 
                    <TargetPolicy name="X2_VPM_SMB">
                        <StateMapping base="RELEASED" target="RELEASED"/>
                        <StateMapping base="IN_WORK" target="IN_WORK"/>
                        <StateMapping base="PRIVATE" target="IN_WORK"/>
                    </TargetPolicy> 
                </BasePolicy>
                <BasePolicy name="VPM_SMB_ABC">
                    <TargetPolicy name="Y1_VPM_SMB">
                        <StateMapping base="RELEASED" target="PUBLIC"/>
                        <StateMapping base="IN_WORK" target="PRIVATE"/>
                        <StateMapping base="PRIVATE" target="PRIVATE"/>
                    </TargetPolicy> 
                    <TargetPolicy name="Y2_VPM_SMB">
                        <StateMapping base="RELEASED" target="RELEASED"/>
                        <StateMapping base="IN_WORK" target="IN_WORK"/>
                        <StateMapping base="PRIVATE" target="IN_WORK"/>
                    </TargetPolicy> 
                </BasePolicy>    

                <ExcludedTypeForMaturityMapping>Drawing</ExcludedTypeForMaturityMapping>
                <ExcludedTypeForMaturityMapping>PLMtype/Drawing</ExcludedTypeForMaturityMapping>
            </Attribute> 
    -->

    <!-- *** Enable "Set Maturity of additional Rep at 3DPart" *************************** -->
    <!-- *** The maturity mappings and the ExcludedTypeForMaturityMapping settings     *** -->
    <!-- *** are used from TCIXpgPostProcess_SETMATURITYOFAPPCHILD. ********************** -->
    <!-- <Attribute name="TCIXpgPostProcess_SETMATURITYOFREPAT3DPART" value="ON" /> -->

    <!-- *** Enable "Set Maturity of representation to state in metadata.xml" ************ -->
    <!-- *** "OFF"  ... Default                                                        *** -->
    <!-- *** "ON"   ... Use Property "TCI_UPD_MATURITY" to identify the handeled       *** -->
    <!-- ***            Representations                                                *** -->
    <!-- *** "FORCE"... Handle all representations *************************************** -->
    <!-- <Attribute name="TCIXpgPostProcess_SETMATURITYOFREP" value="ON"/> -->

    <!-- *** Integration Cobot *********************************************************** -->
    <!-- *** only available if environment DeliveryCobot=1 is set                      *** -->
    <!-- *** By default (value = "ON") the cobot integration is controlled by the      *** -->
    <!-- *** Property name = "TCI_RUN_COBOT", Value = TRUE at each relevant Product in *** -->
    <!-- *** the metadata.xml file.                                                    *** --> 
    <!-- *** To disable cobot set value of TCIXpgPostProcess_RunCobot to "OFF"         *** -->
    <!-- *** To run cobot for all Product nodes with specific attributes use "FORCE"   *** -->
    <!-- *** In case of "FORCE": To restrict the handled Products it is possible to    *** -->
    <!-- ***    set one or more ProductAttribute tags with the name and value of       *** -->
    <!-- ***    a Product attribute like "mappingType". In case of multiple            *** -->
    <!-- ***    ProductAttribute tags, all attributes need to match                    *** -->
    <!-- ***    It is also possible to specify if the select Product has children      *** -->
    <!-- ***    (is "Owned") in the metadata.xml file:                                 *** -->
    <!-- ***    set attribute "hasChildren" = "true" or "false" at                     *** -->
    <!-- ***    TCIXpgPostProcess_RunCobot (ignore if not set or empty).               *** -->
    <!-- ***    It is possible to exclude Products from cobot by setting the           *** -->
    <!-- ***    Property name = "TCI_RUN_COBOT", Value = FALSE at each relevant        *** -->
    <!-- ***    Product in the metadata.xml file, that fits to the "FORCE" ciriteria.  *** -->
    <!-- <Attribute name="TCIXpgPostProcess_RunCobot" value="FORCE" hasChildren= "true">
             <ProductAttribute name="mappingType" value ="F_DesignSolution Revision" />
         </Attribute> 
    -->

    <!-- ********************************************************************************* -->
    <!-- *** Connection settings to the 3DEXPERIENCE server                            *** -->
    <!-- *** ==============================================                            *** -->
    <!-- *** Use CheckServerConnection.bat to check your installation                  *** -->
    <!-- ********************************************************************************* -->

    <!-- *** 3DEXPERIENCE server url ***************************************************** -->
    <!-- <Attribute name="TCIXpgPostProcess_ENOVIASERVERURL" 
                    value="https://3DExpericeServer.com/3dspace"/> -->

    <!-- *** 3DEXPERIENCE user *********************************************************** -->
    <!-- <Attribute name="TCIXpgPostProcess_ENOVIAUSER" value="admin_platform"/> -->

    <!-- *** 3DEXPERIENCE vault (optional) *********************************************** -->
    <!-- *** If not set use default vault ************************************************ -->
    <!-- <Attribute name="TCIXpgPostProcess_ENOVIAVAULT" value="<vault>" /> -->    

    <!-- *** Encrypted 3DEXPERIENCE password ********************************************* -->
    <!-- *** use TCIMQLTest utility to encrypt password ********************************** -->
    <!-- <Attribute name="TCIXpgPostProcess_ENCRYPTEDENOVIAPASSWORD" 
                    value="[Encrypted password from TCIMQLTest]"/> -->

    <!-- *** If 3DPassport is installed the following setting has to be enabled ********** -->
    <!-- *** In this case some java options can be used ********************************** -->
    <!-- <Attribute name="TCIXpgPostProcess_USE3DPASSPORT" value="ON">
        <JavaOption>-Xnoclassgc</JavaOption>
        <JavaOption>-Xms256m</JavaOption> 
    </Attribute> -->


    <!-- ********************************************************************************* -->
    <!-- *** The following setting is used uring XPDM export                           *** -->
    <!-- *** If you only use these functions no additional 3DEXPERIENCE libraries have *** -->
    <!-- *** to be copied to this installation                                         *** -->
    <!-- ********************************************************************************* -->
    
    <!-- *** Add extra custom properties after XPDMExport ******************************** -->
    <Attribute name="TCIXpgPostProcess_EXPORT_PROPERTIES" value="ON"/>    

</TCIXpgConfig>



Add the following settings  as Attributes to the process in TCIXpgConfig.xml.
Alternatively it is possible to add the settings to the created environment file 
(environment settings override the Attributes in TCIXpgConfig.xml).

- Enable Postprocessing (required for V5R2013x):
  XPG_ACTIVATE_POSTPROCESSING=1

- Enable set Version in TCI (not needed if TCIXpgPostProcess_CHECKIMPORT=ON is used):
  TCIXpgPostProcess_SETVERSION=ON

- Enable check import:
  TCIXpgPostProcess_CHECKIMPORT=ON
  
- Max retry count to send the result for CHECKIMPORT to the XCI server (optional)
  default value "3"
  TCIXpgPostProcess_SERVER_RESPONSE_RETRYTIMEOUT=3

- Timeout (sec) to retry to send restult for CHECKIMPORT to the XCI server (optional)
  after each retry the timeout will be doubled (maximum 3600 sec)
  TCIXpgPostProcess_SERVER_RESPONSE_RETRYTIMEOUT=30  
  
- Ignore response from server for CHECKIMPORT (optional, not recommended)
  Enable this setting to end a job successful even if the XCI server does not respond correctly to the Check 
  Import request.
  TCIXpgPostProcess_IGNORE_SERVER_RESPONSE=ON  
  (Suppressing failures by setting TCIXpgPostProcess_IGNORE_SERVER_RESPONSE=ON can cause inconsistancys in the XCI database)  
  
- Enable handling of additional V6 data instantiated in Teamcenter
  TCIXpgPostProcess_ADDITIONALINSTANCEDATA=ON

- Disable force relation check by expand (optional)
  If working with CATProducts the relations are not mapped for the xPDM context. To check the relation in 3DEXPERIENCE
  the post process expands the parent Product and checks if the relation fits to the relation that was send via xPDM. 
  TCIXpgPostProcess_FORCERELATIONCHECK=OFF

- Disable the creation of filter (optiuonal)
  TCIXpgPostProcess_CREATEFILTER=OFF
  
- Server Url (without Servlet name) where the Servlet TCIRequest is installed (required):
  TCIXpgPostProcess_SERVERURL=<Server URL>

  You can use a web browser to test the <Server Url>: 
  <Server URL>/TCIRequest 

- Repair Instance 
  Enable this setting to activate the Repair Instance functionality. TCIXpgPostProcess_CHECKIMPORT=ON has also to be 
  configured (prerequisite) 
  TCIXpgPostProcess_REPAIRINSTANCE=ON

- Check Instance
  Enable this setting to activate the Check Instance functionality. TCIXpgPostProcess_CHECKIMPORT=ON has also to be 
  configured (prerequisite). 
  TCIXpgPostProcess_CHECKRELATIONWITHOUTREPAIR=ON

- Enable "Set Maturity of Rep Children". 
  TCIXpgPostProcess_SETMATURITYOFAPPCHILD=[ON|FORCE]
  Set to FORCE to ignore result of preprocessing.
  If the Rep Children uses a different Policy (with different State names) you have to enable 
  the functionality in TCIXpgConfig.xml.
  Add BasPolicy elements as direct child nodes of TCIXpgPostProcess_SETMATURITYOFAPPCHILD using the following structure:

  <Attribute name="TCIXpgPostProcess_SETMATURITYOFAPPCHILD" value="ON">
     <BasePolicy name="<Policy Name>">                                   <!-- Policy of the Product (List)   -->
        <TargetPolicy name = "<Policy Name>">                            <!-- Policy of the Rep Child (List) -->
           <StateMapping  base = "<Prod Mat>" target = "<Rep Mat>" />    <!-- Mapping (List)                 -->
                                                                         <!-- base   ... Product Maturity    -->
                                                                         <!-- target ... Rep Child Maturity  -->
                                                                         <!--            to be set           -->
       </TargetPolicy> 
    </BasePolicy>
    <ExcludedTypeForMaturityMapping>Drawing</ExcludedTypeForMaturityMapping> <!-- Type of Rep Child to exclude -->
                                                                             <!-- from setting maturity (list) -->
  </Attribute>
  
  If you do not have the configuration file TCIXpgConfig.xml, it is possible to use four comma separated, concurrent  
  lists for the mappings instead:
  TCIXpgPostProcess_BASEPOLICYLIST=VPM_SMB,VPM_SMB
  TCIXpgPostProcess_TARGETPOLICYLIST=VPM_SMB_XX,VPM_SMB_YY
  TCIXpgPostProcess_BASEMATURITYLIST=RELEASED,RELEASED
  TCIXpgPostProcess_TARGETMATURITYLIST=PUBLIC,RELEASED
  TCIXpgPostProcess_MATURITYMAPPINGEXCLUTIONLIST=Drawing,PLMtype/Drawing
  
  The lists are using the following elements:
  BASEPOLICY                ... Policy of the Product
  TARGETPOLICY              ... Policy of the Rep Child
  BASEMATURITY              ... Maturity state of the Product
  TARGETMATURITY            ... Maturity state of the Rep Child (this state will be set to the Rep Child if BASEPOLICY, 
                                TARGETPOLICY and BASEMATURITY are fitting to the structure)
  MATURITYMAPPINGEXCLUTION  ... Type of Rep Child to exclude from setting the maturity
  
- Enable "Set Maturity of additional Rep at 3DPart"
  TCIXpgPostProcess_SETMATURITYOFREPAT3DPART=[ON|FORCE]
  Set to FORCE to ignore result of preprocessing.
  The maturity mappings and the ExcludedTypeForMaturityMapping settings are used from TCIXpgPostProcess_SETMATURITYOFAPPCHILD.
  
- Enable "Set Maturity of Rep"
  TCIXpgPostProcess_SETMATURITYOFREP=[ON|FORCE]
  Set to "ON" to use the settings in metadata.xml at the representations
  (Rep3DAggr, Drawing, DrawingAggr and Rep3D):
  <Property name="TCI_UPD_MATURITY" type="string">
        
     <Value>FALSE</Value>

  </Property>
  to update the maturity to the "Maturity" in metadata.xml.

  Set to "FORCE" to update the maturity of all representations 
  (Rep3DAggr, Drawing, DrawingAggr and Rep3D) to the "Maturity" in metadata.xml.

- Server url of 3DEXPERIENCE server (http://<3DEXPERIENCE server>[:port]/3DEXPERIENCE) 
  (only used if TCIXpgPostProcess_REPAIRINSTANCE=ON)
  TCIXpgPostProcess_ENOVIASERVERURL=<3DEXPERIENCE Server URL>

- 3DEXPERIENCE user name (only used if TCIXpgPostProcess_REPAIRINSTANCE=ON). 
  This 3DEXPERIENCE user has to be 3DEXPERIENCE business and system administrator. You should use the same 3DEXPERIENCE user that 
  is used for the XPDM import.
  TCIXpgPostProcess_ENOVIAUSER=<3DEXPERIENCE user name>

- Encrypted 3DEXPERIENCE password (only used if TCIXpgPostProcess_REPAIRINSTANCE=ON)
  TCIXpgPostProcess_ENCRYPTEDENOVIAPASSWORD=<encrypted password>

- 3DEXPERIENCE Vault (optional) (only used if TCIXpgPostProcess_REPAIRINSTANCE=ON)
  TCIXpgPostProcess_ENOVIAVAULT=<3DEXPERIENCE Vault>  

- If 3DPassport is used to check the 3DEXPERIENCE credentials TCIXpgPostProcess_USE3DPASSPORT has to be activated:
  TCIXpgPostProcess_USE3DPASSPORT=ON
  
- Enable "Add configured material"  
  TCIXpgPostProcess_MATERIAL=ON
  TCIXpgPostProcess_MATERIAL_NAME=<Core Material Name>
  optional: 
  TCIXpgPostProcess_MATERIAL_TYPE=<Core Material Type> 
  if not set use base type for material "CATMatReference"
   
  To avoid the check for material for some 3DParts the Property XCI_MATERIAL_CHECKED 
  has to be added to the Product in metadata.xml:
     <Product mappingType="<mappingType>" id="<id>" productType="3DPart">
       <ID>...</ID>
       ...
       <Property name="XCI_MATERIAL_CHECKED" type="string">
	     <Value>TRUE</Value>
       </Property>
     </Product>  
  
  If TCIXpgPostProcess_CHECKIMPORT is also configured the check will return the attribute materialChecked="TRUE"
  for all checked 3DParts which already had a material attached or were the configured material was attached successfully:
     <XPDMElement id = "<id>" UniqueID = "<UniqueID>" xpdmType = "Product" xpdmMapped = "TRUE" materialChecked = "TRUE" V6ObjectTypeState = "Ok"/>
  
  
- Enable Cobot Integration
  TCIXpgPostProcess_RunCobot=ON (default, use Property TCI_RUN_COBOT in <Product> in metadata.xml)
                            =OFF (disable Cobot Integration)
                            =FORCE (run Cobot Integration for all <Product> nodes in metadata.xml. To restrict
                                    the selection you have to use the configuration file TCIXpgConfig.xml.)
  
  
- Debug setting (optional default: not set (OFF)):
  TCIXpgPostProcess_DEBUG=ON  (Debug output)
                          ONT (Performance Trace)

- Server Resolve Timeout [seconds] (optional default: 0 (infinite)):
  TCIXpgPostProcess_SERVER_RESOLVE_TIMEOUT=<timeout>
- Server Connect Timeout [seconds] (optional default: 60)
  TCIXpgPostProcess_SERVER_CONNECT_TIMEOUT=<timeout>
- Server Send Timeout [seconds] (optional default:30)
  TCIXpgPostProcess_SERVER_SEND_TIMEOUT=<timeout>
- Server Receive Timeout [seconds] (optional default: 300)
  TCIXpgPostProcess_SERVER_RECEIVE_TIMEOUT=<timeout>

- Add extra custom properties after XPDMExport (optional default: not set (OFF)):
  TCIXpgPostProcess_EXPORT_PROPERTIES=ON
 
- Use ConfigOpener to avoid loading of unnecessary data when setting Effectivities. (optional default: not set (ON)):
  TCIXpgPostProcess_SETEFFECTIVITY_USECONFIGOPENER=OFF  
  
  
Test Installation:
==================
Use the script CheckServerConnection.bat to test your installation (only used if "Repair Instance" or "Set Maturity of Rep Children" is configured ):

  If you use the 3DEXPERIENCE environment file <Your Path>\TCI_3DX_XPP_<3DX-version>_<XCI-version>\config\TCI_3DX_XPP_Env.txt 
  (created during the installation of this module) you can just double click the batch file. If you use a different environment 
  file you drag and drop your environment file on the script "EncryptPassword.bat", or use a command window: 
  C:\<Your Path>\TCI_3DX_XPP_<3DX-version>_<XCI-version>\config\EncryptPassword.bat <path>\<your env-file.txt>

  You will get a warning if a needed library could not be loaded, or if one of the following settings  is missing in the TCIXpgConfig.xml
  - TCIXpgPostProcess_ENOVIASERVERURL
  - TCIXpgPostProcess_ENOVIAUSER
  - TCIXpgPostProcess_ENCRYPTEDENOVIAPASSWORD
  
  If you get the message  "login: Cannot get instance of matrix/db/Context" 
  Please check the following settings:
  - wrong setting TCIXpgPostProcess_ENOVIASERVERURL
  - wrong TCIXpgPostProcess_ENOVIAUSER / TCIXpgPostProcess_ENCRYPTEDENOVIAPASSWORD combination
  - wrong / missing certificate (in case of https)
  - wrong setting TCIXpgPostProcess_USE3DPASSPORT
  
  
  This command also warns if the 3DEXPERIENCE user does not have the 3DEXPERIENCE privileges "system administrator" 
  and "business administrator". These 3DEXPERIENCE privileges are required to repair an instance and 
  set the maturity of an imported object to a specified state: 

       TCIMQL Library build:   Mar 31 2016 16:18:16
       3DEXPERIENCE server version:  3DEXPERIENCE R2015x HotFix 5
       !!! User MigratUsr does not have required ENOVIA business privileges !!!
       !!! User MigratUsr does not have required ENOVIA system privileges !!!
       
       
    
Error Messages:
===============
If there are some errors that can be reproduced, please always  
- set TCIXpgPostProcess_DEBUG = ON
- check log file TCIXpgPostProcess.Log

General Error Import or Export:

999 ... Multiple errors detected:
        - <ErrNo> <ErrMsg>, <ErrNo> <ErrMsg>, ...
        See single errors in list below.


The following errors can occur in the Post Process during XPDM Import:

920 ... Failed to get mapping service 3DExperience (internal error)
        - XPDM XML PostProcessing : GetCATIAdpPLMIdentificators Failed
        - XPDM XML PostProcessing : m_pMappingServices = NULL

921 ... Failed to get mapped objects from 3DExperience (internal error)
        - XPDM XML PostProcessing : GetListOfExternalIDsFromXPDMXML Failed

924 ... TCIXpgPostProcess_SETVERSION = ON ((internal error))
        - XPDM XML PostProcessing : AddVersionAttributes Failed
        
925 ... Cannot connect to TCI Adapter
        Troubleshooting:
        - Make sure XCI Server is running
        - check setting of TCIXpgPostProcess_SERVERURL in config file:
          <tool install base>\win_b64\reffiles\TCIXpgConfig.xml
          
926 ... Failed to set reponse at XCI Server:
        - Cannot get state of Response
        - Set Version ended with error in TCI Adapter
        Troubleshooting:
        - also see log file of XCI server
        
928 ... Failed to Check Created Objects (internal error) 
        - TCIXpgPostProcess_CHECKIMPORT: CheckCreatedObjects failed
        
929 ... Failed to Check Created Objects partional failed (internal error)
        - See TCIXpgPostProcess.Log

930 ... Failed to set Additional instance data (internal error)
        - AdditionalInstanceData Failed
        
931 ... Failed to handle effectivities (internal error)
         - Merge Effectivities failed
        - Set Effectivities failed       
		
933 ... Failed handle additional instances
        - MissingInstanceRepair Failed 
        
935 ... Failed to set maturity of App Child
        - SetMaturityOfAppChild Failed
        Troubleshooting:
        - see additional error message
        - use CheckServerConnection.bat to check if the tool can use MQL to 
          connect to 3DExperience          
          
936 ... Set maturity of Rep failed
        - SetMaturityOfRep Failed
        Troubleshooting:
        - see additional error message
        - use CheckServerConnection.bat to check if the tool can use MQL to 
          connect to 3DExperience
        - check policy mapping of TCIXpgPostProcess_SETMATURITYOFAPPCHILD in
          <tool install base>\win_b64\reffiles\TCIXpgConfig.xml
        
937 ... Failed to create Filter
        - Create Filter Failed
        Troubleshooting:
        - see additional error message        

938 ... Check material Failed
        Troubleshooting:
        - see additional error message    
        
939 ... Failed to launch Cobot Integration
        - CobotIntegration Failed
        Troubleshooting:
        - see additional error message        

>1000... Error from XCI Server
        Troubleshooting:
        - see additional error message
        - see log file of XCI server
        
The following errors can occur in the Post Process during XPDM Export:

932 ... Post Process for Export failed (internal error)
        - PostProcessXPDMExport : GetCATIAdpPLMIdentificators Failed 
        - PostProcessXPDMExport : m_pMappingServices = NULL
        - PostProcessXPDMExport : Cannot write metadata.xml
        