Skip to main content

I am writing a workflow that refreshes data within a hosted AGOL feature service.

To enable continuity of service, I have 2 hosted feature services for the same layer.  eg.  Playgrounds_A and Playgrounds_B.    There is a view defined called Playgrounds_View whose source is either Playgrounds_A or Playgrounds_B 

My workspace plan is to refresh the contents of the ‘non-active’  feature service, and then set the Playgrounds_View to point to it.

I have managed this previously with Python for ArcGIS scripts using commands like item.add_relationship() and item.delete_relationship()

How can I recreate this functionality in FME workbench ?

Either user the PythonCaller Transformer, or set the Workspace Scripting Parameter to run Python code on Workspace Shutdown.


Since you already have the python, you could setup FME to utilise the ArcGIS Python API. Not a bad approach at all, since you already have the process.

 

Or you could do the switch using the rest api services in esri. Esri does this when swapping source layer for a view

 
If you look at that process via the UI (or via the calls that are made in your python process), you’ll probably find there is a lot going on. But in reality, a lot of it is just a query of the source service which is used in the updating of the view.
 
 
 

@todd_davis   I’m yet to learn how to execute python from FME.  When you say “setup FME to utilise the ArcGIS Python API. “  Is that anything other than using the PythonCaller transformer ?

If I run rest calls, which transformer is that done with ?


Hi,

You can install the ArcGIS API for python via

https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Form/Workbench/Installing-Python-Packages.htm

I don’t use that python library, because I prefer to make calls directly to the API (This is done via httpcaller and breaking up/creating detail with the Json transformers)

 

But to then utilise you existing python, use the pythoncaller transformer.

Unlike running in Esri, you will need to at least have your python inside a python function. But that could look as simple as this:

Please note, you will likely only want one feature going into the python caller, as multiple would initiate the same script multiple times in this instance.

 


Reply