I am trying to insert records from an FGDB featureclass into an "ArcFM-ified" SDE(Oracle 11g) feature class with a stand alone python script. I want the AutoUpdaters on that feature class to fire. I have downloaded and looked at the examples on Schneider's exchange site. I have also seen the few other questions on here like Objects in this class cannot be updated outside an edit session inside ArcFM?
According to what I have read I need to checkout an ArcFM license, set the
mmAutoUpdaterMode = mmAutoUpdaterMode.mmAUMStandAlone
and when I run the script the auto updaters should fire.
I run my script, the records are successfully inserted into the feature class, but no AutoUpdaters are fired.
Why are they not firing?
I am using
arcpy.InsertCursor because I could not get
arcpy.da.InsertCursor to work and it was suggested in this post on Schneider's exchange site.
Here is my code:
import arcpy import os from arcgisscripting import create from win32com.client import Dispatch gp = create(10.1) app = Dispatch('Miner.Framework.Dispatch.MMAppInitializeDispatch') au = Dispatch('Miner.Framework.Dispatch.MMAutoupdaterDispatch') runtime = Dispatch('Miner.Framework.Dispatch.MMRuntimeEnvironmentDispatch') from enumerations import mmRuntimeMode,mmLicensedProductCode,mmAutoUpdaterMode runtime.RuntimeMode = mmRuntimeMode.mmRuntimeModeArcServer app.Initialize(mmLicensedProductCode.mmLPArcFM) au.AutoUpdaterMode = mmAutoUpdaterMode.mmAUMStandAlone sde_conn = r"C:\Users\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\GDB.sde" target_fc = os.path.join(sde_conn, 'Schema.FeatureDataset', 'FeatureClass') source_fc = r'C:\FGDB.gdb\FeatureClass' feature_list =  fields = [ 'RECORDID', 'SHAPE@', 'SUBTYPECD', ] def populateList(): with arcpy.da.SearchCursor(source_fc, fields) as scur: for row in scur: feature_list.append(row) def sampleArcFM(): # code for geoprocessing goes here editor = arcpy.da.Editor(sde_conn) editor.startEditing(False, True) editor.startOperation() icur = arcpy.InsertCursor(target_fc) for rec in gen_list: row = icur.newRow() rec_id = rec shape = rec subtype = rec row.setValue("RECORDID", rec_id) row.setValue("SUBTYPECD", subtype) row.shape = shape.firstPoint icur.insertRow(row) editor.stopOperation() editor.stopEditing(True) del icur app.Shutdown del app, runtime, au populateList() sampleArcFM()