Summary
Imports changes from a delta file into a replica geodatabase, or imports an acknowledgment message into a replica geodatabase.
Usage
This tool is used when synchronizing replica while disconnected. This is done by first running the Export Data Change Message tool which creates a delta file with changes to synchronize. The delta file is then copied to the relative replica and imported using the Import Message tool. If a delta file gets lost and you want to resend, you can use the Re-Export Unacknowledged Messages tool to regenerate the delta file. After the changes are imported, the relative replica can export an acknowledgment file using the Export Acknowledgement Message tool. The acknowledgment file is copied to the replica and imported using the Import Message tool. If an acknowledgment is not received, the next time changes are sent they will include the new changes plus the previously sent changes.
The geodatabase can be a local geodatabase or a geodata service.
Accepts either acknowledgment messages or data change messages. Acknowledgment files are XML (.xml). Data change messages can be delta file geodabase (.gdb), delta personal geodatabase (.mdb) or delta XML files (.xml).
After importing a data change message, you have the option to immediately export an acknowledgment message. The output acknowledgment file must be XML.
To synchronize replicas in a connected mode see the Synchronize Changes tool.
Syntax
arcpy.management.ImportMessage(in_geodatabase, source_delta_file, {output_acknowledgement_file}, {conflict_policy}, {conflict_definition}, {reconcile_with_parent_version})
Parameter | Explanation | Data Type |
in_geodatabase | Specifies the replica geodatabase to receive the imported message. The geodatabase may be local or remote. | Workspace ; GeoDataServer |
source_delta_file | Specifies the file from which the message will be imported. | Workspace ; File |
output_acknowledgement_file (Optional) | When importing data changes, this allows you to optionally export a message to acknowledge the import of a data change message. This option is ignored for anything other than a data change message. | File |
conflict_policy (Optional) | Specifies how conflicts are resolved when they are encountered while importing a data change message.
| String |
conflict_definition (Optional) | Specifies how you would like to define conflicts:
| String |
reconcile_with_parent_version (Optional) | Indicates whether to automatically reconcile once data changes are sent to the parent replica if there are no conflicts present. This option is only available for check-out/check-in replicas.
| Boolean |
Code sample
ImportMesage Example (Python Window)
The following example demonstrates how to use the ImportMessage funcion in a Python window.
import arcpy
from arcpy import env
env.workspace = "C:/Data"
arcpy.ImportMessage_management("MySDEdata.sde", "DataChanges.gdb", "acknowledgement.xml", "IN_FAVOR_OF_IMPORTED_CHANGES", "BY_OBJECT")
ImportMesage Example 2 (stand-alone Python script)
The following demonstrates how to use the ImportMessage function to import a data changes file in a stand-alone Python script.
# Name: ImportMessage_Example2.py
# Description: Imports a data change message (from a delta gdb) into a replica workspace.
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "C:/Data"
# Set local variables
replica_workspace = "MySDEdata.sde"
in_message = "DataChanges.gdb" # data changes file (delta gdb)
output_acknowledgement = "acknowledgement.xml" # optional
conflict_policy = "IN_FAVOR_OF_IMPORTED_CHANGES"
conflict_detection = "BY_OBJECT"
reconcile = "" # Only applicable for checkout replicas
# Execute Import Message
arcpy.ImportMessage_management(replica_workspace, in_message, output_acknowledgement, conflict_policy, conflict_detection, reconcile)
ImportMesage Example 3 (stand-alone Python script)
The following demonstrates how to use the ImportMessage function to import a data changes file in a stand-alone Python script.
# Name: ImportMessage_Example3.py
# Description: Imports an acknowledgement message into a replica workspace.
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "C:/Data"
# Set local variables
replica_workspace = "MySDEdata.sde"
in_message = "acknowledgement.xml" # Acknowledgement file
output_acknowledgement = "" # not applicable when importing an acknowledgement file
conflict_policy = "" # not applicable when importing an acknowledgement file
conflict_detection = "" # not applicable when importing an acknowledgement file
reconcile = "" # not applicable when importing an acknowledgement file
# Execute Import Message
arcpy.ImportMessage_management(replica_workspace, dc_Message, output_acknowledgement, conflict_policy, conflict_detection, reconcile)
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes