O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

Webhooks in FME Server, Cityworks & GIS Applications

Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Anúncio
Carregando em…3
×

Confira estes a seguir

1 de 62 Anúncio

Webhooks in FME Server, Cityworks & GIS Applications

Baixar para ler offline

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.

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.

Anúncio
Anúncio

Mais Conteúdo rRelacionado

Semelhante a Webhooks in FME Server, Cityworks & GIS Applications (20)

Mais de Safe Software (20)

Anúncio

Mais recentes (20)

Webhooks in FME Server, Cityworks & GIS Applications

  1. 1. Webhooks in FME Server, Cityworks & GIS Applications
  2. 2. FME User Conference 20 22 Cityworks Webinars (requires My Cityworks account & login) https://mycityworks.force.com/s/article/CC19-Extending-Work flows-with-Cityworks-Action-Manager https://mycityworks.force.com/s/article/Webinar-Video-Expan d-and-Automate-Workflows-with-Cityworks Integrating Cityworks and FME (safe.com) https://mycityworks.force.com/s/article/White-Paper-Expand- and-Automate-Workflows-in-Cityworks-Action-Manager-6805 96062 Action Manager & Webhooks Tutorials White Paper tinyurl.com/cityworksdublin22 Expert Point of Contact Steven Sushka steven_sushka@trimble.com
  3. 3. FME User Conference 20 22 My outline 20 min + 5 min q&A Intro (2min ) What is a webhook & components (5min) Example 1 (10 min) Example 2 (3) Close (1)
  4. 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 🏡
  5. 5. 20 22 FME User Conference Event Driven Automation
  6. 6. 20 22 FME User Conference Webhooks are automated messages between applications based on triggering events.
  7. 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.
  8. 8. 20 22 FME User Conference But first, what is a webhook and when should I use them?
  9. 9. 20 22 FME User Conference Why use webhooks instead of an API?
  10. 10. 20 22 FME User Conference Why use webhooks instead of an API?
  11. 11. 20 22 FME User Conference Why use webhooks instead of an API?
  12. 12. 20 22 FME User Conference Webhooks send messages when something happens.
  13. 13. 20 22 FME User Conference Webhooks send messages when something happens.
  14. 14. 20 22 FME User Conference Webhooks send messages when something happens.
  15. 15. 20 22 FME User Conference Do cool stuff in FME
  16. 16. 20 22 FME User Conference Send it on
  17. 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
  18. 18. FME User Conference 20 22 Select the feature in Cityworks Save Icon: “Select highlighted assets for work management” (Same feature in GIS)
  19. 19. FME User Conference 20 22 Create an Inspection. Enter inspection details. Save it. Close it.
  20. 20. FME User Conference 20 22
  21. 21. 20 22 FME User Conference A look under the hood
  22. 22. 20 22 FME User Conference Create a Webhook receiver URL with FME Server Automations
  23. 23. 20 22 FME User Conference
  24. 24. 20 22 FME User Conference Run a Workbench with Message as Parameter
  25. 25. 20 22 FME User Conference Use Log to view Message Details
  26. 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.
  27. 27. 20 22 FME User Conference A closer look Destination FME Server Message Contents [{ "CWActionname": "BikewayInspTest", "EntityUid": "{{EntityUid}}", "CondScore": "{{CondScore}}", "InspDate": "{{InspDate}}" }]
  28. 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
  29. 29. 20 22 FME User Conference JSONFragmenter to parse the message Read the webhook message from Cityworks
  30. 30. 20 22 FME User Conference ChangeDetector to only updated the deltas Read the webhook message from Cityworks Join to GIS, detect changes, send Edits to ArcGIS Online
  31. 31. 20 22 FME User Conference Let’s look at another example with ArcGIS Online
  32. 32. 20 22 FME User Conference Can we create work orders in ArcGIS Workforce when fire hydrants break?
  33. 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.
  34. 34. 20 22 FME User Conference Access the REST admin page (For Hosted Feature Layers only at this time) View item rest service Click Admin (top-right) Click Web Hooks at the bottom
  35. 35. FME User Conference 20 22 Enhance
  36. 36. 20 22 FME User Conference Create the Webhook FME Server URL
  37. 37. 20 22 FME User Conference Completed webhook setup FME Server URL
  38. 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
  39. 39. 20 22 FME User Conference “But wait, there’s more!” Use Extract Change Status to get the Result URL for the actual change data. Must wait for Status to be completed.
  40. 40. 20 22 FME User Conference Change Result (JSON) shown on http://json2table.com/
  41. 41. 20 22 FME User Conference
  42. 42. 20 22 FME User Conference 🎉💥🎊 💥 💥 💯
  43. 43. 20 22 FME User Conference FME Server Automation Run a Workspace
  44. 44. 20 22 FME User Conference FME Magic
  45. 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
  46. 46. FME User Conference 20 22 Receive & parse message payload
  47. 47. FME User Conference 20 22 Authenticate with AGO (get a token) Append this value “&token=” to requests to AGO
  48. 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"]
  49. 49. 20 22 FME User Conference Our favorite transformer Tester where Operable = 0 (inoperable)
  50. 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
  51. 51. FME User Conference 20 22 Write to ArcGIS Online Hosted Feature Layer: Workforce Assignments
  52. 52. 20 22 FME User Conference Working Result
  53. 53. FME User Conference 20 22
  54. 54. FME User Conference 20 22 New assignment created in ArcGIS Workforce (a new point feature in another hosted feature layer)
  55. 55. FME User Conference 20 22 New assignment details The Notes field has content we pulled from the original asset layer.
  56. 56. FME User Conference 20 22 Special Considerations: Domains, Null Values Allowed, Change Tracking, Sleep to allow job completion
  57. 57. 20 22 FME User Conference Event driven automation: send changes as they happen.
  58. 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. 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. 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. 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
  62. 62. Thank You! LSanders@dublin.oh.us https://www.linkedin.com/in/langdonsanders/

×