Skip to main content
Question

Filter feature classes by editor tracking field

  • July 10, 2019
  • 2 replies
  • 31 views

Hi all,

 

Context: I have a workbench that is aggregating and compiling data from 13 different SDEs. The datasets are managed slightly different source-by-source. I determine adds, updates and deletes via a CRC comparison, but there are feature classes (not all, some) that are participating in editor tracking. There are two different possibilities for the pertinent editor tracking field: MODIFY_DATE and last_edited_date. Sometimes, both of these fields exist in a feature class, with one being associated to esri's editor tracking.

 

Objective: I want to use the arcpy method, describe, to pull the editor tracking field name. Based on that result, I want to filter features on 1) if they have editor tracking enabled, then 2) between MODIFY_DATE and last_edited_date.

 

Method: I have a private parameter python (named editorTracking) script as follows:

import fme
import fmeobjects
import arcpy

def processFeature(feature):
    desc = arcpy.Describe(feature.getAttribute(pathway))
    if desc.editorTrackingEnabled:
        if desc.editedAtFieldName == "MODIFY_DATE":
            return "1"
        elif desc.editedAtFieldName == "last_edited_date":
            return "2"    

 

Variable 'pathway' is assigned earlier in the workbench. It's the absolute path to the feature class, required for the Describe method. I have a test filter that is set with two outputs: 1) if editorTracking (private parameter python script) = 1 2) if editorTracking = 2

 

I am not getting any type of filtering through this method. I do not know if the test filter and a private parameter python script operate together in this manner. Does anyone have some feedback on my methodology here?

 

Thanks.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

daveatsafe
Safer
Forum|alt.badge.img+20
  • Safer
  • July 16, 2019

Hi @cwchumley,

You have a typo in the second line, which will disable fmeobjects.


  • Author
  • July 17, 2019

Hi @cwchumley,

You have a typo in the second line, which will disable fmeobjects.

Hey Dave,

 

Thanks for the heads up. I manually wrote the code in (couldn't get the formatting to work out when copy/pasting) and that typo was only here. I'll edit my original post. Thanks for pointing that out!