Webhooks are automated ways to send messages between applications based on triggering events. We'll introduce webhook data flows and requirements, where FME Server comes into play, and illustrate working examples. Our examples will explore webhooks in Cityworks asset management software and how they can be used to update ArcGIS Online hosted feature layers on events such as closed inspections. We'll also preview the webhooks capabilities of ArcGIS Online to send data when GIS features are changed.
4. FME
User
Conference
20
22
Langdon Sanders
Senior Data Analyst, City of Dublin, Ohio
I enjoy building tools for governments to improve services.
I have a Masters in Public Administration from Wright State University
and will complete a Masters of Science in Analytics from Georgia Tech
next year.
I hail from Springfield, Ohio currently living in a suburb of Columbus,
Ohio, Earth.
A windy day in the Painted Desert, not Dublin, Ohio
🏡
7. 20
22
FME
User
Conference
Agenda
● What are webhooks?
● Why would you use them?
● Components
● An example application integration
We’ll build an automation between Cityworks
asset management software and ArcGIS Online
hosted feature layers.
Plus one more example if we have time.
17. 20
22
FME
User
Conference
Update GIS when Inspections
are complete in Cityworks
● Set up the Automation in FME Server to receive the
webhook
● Set the triggering event
● Create the webhook template
○ Format the message
○ Set the destination (FME Server URL)
● Write the model to do cool stuff
○ Parse the message
○ Update features
○ Create new features
○ Send notifications
● Trigger the model as an Automation
○ Run a workspace
26. 20
22
FME
User
Conference
Create the Webhook in Cityworks
“Action Templates” what does it do?
Message, fields to include, and destination
“Action Events,” when does it happen?
When an inspection is closed, a new work order created, etc.
28. 20
22
FME
User
Conference
Updating a Last Inspected Data & Condition Score
Read the webhook
message from
Cityworks
Join to GIS, detect
changes, send Edits to
ArcGIS Online
33. 20
22
FME
User
Conference
Process ArcGIS Online Hosted Feature Layer Changes
How it works
1) Edit Data
2) Webhook Triggered
a) Sends “payload” to destination
3) Parse Payload
4) Gather Changes from ArcGIS Online
a) get changes URL
b) submit extract changes job
c) get status and results URL
d) get job results (JSON)
5) Parse Change Results
6) Do other cool Stuff (FME)
a) Send edits to other layers
b) send email notification, etc.
38. 20
22
FME
User
Conference
Payload message from AGO Hosted Feature Layer
“Hey, changes happened, if you want to know more, go here!”
Need to access the changesUrl (sic)
- JSON praising + HTTPCaller in FME
45. 20
22
FME
User
Conference
FME Magic, now with 30% more magic!
Date User Comment
June 1, 2022 mattfromsafe Change the input parameter to accept the whole ArcGIS Online webhook response. Output multiple features for each type of event.
May 31,2022 mattfromsafe Do not return a feature if the JSON contains no events (was returning empty array)
May 27, 2022 mattfromsafe Transformer updated to use a web connection and output all events
July 16, 2020 siennaatsafe Transformer created
48. FME
User
Conference
20
22 Parsing the JSON Message (JSONFragmenter):
json["edits"][*]["features"]["updates"][*]["attributes"]["FIELDNAME"]
i.e. json["edits"][*]["features"]["updates"][*]["attributes"]["OPERABLE"]
50. FME
User
Conference
20
22
Makin’ new Points from JSON
● Get the geo_x and geo_y from asset AttributeKeeper
● Extract content for “Notes” field AttributeCreator
● Create new GIS features VertexCreator
● Project to Esri Web Mercator EsriReprojector
58. 20
22
FME
User
Conference
Ask, “Can we do that with
webhooks?”
ArcGIS Online Hosted Feature Layer
- feature changes, deletes, creation
ArcGIS Enterprise (Portal)
- Content monitoring for item created, deleted, updated, changed
ownership, published, item shared,
- Groups created, updated, users added or invited,
- Users added, deleted, enabled, assigned a role, etc.
- Roles added, updated, deleted
Cityworks
- Inspection, Request, Work Order modules:
- on creation, status change, close, comment added, attachment added,
task added, etc.
Some ideas:
Update assets with inspected date, inspection scores.
Create new features (GIS or asset management work orders) on conditional
events, i.e. status of a hydrant set to Disabled, trigger a work order.
Send notifications for monitoring your enterprise GIS
59. 20
22
FME
User
Conference
Resources
Esri
Getting Started
https://youtu.be/D9PMC2yGJbA?t=1196 get changes url, get token
Webhooks - Payloads (Feature Service)—ArcGIS REST APIs | ArcGIS Developers
Web Hooks (Feature Service)—ArcGIS REST APIs | ArcGIS Developers
/createWebhook: Create Webhook—ArcGIS REST API | ArcGIS Developers
Use webhooks to automate workflows in ArcGIS Field Maps (esri.com)
Apply Edits (Feature Service)—ArcGIS REST APIs | ArcGIS Developers
FME
https://www.safe.com/webinars/hook-line-and-sinker-reeling-in-arcgis-webhooks/
Webhooks and FME Server (safe.com)
https://www.safe.com/blog/2021/04/connect-apis-webhooks-no-time-no-code/
https://www.safe.com/webinars/6-ways-data-integration-enables-you-to-do-more-with-arcgis-online/
Tutorial: Getting Started with FME Cloud (safe.com)
Transforming JSON using the JSONExtractor, JSONFlattener, and JSONFragmenter (safe.com)
Misc
Test your webhook, view the
message without any overhead.
https://webhook.site/
Cityworks
Video on Action Manager & Webhooks
(requires My Cityworks account & login)
https://mycityworks.force.com/s/article/CC19-Extendi
ng-Workflows-with-Cityworks-Action-Manager
Integrating Cityworks and FME (safe.com)
60. From FME Webinar: “Hook, Line, and
Sinker: Reeling in ArcGIS Webhooks”
https://hub.safe.com/publishers/safe-lab/transformers/arcgisonlinewebhookdatagetter
https://community.safe.com/s/article/automating-workflows-from-survey123-to-arcgis-usin#:~:text=In%20your
%20FME%20Server%20Automation,used%20for%20in%20the%20future
61. 20
22
FME
User
Conference
Please Share Your Session Feedback
Log in & navigate to the
agenda. Select the
session you attended
Scroll down to “Session
Feedback”
Download EventMobi app
Event code: fmeuc
Click “Launch App”
Fill out the survey
and submit