Import Message (Data Management)

License Level:BasicStandardAdvanced

Summary

Imports changes from a delta file into a replica geodatabase, or imports an acknowledgment message into a replica geodatabase.

Usage

Syntax

ImportMessage_management (in_geodatabase, source_delta_file, {output_acknowledgement_file}, {conflict_policy}, {conflict_definition}, {reconcile_with_parent_version})
ParameterExplanationData 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.

  • MANUALManually resolve conflicts in the versioning reconcile environment.
  • IN_FAVOR_OF_DATABASEConflicts automatically resolve in favor of the database receiving the changes.
  • IN_FAVOR_OF_IMPORTED_CHANGESConflicts automatically resolve in favor of the imported changes.
String
conflict_definition
(Optional)

Specifies how you would like to define conflicts:

  • BY_OBJECTDetects conflicts by row.
  • BY_ATTRIBUTEDetects conflicts by column.
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.

  • DO_NOT_RECONCILEDo not reconcile. This is the default.
  • RECONCILEReconcile.
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

Related Topics

Licensing Information

ArcGIS for Desktop Basic: No
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
11/18/2013