How to get GeoEvent to only grab features when a particular attribute is changed.

781
2
06-09-2021 09:14 AM
OldManStrength
New Contributor

I have a workflow in which an e-mail needs to be sent when the status of a hydrant is changed from active to inactive and vise versa.  Is there a way I can tell GeoEvent to only trigger the message when that field, in particular, is changed?

In its current form messages are being sent when any change to the feature is made. 

 

0 Kudos
2 Replies
EricIronside
Esri Regular Contributor

Hey @OldManStrength 

Under the assumption that the updates happen relatively infrequently and don't need a high processing velocity you could do the following (NOTE: this is not a recommended approach for high velocity event streams).

1. Create a new 'temporary' table to hold the current value for the active field. This table will hold the ObjectID and any other fields you want to monitor for change (e.g. Status). The status fields would have the prefix 'Prev' added to them.

2. Set up a GeoEvent Service to read in all of the hydrants every so often.   I would use a time filter on the where clause to only read in the events that have been edited (turn on editor tracking) within your polling rate time window (e.g. polling every 10 minutes getting hydrants that have been edited in the last 10 minutes).

3. Field Map to a definition that adds the 'Prev' status fields to the schema so you can compare the currrent vs. the previous value.

4. Field Enrich with the previous values using the object id to match.

5. Filter out records that have not changed.

6. For the events that have changed: Send an email, update the 'Prev' value with the current value, field map to the temporary table schema, and write out the 'Prev' vaues to update your previous value table.

7. You should consider having an additional table that contains your 'Changed' hydrants. This table would be a mirror schematically to the original hydrant table. The output to this table should have the option to delete old featurs turned on and it should be set to something reasonable like 1-4 hours. This table can then put put into a map so end users can see where the changes are. Your email could even reference this map, zooming in to the particular hydrant.

8. Finaly, you could also send the output to ArcGIS Workforce or other work order management system to create a task assignment for someone to investigate the hydrant (maybe when they switch to the inactive state).

 

If you data is higer velocity, you will want to avoid the Field Enricher and go with a different approach.

0 Kudos
BrianHjort_Nielsen
New Contributor III

easiest way is to have a filter before the message (e-mail) output. 

I use it for door sensors, using an attribute named "value". The sensor sends attributes 1 and 0. 1 being the door is closed, 0 being the door is open.

So in my service i add a filter before the e-mail output "value = 0"

0 Kudos