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 parameter 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.
- Service layers can be referenced using the Browse to Layer option or by specifying a URL using the Service Layer URL option in the Reference to Layer Type parameter. Both options require a registered data store connection be established first.
- The Publish Feature Service option, available when configuring a new output, allows you to publish a feature service directly from GeoEvent Manager. This 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 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 parameter, 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 parameter 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
Parameter | Description |
---|---|
Name | A descriptive name for the output connector used for reference in GeoEvent Manager. |
Registered 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. |
Reference to Layer Type | Defines the options for referencing a layer.
|
Folder (Conditional) | An ArcGIS Server services folder, ArcGIS Enterprise portal, or ArcGIS Online content item folder. Parameter is shown when the Reference to Layer Type parameter is set to Browse to Layer and is hidden when set to Service Layer URL. |
Service Name (Conditional) | 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. Parameter is shown when the Reference to Layer Type parameter is set to Browse to Layer and is hidden when set to Service Layer URL. |
Layer (Conditional) |
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. Parameter is shown when the Reference to Layer Type parameter is set to Browse to Layer and is hidden when set to Service Layer URL. |
Service Layer URL (Conditional) | The URL to a service layer. Nota:A data store connection must be established when referencing a service layer by URL. The service layer must either be publicly accessible or shared with the user whose credentials establish the data store connection.Parameter is shown when the Reference to Layer Type parameter is set to Service Layer URL and is hidden when set to Browse to Layer. |
Unique Feature Identifier Field | The field in a feature service’s feature layer that uniquely identifies a sensor or trackable asset. When identifying 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 parameter 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.
Nota: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.
|
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.
|
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. Nota: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.Parameter 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. Parameter 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 parameter 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. Parameter 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.
Nota: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. |