Available Import Options to Control Import Behavior

FlexNet Code Insight 2019 R3

The following options can be included with the importProjectData API to override the default import behavior (described in the previous section, Default File and Inventory Processing During an Import) as needed. See Importing Project Data Using the REST API for complete details about setting up the command for executing the import process.

If these options are not set, the default values apply.

checkInventory (default: false)

This option specifies whether file MD5 should be used as criteria (in instead of file path) when associating files to inventory in the target project during the import process. By default, this option is disabled, so that only files that match based on file path between the data file to be imported and the target project codebase are associated with inventory in the target project. For example, the file “/ePortal-1.3/src/gettext.c” listed in the data file as belonging to inventory “Item 1” will be considered for association to this inventory item in the target project only if the scanned target project codebase contains the file “/ePortal-1.3/src/gettext.c” with the same file path. However, if the file or the directory containing the file has been renamed in the target project codebase, but the file contents have not changed, you can use the file MD5 as criteria for associating files to inventory instead of using the file path.

With this option enabled, only files that match based on MD5 in the data file and the target project codebase will be associated with inventory in the target project. To change the default setting and thus enable the use of MD5 checks when associating files with inventory in the target project, include the checkInventory=true option as shown:

curl -X POST --data-binary "@PROJECT_DATA_FILE.zip" "HOST:PORT/codeinsight/api/importer/importProjectData?projectId=PROJECT_ID&checkInventory=true"

checkReviewed (default: true)

This option specifies whether file MD5 should be used as criteria (instead of file path) when marking files as reviewed in the target project during the import process. By default, this option is enabled, so that only files that match based on MD5 between the data file to be imported and the target project codebase, are marked as reviewed in the target project. For example, the file “/ePortal-1.3/src/gettext.c”, marked as the “reviewed” in the data file, will be considered for marking as reviewed in the target project only if the scanned target project codebase contains the file “/ePortal-1.3/src/gettext.c” with the same file path and MD5.

However, with this option disabled, files need to have only a matching file path between the data file and the scanned target codebase in order to be processed as reviewed in the target project. To change the default setting and thus disable the use of MD5 checks when marking files as reviewed, include the checkReviewed=false option as shown:

curl -X POST --data-binary "@PROJECT_DATA_FILE.zip" "HOST:PORT/codeinsight/api/importer/importProjectData?projectId=PROJECT_ID&checkReviewed=false"

createEmptyInventory (default: false)

This option determines whether “empty” inventory items are still processed in the target project during the import. Empty inventory items either have no file associations in the data file to be imported or do have associated files in the data file but no matching file paths for these files in the scanned target codebase.

By default, this option is disabled, preventing empty inventory items from being created in the target project. However, with this option enabled, all inventory items—with or without matching associated files in the target codebase—are created during the import. To change the default setting and thus enable the creation of empty inventory during the import, include the createEmptyInventory=true option as shown:

curl -X POST --data-binary "@PROJECT_DATA_FILE.zip" "HOST:PORT/codeinsight/api/importer/importProjectData?projectId=PROJECT_ID&createEmptyInventory=true"