Export and Import Tracking
You can track the progress of entities and data being imported and exported in ThingWorx.
Task Progress Status
A cache is used to track the progress of the submitted tasks. A task can have the following statuses:
Status
Description
REGISTERED
Task is submitted in the cache to track progress.
IN PROGRESS
Task is currently in progress.
SUCCESSFUL
Task is completed without any exception.
PARTIAL SUCCESSFUL
Task is completed, but some sub-tasks encountered error/exception and did not complete.
FAILURE
Task did not complete because of error/exception and is aborted.
UNREGISTERED
This task not found in the cache and not tracked for progress status.
Enabling Export/Import Task Progress Tracking
This feature can be enabled by adding the trackTaskProgress=true parameter in the service call. The Export (Import/Export > To File) and Import (Import/Export > From File) actions will not turn on tracking of related tasks.
Enable Entity Export Task Progress
The following is an example call to enable export task tracking progress status:
http://localhost:8080/Thingworx/Exporter?repositoryName=SystemRepository&path=/&trackTaskProgress=true
Add Accept=application/octet-stream in the header.
A taskID is sent in the response in reply to this GET request. The following is a sample response:
“Entities Export submitted for processing. Please check the log for completion status of Task-1493913609284.”
Where the taskID is 1493913609284. You must retrieve this taskID from this response and use it to track the completion status of the task.
Enable Entity Import Task Progress
The following is an example call to enable import task tracking progress status:
http://localhost:8080/Thingworx/Importer?repositoryName=SystemRepository&path=/&trackTaskProgress=true&exportFileName=AllEntities.twx
A taskID is sent in the response in reply to this GET request. The following is a sample response:
“Entities Import submitted for processing. Please check the log for completion status of Task-1493913609285.”
Where taskID is 1493913609285. You must retrieve this taskID from this response and use it to track the completion status of the task.
Use Tracking to Obtain Task Completion Status
The taskID sent in the response of the export/import GET request can be used to track the progress of that task. taskCacheKey=taskID is a required parameter in the service call in order to track the completion status of that particular task.
Track Export Progress Task
The following is an example of tracking to obtain the completion status of an already submitted task:
http://localhost:8080/Thingworx/Exporter/cache/?taskCacheKey=1493913609284
Based on the status of the task in the cache, a response is sent to you. The response includes one of the task progress status mentioned above. As the user, you can track periodically based on the returned task status and eventually get the status of the registered task.
Track Import Progress Task
The following is an example of tracking to get the completion status of an already submitted task:
http://localhost:8080/Thingworx/Importer?taskCacheKey=1493913609285
Based on the status of the task in the cache, a response is sent to you. The response includes one of the task progress status mentioned above. You can track periodically based on the returned task status and eventually get the status of the registered task.
Was this helpful?