Résumé
Finds changes made to individual feature classes or an entire geodatabase between specified dates or between different versions based on a precreated preference. The changes that can be found include feature inserts, updates, and deletes.
Discussion
The ChangeReporter function allows you to find changes made to individual feature classes or an entire geodatabase between specified dates or between different versions. The changes reported are additions, modifications, and deletions made in feature classes, tables, and data-driven elements that impact one or more charts. Once found, these changes are automatically committed to the Reviewer table for further examination. The feature classes and tables to be analyzed by the ChangeReporter function are stored in preferences.
Syntaxe
ChangeReporter (product_library, rev_workspace, rev_session, production_database, preference_name, compare_method, compare_parent_from, compare_child_to)
Paramètre | Explication | Type de données |
product_library | The path to a connection file or the database used as the product library workspace. | String |
rev_workspace | The ArcGIS Data Reviewer for Desktop extension reviewer workspace to which results are written. | String |
rev_session | The identifier for a Reviewer session. The session must exist in the Reviewer Workspace. | String |
production_database | Path to the workspace containing the data used for production tasks or is referenced by maps and charts. | String |
preference_name | Preference name as defined in the production database. | String |
compare_method | Specify the type of comparison method that will be used.
| String |
compare_parent_from | Compare parent information: If the compare method is VERSION, the value will be a string with the parent version name. If compare method is DATE, it will be a datetime object containing the from date. | Variant |
compare_child_to | Compare child information: If the compare method is VERSION, the value will be a string with the child version name. If compare method is DATE, it will be a datetime object containing the to date. | Variant |
Exemple de code
ChangeReporter example
For version compare, run the ChangeReporter tool to get changes in your database between versions.
# Name: ChangeReporter_ex1.py
# Description: Runs the ChangeReporter tool to get changes in your database between versions or dates
# Author: Esri
# Import arcpyproduction and aviation modules
import arcpy
import arcpyproduction
from arcpyproduction import aviation
from arcpyproduction.aviation import charting
# Check out Aviation license
arcpy.CheckOutExtension("Aeronautical")
# Set variables
product_library = "c:/data/PL.sde"
rev_workspace = "c:/data/reviwer_gdb.sde"
rev_session = 1
production_database = "c:/data/PD.sde"
preference_name = "TerminalProcedure"
compare_method = "VERSION"
compare_parent_from = "Default"
compare_child_to = "AIRAC1604"
# Get changes
charting.ChangeReporter(product_library, rev_workspace, rev_session, production_database, preference_name, compare_method, compare_parent_from, compare_child_to)
# Check in Aviation license
arcpy.CheckInExtension("Aeronautical")
ChangeReporter example 2
For date compare, run the ChangeReporter tool to get changes in your database between dates.
# Name: ChangeReporter_ex2.py
# Description: Runs the ChangeReporter tool to get changes in your database between versions or dates
# Author: Esri
# Import arcpyproduction and aviation modules
import arcpy
import arcpyproduction
from arcpyproduction import aviation
from arcpyproduction.aviation import charting
# Check out Aviation license
arcpy.CheckOutExtension("Aeronautical")
# Set variables
product_library = "c:/data/PL.sde"
rev_workspace = "c:/data/reviwer_gdb.sde"
rev_session = 1
production_database = "c:/data/PD.sde"
preference_name = "TerminalProcedure"
compare_method = "DATE"
compare_parent_from = datetime.datetime(2016,03,07,1,30)
compare_child_to = datetime.datetime(2016,04,07,1,30)
# Get changes
charting.ChangeReporter(product_library, rev_workspace, rev_session, production_database, preference_name, compare_method, compare_parent_from, compare_child_to)
# Check in Aviation license
arcpy.CheckInExtension("Aeronautical")