Skip To Content

Update a Feature

The Update a Feature Output Connector can be used to update feature records, via a feature service’s feature layer, with attributes obtained from processed event records. This output requires event records have an associated GeoEvent Definition with an attribute field tagged TRACK_ID and that the value taken from this tagged field exactly match the value in an existing feature record’s specified Unique Feature Identifier Field to successfully identify and update the correct feature record. If an event record does not have a field tagged TRACK_ID, or the value from the tagged field cannot be matched to an existing feature record, a new feature record will be created by default. You can disable the default creation of new feature records by setting the Update Only property to Yes. This output connector relies on feature layer queries to update feature records via a feature service. The feature service can be one you have published to an ArcGIS Server site, one hosted by an ArcGIS Enterprise portal, or one hosted by an ArcGIS Online organization.

Usage notes

  • Use this output connector to update feature records in a feature service.
  • The feature service should have both the create and update operations enabled.
  • This output connector pairs the JSON Outbound Adapter with the Feature Service Outbound Transport.
  • Event records routed to this output connector are reformatted as feature JSON by the adapter.
  • The transport incorporates the formatted JSON into a REST request which is sent to the feature service.
  • For help troubleshooting this output connector, see the Esri Community blog Debugging the Add a Feature / Update a Feature Output Connectors.
  • This output connector assumes a one-to-one relationship between processed event records and existing feature records. If multiple feature records exist whose Unique Feature Identifier Field values match the value in a processed event record’s tagged TRACK_ID field, feature records may be inconsistently and/or incorrectly updated.
  • The Register ArcGIS Server capability, available when configuring a new output, allows you to register a connection to a standalone ArcGIS Server, an ArcGIS Enterprise hosting server, or the hosting server used by your ArcGIS Online organization. A server connection must be registered with ArcGIS GeoEvent Server in order to select a services folder, feature service, and feature layer for this output connector to use.
  • The Publish Feature Service capability, available when configuring a new output, allows you to publish a feature service directly from GeoEvent Manager. This capability requires an existing GeoEvent Definition whose schema reflects the fields you want your feature service’s feature layer to have. Note that restrictions imposed by your enterprise geodatabase (for example, reserved words and attribute field capitalization) must be reflected in the GeoEvent Definition you use when publishing a new feature service. The feature service you publish will, of course, have no feature records—it is an empty feature service which you can use GeoEvent Manager to add and/or update feature records using data from real-time event records being processed. The server to which you publish a new feature service must be either an ArcGIS Enterprise hosting server or a standalone ArcGIS Server with a managed geodatabase. GeoEvent Manager cannot be used to publish a new hosted feature service to an ArcGIS Online organization.
  • The Generate flat JSON default value should not be changed when an output is configured to add or update feature records in a geodatabase. By disabling this property, the output will maintain the hierarchical structure of attribute values sent to a feature service, which the feature service will reject, and feature records will not be updated.
  • The Delete old Features property can be enabled when you want the output to periodically query a feature service’s feature layer for features older than a specified number of minutes and delete the feature records it identifies. Alternatively, consider using filters client-side to remove or hide old feature records from a web map’s display rather than deleting authoritative data from your geodatabase. When choosing to Delete old Features, specify a date/time field which is regularly updated such as Last Updated or Last Edited. If a historic or fixed time field such as Date Created is used, you might accidently identify and delete feature records which are not necessarily obsolete.

Parameters

ParameterDescription

Name

A descriptive name for the output connector used for reference in GeoEvent Manager.

ArcGIS Server Connection

An ArcGIS Server, ArcGIS Enterprise, or ArcGIS Online connection registered with ArcGIS GeoEvent Server as a data store. Registered server connections cache information about map/feature services, their layers, and layer properties.

Folder

An ArcGIS Server services folder, ArcGIS Enterprise portal, or ArcGIS Online content item folder.

Service Name

The name of the feature service to which new feature records will be added, or existing feature records updated, using values from processed event data sharing the same unique track identifier.

Layer

The name of the feature layer in the feature service to which new feature records will be added, or existing feature records will be updated, using values from processed event data sharing the same unique track identifier.

Unique Feature Identifier Field

The field in a feature service’s feature layer that uniquely identifies a sensor or trackable asset. When searching to identify a feature record to update, this output will query for a feature record whose Unique Feature Identifier Field value exactly matches the value taken from a processed event record’s field bearing the TRACK_ID tag.

If an event record either does not have a field tagged TRACK_ID, or the value in the tagged field cannot be found in any existing feature record’s Unique Feature Identifier Field, the default behavior is to create a new feature record and begin updating the created feature when subsequent event records with a specific TRACK_ID are received by the output.

This output connector assumes a one-to-one relationship between processed event records and existing feature records. If multiple feature records exist whose Unique Feature Identifier Field values match the value in a processed event record’s tagged TRACK_ID field, feature records may be inconsistently or incorrectly updated.

Update Interval (seconds)

Specifies the interval (in seconds) the output will flush its cache of processed event records and request new feature records be created in the specified feature service. The default for this property is 1 second, which means data from processed event records will be cached and the cache flushed every second to save the event data by creating new feature records. You can limit the number of transactional requests made on your database server by increasing the update interval so that event data will be held in the output’s cache for a longer period of time.

Generate flat JSON

Specifies how hierarchy in a processed event record is handled by the output’s adapter. ArcGIS Server feature services do not support data values organized in arrays, groups, or as nested values. The default is to cast such data structures to a single string value whose attribute name is taken from the group element or array element’s name – effectively generating a flat JSON string value.

  • Yes—Hierarchical values will be flattened and processed as a single string of text using the substructure’s base name as the name of the string attribute field.
  • No—Hierarchical values will be maintained. As a result, processed event records will not be compatible with feature services. Event records will be dropped and will not be added as feature records in the feature service.

Remarque :
While the Add A Feature Output Connector allows hierarchical values to be cast to simple strings, the best practice recommendation is to use a Field Mapper Processor to explicitly flatten an event record’s structure before routing the event record to the output. Explicitly mapping values to separate discrete attribute fields whose type is string, double, date, geometry, etc. helps ensure data integrity and compliance with restrictions on attribute field values enforced by a feature service.

Formatted JSON

Specifies whether the feature JSON string will be prettified with whitespace indention and newline formatting. This JSON, sometimes referred to as PJSON, is generally only appropriate when writing to a system file whose content might be reviewed in a text editor. The default is No.

  • Yes—The feature JSON will be formatted (prettified).
  • No—The feature JSON will be not be formatted.

Delete Old Features

Determines whether the output connector will periodically query a feature service’s feature layer for features older than a specified number of minutes and delete the feature records it identifies. The default is No.

  • Yes—Old features will be periodically deleted from the feature service after a certain amount of time.
  • No—Old features will not be periodically deleted. Feature records will accumulate in the feature service.

Maximum Feature Age (minutes)

(Conditional)

Specifies the maximum age (in minutes) that feature records may persist before being considered old. The default is 1440 minutes, which means feature records older than 24 hours will be deleted from the feature service when the output has been configured to Delete Old Features.

Remarque :
An output does not need to receive any processed feature records to trigger the deletion of old feature records. The periodic query to identify and delete old records is run in parallel with the addition or creation of new feature records.

Property is shown when Delete Old Features is set to Yes and is hidden when set to No.

Frequency of Deleting Old Features (seconds)

(Conditional)

Specifies the interval (in seconds) that queries will be run to identify old feature records. The default is 20 seconds, which means that queries will be run three times every minute to check for feature records whose date/time value indicates the feature record is obsolete.

Property is shown when Delete Old Features is set to Yes and is hidden when set to No.

Time Field in Feature Class

(Conditional)

The feature layer attribute field whose date/time value is used to determine the age of each feature record. This property has no default. An attribute field should be selected whose value is frequently updated to avoid accidently deleting feature records which are not actually obsolete.

Property is shown when Delete Old Features is set to Yes and is hidden when set to No.

Maximum Features Per Transaction

The maximum number of records to include in any single feature service request to update feature records. If the outputs cache contains more than the specified maximum number of records, multiple requests will be made until the outputs cache has been emptied. The default is 500.

As a best practice, balance the size and complexity of each event record against the number of event records processed each second. When event records are particularly large, with many attribute fields and/or large complex geometry objects, reduce the value to avoid sending requests which are larger than a feature service can handle. However, depending on the velocity and volume of event records being processed each second, setting a value too low could result in an overwhelming number of transaction requests.

Update Only

Specifies whether the output connector should create new feature records when an event record does not have a field tagged with TRACK_ID, or the value from the tagged field cannot be matched to an existing feature record. The default is No.

  • Yes—Feature records must exist whose Unique Feature Identifier Field value exactly matches the value taken from a processed event record’s TRACK_ID tagged field. Matching feature records will be updated, but new feature records will not be created. Event records with no matching feature record will be discarded.
  • No—Feature records matching a processed event record will be updated. If no matching feature record can be identified a new feature record will be created.

Remarque :

The feature service must have both the create and update operations enabled when Update Only is set to No. If Update Only is set to Yes, the feature service only needs the update operation enabled since new feature records will not be created.


Dans cette rubrique
  1. Usage notes
  2. Parameters