Skip To Content

Add a Feature

The Add a Feature output connector can be used to save event data, as feature records, via a feature service’s feature layer. This output connector will create a new feature record for every processed event record routed to the output. If minimizing duplicate feature records is a design objective, consider using the Update a Feature output connector. This connector relies on feature layer queries to add new feature records to 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 working with the Add a Feature output connector:

  • Use this output connector to add feature records to a feature service. The feature service must have the create operation 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 Esri Community blog Debug Techniques - Add/Update Feature Outputs.
  • The Register ArcGIS Server capability, 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 using the Service Layer URL option in the Reference to Layer Type parameter. Both options require that a registered data store connection be established first.
  • 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 have no feature records—it is an empty feature service that you can use GeoEvent Server to add 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 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 Generate flat JSON parameter's 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 new feature records will not be created.
  • The Delete old Features parameter can be set to Yes 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. Rather than adding new feature records and then deleting old feature records, consider using an Update a Feature output connector when features can be identified using a track identifier such as a serial number or unique asset identifier. Also consider using client-side filters to remove or hide old feature records rather than deleting authoritative data from your geodatabase.
  • When the Delete old Features parameter is set to Yes, 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 Add a Feature output connector:

ParameterDescription

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.

  • Browse to Layer—Reference a service layer by browsing the folders of a registered data store.
  • Service Layer URL—Reference a service layer by specifying the URL of the shared service 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 processed event data will be added as new feature records.

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 processed event data will be added as new feature records.

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.

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.

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.

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.

  • 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.

Nota:
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.

  • Yes—The feature JSON will be formatted (prettified).
  • No—The feature JSON will 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.

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.

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 create 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.


En este tema
  1. Usage notes
  2. Parameters