Select to view content in your preferred language

Advanced Web Tool ETL with Data Interoperability

3302
0
08-19-2020 07:16 AM
BruceHarold
Esri Regular Contributor
2 0 3,302

This post is about leveraging ArcGIS Enterprise 10.8.1 with ArcGIS Data Interoperability extension to share Spatial ETL web tools within your organization.  The 'advanced' aspect is we'll be moving data using a web connection to a web platform enabled by an FME package, plus we'll throw in a webhook notification step for fun.

 

In my on-demand technical workshop for UC 2020 I demonstrated how to create a web tool that performs a format conversion by web service, a classic use case for Data Interoperability combined with the sharing power of ArcGIS Enterprise.  Data Interoperability however has moved on from being a format foundry to being a generic solution for no-code integration across the web, so in this post I will show how to build a web tool that takes non-native data through to a web platform.  I happen to be reading Microsoft Access table XY event data and writing to ArcGIS Online hosted features, but read between the lines and understand the data could go to any cloud platform or app equally easily.  In some ways moving data to the web is a better fit for Spatial ETL tools as FME readers and writers work with containers or workspaces, for example a geodatabase, which is not a valid geoprocessing service output parameter that can be returned to a client.  It can be done, for example by zipping file geodatabase outputs, but if you have a web platform available, then use it, data is more useful on the web than as local files.

 

Web tools are a new name for geoprocessing services.  The original workflow for publishing geoprocessing services using a history item and an administrative connection to a standalone server is still available in ArcGIS Pro 2.6, but I'll show the new paradigm of sharing a web tool to a portal.  You share a Spatial ETL tool as a web tool from a history item just like any other tool but with two special considerations:

 

  • The Spatial ETL source FME workspace must be embedded, and not external to the tool
  • Input parameters should be defined as simple types like Filename (Existing), Text or Choice

 

The first condition helps with packaging the tool at publication time, the second helps keep the final published tool parameter behavior simple.  You may have to refactor your ETL tool at authoring time to achieve these simplifications.  For example here I'm showing before and after versions of a Microsoft Access input parameter.  The default configuration allows picking multiple files with a large choice of file type extensions, my desired behavior is a single file with only .mdb and .accdb extensions.

 

Default Access Database Reader Parameter

 

Modified Access Database Reader Parameter

 

 

Conceptually and graphically my ETL tool is simple.  My scenario is I'm working for Fako Mining who do borehole planning with an Access app and record borehole locations as latitude & longitude in a table.  Click to expand the screen capture below, or edit the tool extracted from the blog attachment.  The data flow is:

 

  • Read an Access database table that has XY value fields
  • Write (or replace) a hosted point feature layer in ArcGIS Online
  • Trigger a webhook that notifies a Microsoft Teams channel the new data is available

 

There are three bookmarks in the workspace, in the blue one any existing feature service is deleted (I'm creating services named after the processing date), in the green one the Access data is read and converted to a point feature class in a zipped file geodatabase, and in the tan one the file geodatabase is published and shared to a group and lastly the webhook sent.  The concept is Online members are members of a Teams channel and will be notified the data is available.  While you're inspecting the workspace have a think about how much code this would take if you scripted it...

 

 

The key function in this is the ArcGISOnlineConnector transformer that does the work of publishing and sharing the zipped file geodatabase.  It is an FME Hub download and needs to be provisioned on the server, plus it uses a web connection that also needs to be provisioned on the server.

 

First, set up your server.  Install and license ArcGIS Data Interoperability for Server, make sure your server is federated to your portal, generate and import certificates for portal and server and so on.  Do not install ArcGIS Data Interoperability for Pro on your server, you will get license and tool failures

 

Once you have Data Interoperability installed, log onto the server as the ArcGIS Service local account user (by default named 'arcgis') and confirm you can open the Workbench app at this path:

 

C:\Program Files\ESRI\Data Interoperability\Data Interoperability AO11\fmeworkbench.exe

 

While logged onto the server as arcgis, create a share with the below path and give full control to the domain user (presumably you) who will be publishing the web tool and owns the web connection used in the ArcGISOnlineConnector.

 

\\<machinename>\Users\arcgis\AppData\Roaming\Safe Software\FME

 

From the authoring machine and as the publishing author, open the share.  Here is how it looks on my laptop:

 

 

Never mind the files in your share are different to mine, they will soon align.

 

Now we're going to provision the FME Package for ArcGISOnlineConnector and the web connection used by it to the server.  Download the current release of the package to the share.  Still from the authoring machine, open Workbench and then the  FME Tools dialog Default Paths view.  Note (write down!) the profile directory for Data Path, it is the folder where web connections are stored.  You will temporarily change it next.

 

 

One way web and database connections are shared is the owner copies the files fme_connections.data and fme_publicKey.jceks from the Data Path to a shared folder (in our case the share above, which is also the default location where the arcgis user will store web connections), redirects the Data Path to use the new location, opens the Web Connections view of FME Tools and selects web connections to be made public.  Having done that revert the Data Path to the original default for the authoring user.  The arcgis server user must have write access to the copied data.  If your server is not on your network it may be easier to use the export/import methodology for credential sharing.

 

Now as the arcgis user logged onto the server, open Workbench from the path given above and drag the file safe.esri-agol-1.1.4.fpkg (the version may change) from the share at C:\Users\arcgis\AppData\Roaming\Safe Software\FME into the canvas to install it.  Check FME Tools>Web Connections sees the web connection to ArcGIS Online.  Create a test workspace that makes a web connection and uses an ArcGISOnlineConnector to list the contents of a contents folder - the blog download has an example TestWebConnection.fmw.  If everything works the server is ready for action!

 

Run your Spatial ETL tool as a tool so that a history item is created.  Then right click on the history item and share it as a web tool.  Here is my experience:

 

 

Allow uploads, make it asynchronous, set the Info message level, this will display workspace processing messages.

 

 

Don't forget to edit the tool parameter(s) - click the pen icon.  You may have to do this twice to make it 'stick'.

 

 

It will analyze with a warning, this is normal for Spatial ETL tools.

 

 

After the web tool publishes, open the Catalog pane at the portal contents and run your tool.  Mine throws a warning to do with some coordinate system handling, but I'll take the win.  By design there are no features displaying as output as there is no writer in the workspace, my data went to ArcGIS Online courtesy of the ArcGISOnlineConnector.  The log shows intermediate processing worked as expected.

 

 

Teams shows me the webhook triggered, which is the last part of the web tool processing, and it gives me a service URL so something is there....  Take a look at what is in the HTTPCaller transformer to see how I got an image into the webhook payload (its a public image item in Online).

 

 

Bingo, my data loads into my map!

 

 

So that is the round trip, I have a web tool anyone in my organization can use to publish hosted feature layers from an Access database table, with the added touch of automated notifications.