I am trying to schedule the automation of a Data Reviewer batch job that I can run from a standalone script using task scheduler. My goal is to run a batch job nightly. When I run my script in the interactive python window in ArcMap everything works fine. However when I try to run the same script in IDLE I get this error:
Traceback (most recent call last):
File "M:\GisData\Depts\StormH2O\Python\Data_Reviewer_Compare_Geometry.py", line 29, in <module>
arcpy.CreateReviewerSession_Reviewer(reviewer_gdb, Session_Name, None, None, 'STORE_GEOMETRY', 'Python_Editor', None)
AttributeError: 'module' object has no attribute 'CreateReviewerSession_Reviewer'
Is it possible to run Data Reviewer outside of ArcMap?
import arcpy
import datetime
i = datetime.datetime.now()
arcpy.CheckOutExtension("datareviewer")
reviewer_gdb = "M:\GisData\Depts\StormH2O\Data_Reviewer\Data_Reviewer.gdb"
Session_Name = ("%s.%s.%s" % (i.year, i.month, i.day))
arcpy.CreateReviewerSession_Reviewer(reviewer_gdb, Session_Name, None, None, 'STORE_GEOMETRY', 'Python_Editor', None)
Session_ID = ""
Path_To_Table = "M:\GisData\Depts\StormH2O\Data_Reviewer\Data_Reviewer.gdb\GDB_REVSESSIONTABLE"
CURSOR = arcpy.SearchCursor(Path_To_Table, ['SESSIONID', 'SESSIONNAME'])
for row in CURSOR:
Session_ID = row.getValue("SESSIONID")
rev_workspace = "M:\GisData\Depts\StormH2O\Data_Reviewer\Data_Reviewer.gdb"
batch_job_file = "M:\GisData\Depts\StormH2O\Data_Reviewer\Contains_both_ways.rbj"
session = "Session %d : %s"%(Session_ID,Session_Name)
prod_workspace = "M:\GisData\Depts\StormH2O\Python\Detect_Change\Comparison_Workspace\Comparison_Workspace.gdb"
arcpy.ExecuteReviewerBatchJob_Reviewer(rev_workspace, session, batch_job_file, prod_workspace, None, None, None)
arcpy.CheckInExtension("datareviewer")