Skip to main content
Solved

Trigger Python Script upon GIS Feature Class Update

  • January 3, 2025
  • 1 reply
  • 46 views

hawaiialex
Contributor
Forum|alt.badge.img+2

Hi everyone,

I’ve created a python script that has the docx library and arcpy library imported in it that takes field values from a GIS feature class and writes it to a docx document successfully. I would like to trigger the python script to run every time that feature class in an enterprise geodatabase is updated.

I am working in the 11.3 Enterprise Environment and have come across this support page regarding implementing webhooks and FME

https://support.safe.com/hc/en-us/articles/25407414850061-Integrating-ArcGIS-Enterprise-Feature-Service-Webhooks-With-FME

I will attempt to do the above, but I have a simple question regarding the FME workspace itself.

I have read up on the PythonCreator and PythonCaller transformers, with the PythonCreator not requiring an inpput. If all I want is an update to the GIS feature class to trigger the python script to run, would the FME workspace just have a PythonCreator with the python script in it and a logger? Or would it be more beneficial to have a Creator connected to a PythonCaller transformer then a logger? Is there any best practices to use one over the other if all I want to do is run the python script upon the update trigger?

Thank you in advance!

Best answer by donalmateer

Hi ​@hawaiialex, thanks for the question!
I hope I can give you information for a more informed decision.

PythonCreator:

  • Ideal for generating features or performing tasks that don't depend on existing data within the workspace.
  • Simplifies workflows that don't need input data.
  • Reduces complexity by eliminating unnecessary transformers.

Although - Limited flexibility if future requirements involve processing existing features.

Creator + PythonCaller:

  • Suitable for scenarios where the Python script needs to process or manipulate incoming features.
  • Offers greater flexibility for processing existing features.
  • Easier to integrate with other transformers and data streams.

Although - Slightly more complex setup due to the need for an initial feature generation.

 

Given that your goal is to execute a Python script upon an update trigger to a GIS feature class, consider the following:

  • If the Python script operates independently of existing features: Utilize the PythonCreator. This approach simplifies the workspace by removing unnecessary components.

  • If the Python script needs to process or modify existing features: Implement the Creator + PythonCaller combination. This setup provides the necessary framework to handle and manipulate incoming feature data effectively.

 

Additional Resources:

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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.

1 reply

donalmateer
Safer
Forum|alt.badge.img+6
  • Safer
  • Best Answer
  • January 6, 2025

Hi ​@hawaiialex, thanks for the question!
I hope I can give you information for a more informed decision.

PythonCreator:

  • Ideal for generating features or performing tasks that don't depend on existing data within the workspace.
  • Simplifies workflows that don't need input data.
  • Reduces complexity by eliminating unnecessary transformers.

Although - Limited flexibility if future requirements involve processing existing features.

Creator + PythonCaller:

  • Suitable for scenarios where the Python script needs to process or manipulate incoming features.
  • Offers greater flexibility for processing existing features.
  • Easier to integrate with other transformers and data streams.

Although - Slightly more complex setup due to the need for an initial feature generation.

 

Given that your goal is to execute a Python script upon an update trigger to a GIS feature class, consider the following:

  • If the Python script operates independently of existing features: Utilize the PythonCreator. This approach simplifies the workspace by removing unnecessary components.

  • If the Python script needs to process or modify existing features: Implement the Creator + PythonCaller combination. This setup provides the necessary framework to handle and manipulate incoming feature data effectively.

 

Additional Resources:


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings