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

  • 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 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.
  • The Register ArcGIS ServerArcGIS 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 Server 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 new feature records will not be created.
  • 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. 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 filters client-side to remove or hide old feature records 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 processed event data will be added as new feature records.

Layer

The name of the feature layer in the feature service to which processed event data will be added as new feature records.

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.

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.

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

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.

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


En este tema
  1. Usage notes
  2. Parameters