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 that 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 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
Keep the following in mind when using the Update a Feature output connector:
- 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 that is sent to the feature service.
- For help troubleshooting this output connector, see the Debugging the Add a Feature / Update a Feature Output Connectors blog on the Esri Community.
- 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.
- The Register ArcGIS Server option, available when configuring a new output, allows you to register a connection to a stand-alone 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 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 in the Service Layer URL or Reference to Layer Type parameters. Both options require that 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 have no feature records—it is an empty feature service that 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 stand-alone ArcGIS Server with a managed geodatabase. GeoEvent Manager cannot be used to publish a new hosted feature service to an ArcGIS Online organization.
- The default value in the Generate flat JSON parameter should not be changed when an output is configured to add or update feature records in a geodatabase. When 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 should 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 client-side filters to remove or hide old feature records from a web map’s display rather than deleting authoritative data from your geodatabase. When the Delete Old Features parameter is enabled, specify a date/time field that is regularly updated, such as Last Updated or Last Edited. If a historic or fixed time field such as Date Created is used, you may accidently identify and delete feature records that are not necessarily obsolete.
Parameters
The following are the parameters for the Update a Feature output connector:
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. The 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. The 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. The 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. Hinweis: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.The 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 with the TRACK_ID tag 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.
Hinweis:While the Add A Feature Output Connector allows hierarchical values to be cast to simple strings, it is recommended that you 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, and others 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 indentation and newline formatting. This JSON, sometimes referred to as PJSON, is generally only appropriate when writing to a system file whose content may 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. Hinweis: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.The 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. The 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. An attribute field should be selected whose value is frequently updated to avoid accidently deleting feature records that are not actually obsolete. The 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. It is recommended that you 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 or large complex geometry objects, reduce the value to avoid sending requests 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 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.
Hinweis: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. |