As of FME 2024.0, support for Esri ArcGIS Online (AGOL), ArcGIS Enterprise Portal, and ArcGIS Server Feature Service formats has transitioned to a unified approach using the new Esri ArcGIS Feature Service (Format). This format replaces the legacy reader/writer formats for each of the three services.
Starting in FME 2026.1, the legacy formats will be hidden in the Quick Add menu. Instead, equivalent functionality is now provided by the downloadable Esri ArcGIS Connector package, available on FME Hub. The package also includes new web services and key transformers such as the ArcGISOnlineConnector, ArcGISAttachmentConnector, and ArcGISBranchVersionManager. The package can be installed directly through the Quick Add menu in FME Workbench. Once installed, the new Esri Feature Service format will appear in the Gallery as a unified method for interacting with all three types of Esri ArcGIS Feature Services.
For details on this transition, including guidance on updating existing workspaces, please refer to the article: Working with Esri ArcGIS Feature Services in FME.
Introduction
Updating, inserting, and deleting features in utility network data for Esri ArcGIS Portal Feature Services is crucial for maintaining accurate and up-to-date information. Managing changes in utility network data requires a clear understanding of the available methods and tools within FME.
Data standardization ensures accuracy when comparing the original and revised data between File Geodatabase and ArcGIS Portal Feature Service using a ChangeDetector transformer. This means that attribute names, types, and widths must match between the two sources for the ChangeDetector to be effective. Any modifications made during the standardization process must be rectified, and the data must conform to the destination's schema definition before writing.
This tutorial will focus on the techniques and considerations involved in creating, updating, and deleting features in the utility network data, ensuring that the desired modifications are applied correctly and efficiently.
Creating, Updating, and Deleting Features in FME
- You can create and update features directly in FME using the appropriate transformers and writers.
- Important Note: You cannot directly delete features in FME.
- To delete features, you need to select the specific features you want to delete and set the Feature Operation option for the writer to "Delete" for those selected features.
Configuring Feature Operation for Writer
To make actual changes in the utility network data, you need to configure the feature operation correctly. The feature operation determines how the features will be processed and applied to the utility network. These feature operations can be categorized into individual methods and bulk methods:
Individual Methods:
- Update: Modifying existing features in the utility network individually.
- Insert: Adding new features to the utility network one at a time.
- Delete: Removing features from the utility network individually (simulated in FME by setting the data handling option to "Delete").
Bulk Methods:
- fme_db_operation: Dynamically insert, update, or delete features in bulk based on the value set for this attribute column.
- Upsert: A combination of inserting new features and updating existing features based on a match condition, allowing for bulk processing.
Utility Network Databases are often not configured for appending data. Generally speaking, UPSERT is not a viable option for utility network data
Configuring the feature operation ensures that the desired changes are applied correctly to the utility network data. For an in-depth description of feature operations, please consult this documentation. It is recommended to use the fme_db_operation attribute if you are performing multiple feature operations, such as updating, inserting, and deleting, within a single writer. By utilizing the fme_db_operation attribute, you can streamline the process and handle all the feature operations using a single writer, enabling bulk processing. In contrast, not using the fme_db_operation attribute will limit you to performing only one feature operation per writer, requiring you to add multiple writers to achieve the same functionality as using fme_db_operation, which can be less efficient for individual feature operations.
Limitations: Updating Features in Portal Feature Service for Utility Network
There is a limitation when updating features in a utility network using an Esri ArcGIS Portal Feature Service writer. FME currently sends all the attributes of a feature when updating features, even when modifications have not been made to all attributes. Due to this behavior, subnetwork controllers may prevent making updates to certain features as edits to Asset Group and Asset Type are prevented by assigned subnetwork controllers. To avoid this issue, it is recommended that Asset Group and Asset Type attributes be excluded from the feature before the features are passed on to the writer. You can exclude Asset Group and Asset Type by adding an AttributeManager or AttributeRemover. By removing these attributes, the FME writer will not attempt to update them, thus preventing the error. To optimize performance, you may want to select GLOBALID, and only the desired attributes need to be updated. If you want to modify values for Asset Group and Asset Type, you must either disable or remove subnetwork controller assignments, update the features, and then enable or set a subnetwork controller assignment. At the moment, you can disable and enable subnetwork controllers using ArcGIS REST Services and remove and set subnetwork controllers using ArcGIS Pro. Similarly, network topology can be disabled and enabled using both ArcGIS REST Services and ArcGIS Pro.
To automate the process of updating, inserting, and deleting features, we recommend using ArcGIS REST Services to disable and enable subnetwork controllers and network topology within the workspace.
Additionally, when modifying values for Asset Group and Asset Type, ensure that you are passing the code of the coded domain to the Writer.
Requirements
- FME Form installed and licensed
- Esri ArcGIS Pro or ArcGIS Enterprise installed and licensed
- Basic understanding of utility network data structure and dataset, FME transformers, and FME and geodatabase
- Utility Network-configured ArcGIS Portal Feature Service item
- Complete the following FME & Esri ArcGIS Utility Network Tutorials:
Sources
- Writing_UID_Part1.fmw contains the completed workspace for this part of the tutorial. It contains the Portal URL, Credentials, Feature Service, Layers/Feature Types, and Branch Versioning for Portal Reader, and it will need to be re-configured to make the workspace usable.
- Writing_UID_Part2.fmw contains the completed workspace for both individual and bulk methods. To make the workspace usable, the portal URL, Credentials, Feature Service, Layers/Feature Types, Branch Versioning for Readers and Writers, and Dataset (path location) and Tables for the Geodatabase Reader will need to be reconfigured.
- Writing_UID_Part3.fmw contains the completed workspace for both individual and bulk methods. To make the workspace usable, the portal URL, Credentials, Feature Service, Layers/Feature Types, and Branch Versioning for Readers, Dataset (path location) and Tables for Geodatabase Readers, and Dataset (path location) for Writers will need to be reconfigured.
Step-by-Step Instructions
Part 1: Loading Workspace that is Configured to Retrieve Updated, Inserted, and Deleted Features
1. Load the Workspace that Retrieves Updated, Inserted, and Deleted Features from ArcGIS Utility Network Data
Open FME Workbench and configure the workspace for retrieving updated, inserted, and deleted features from a File Geodatabase, ArcSDE Geodatabase, and/or Esri ArcGIS Portal Feature Service. If you are using a workspace that detects change between File/ArcSDE to Portal Feature Service and have rectified attributes to increase the accuracy of the ChangeDetector transformer, you must rectify attributes of the output of ChangeDetector to match the schema of the desired Feature that you are writing to. Alternatively, you can open FME Workbench and load the workspace from the source that has been prepared for this tutorial. This workspace should already have the updated, inserted, and deleted features retrieved using the ChangeDetector transformer. However, you cannot run this workspace due to the portal feature service configuration for this workspace unless you specify your own data sources. This workspace will be used for this tutorial.
2. Review the Workspace
If you are using the workspace from the source to rectify the data sources and make the workspace runnable, you need to configure the reader parameters to match your specific data sources:
- For the ArcGIS Portal Feature Service reader, update the "Dataset" parameter to point to your organization's ArcGIS Portal URL and specify the appropriate feature service.
- For the File Geodatabase or ArcSDE Geodatabase reader, update the "Dataset" parameter to specify the file path location or database connection details for your utility network data.
Ensure that the layer names and attribute names in the workspace match the corresponding names in your data sources. If necessary, use transformers like the BulkAttributeRenamer and AttributeManager to align the attribute names and values between the original and revised data sources.
Part 2: Writing to Portal Feature Service
Individual Method
1. Add an Esri ArcGIS Portal Feature Service Writer
Continuing in the same workspace as Part 1, specifically, Writing_UID_Part1, add a writer to the canvas. In the parameters, set the following:
A. Set the Format as: Esri ArcGIS Portal Feature Service
B. Specify your organization’s Esri Portal URL for the Dataset.
C. Set the Layer Definition as: Import from Dataset…
D. Click on “Parameters…”. In the Esri ArcGIS Portal Feature Service Parameters dialog:
A. Click on the ellipsis next to Selected Feature Service.
-
- Select the corresponding dataset to the reader, for this tutorial, Water Device will be selected
B. Enable branch versioning.
C. Set the reconcile to: Yes
D. Set the Post to: No
E. Click on “OK” twice to finish the parameter.
2. Edit Import Writer Feature Types
In the Import Writer Feature Types dialog:
A. Click on “Parameters”.
B. Click on the ellipsis next to Layers and select the layer that corresponds to the reader.
-
- For this tutorial, Water Device will be selected.
C. Specify Feature Per Request to 1
-
- Adjust the feature request on your own discretion, 1 ensures that the writer will not experience HTTP timeout.
D. Click on “OK”. Repeat these Steps 1 to 2 two more times.
3. Connecting the Transformers to the Writer Feature Types
From the AttributeManager and TestFilter, A. Connect the output port from AttributeManager, that is connected to UPDATE port, to one of the writer feature types
B. Connect the INSERT output port from TestFilter to one of the writer feature types
C. Connect the DELETE output port from TestFilter to one of the writer feature types Your workspace should look similar to this:
4. Edit Feature Type Parameter
For each of the writer feature types, In the Feature Type dialog:
A. Set the Feature Operation to the corresponding output
-
- Set Feature operation for the writer connected to AttributeManager port to Update.
- Set Feature operation for the writer connected to INSERT port to Insert.
- Set Feature operation for the writer connected to DELETE port to Delete.
5. Save and Run the Workspace
Now, save and run the workspace. View the output data in Esri ArcGIS Pro to see if it was properly written to the portal feature service. To verify that the features have been successfully updated, inserted, or deleted, you can use the Select By Attribute tool in Esri ArcGIS Pro. Open the attribute table of the feature class and use the Select By Attribute tool to query the GlobalID field for a specific feature that you know has been updated, inserted, or deleted. If the feature is found (for updated or inserted features) or not found (for deleted features) with the expected attribute values, it confirms that the FME workspace has successfully performed the desired operation on the feature.
Bulk Method
1. Add an Esri ArcGIS Portal Feature Service Writer
Continuing in the same workspace as Part 2, add a writer to the canvas. In the parameters, set the following:
A. Set the Format as: Esri ArcGIS Portal Feature Service
B. Specify your organization’s Esri Portal URL for the Dataset.
C. Set the Layer Definition as: Import from Dataset…
D. Click on “Parameters…” In the Esri ArcGIS Portal Feature Service Parameters dialog:
A. Click on the ellipsis next to Selected Feature Service.
-
- Select the corresponding dataset to the reader.
- For this tutorial, Water Device will be selected.
B. Enable branch versioning.
C. Set the reconcile to: Yes
D. Set the Post to: No
E. Click on “OK” twice to finish the parameter.
2. Edit Import Writer Feature Types
In the Import Writer Feature Types dialog:
A. Click on “Parameters”
B. Click on the ellipsis next to Layers and select the layer that corresponds to the reader
-
- Select the corresponding dataset to the reader, for this tutorial, Water Device will be used
C. Specify Feature Per Request to 1.
- Adjust the feature request on your own discretion, 1 ensures that the writer will not experience HTTP timeout.
D. Click on “OK”.
3. Connecting the Transformers to the Writer
From the AttributeManager and TestFilter,
A. Connect all the outputs, Output, Insert, and Delete, to the writer feature type Your workspace should look similar to this:
4. Edit Feature Type Parameter
For the writer feature type, In the Feature Type dialog:
A. Set the Feature Operation to: fme_db_operation
5. Save and Run the Workspace
Now, save and run the workspace. View the output data in Esri ArcGIS Pro to see if it was properly written to the portal feature service.
Part 3: Writing to File/ ArcSDE Geodatabase
The process of writing to file/ArcSDE Geodatabase is essentially the same as writing to Portal Feature Service. It is recommended to specify a template file geodatabase when writing to a file geodatabase. By using a template, you can create multiple copies of the geodatabase instead of overwriting the existing one. This approach provides redundancy and offers several benefits:
- Data Archive and Backup
- Versioning
- Testing and experimentation
Individual Method
1. Add an Esri Geodatabase File Geodb Writer
Continuing in the same workspace as Part 1, specifically Writing_UID_Part1, add a writer to the canvas. In the parameters, set the following:
A. Set the format as: Esri Geodatabase (File Geodb).
B. Specify the file path and name you want to save to by clicking on the ellipsis next to Dataset.
C. Set the Feature Class or Table Definition as Import from Dataset…
D. Click on "Parameters...". In the Esri File Geodatabase (File Geodb) Parameters dialog:
A. Enable Overwrite Existing Geodatabase and select your File geodatabase that contains your utility network data as Template File Geodatabase.
- For this tutorial, WaterDistribution_UtilityNetwork.gdb will be selected.
B. Expand Advanced and set "yes" for Preserve GlobalID.
C. Click on "OK" and “OK” again, to select feature type layers to write to.
2. Edit Import Writer Feature Types
In the Import Writer Feature Types dialog:
A. Click on “Parameters”
B. Click on the ellipsis next to Layers and select the layer that corresponds to the reader.
-
- For this tutorial, UtilityNetwork/WaterDevice will be selected.
C. Specify Feature Per Request to 1.
-
- Adjust the feature request on your own discretion, 1 ensures that the writer will not experience HTTP timeout.
D. Click on “OK”. Repeat these Steps 1 to 2 two more times.
3. Connecting the Transformers to the Writer Feature Types
From the AttributeManager and TestFilter,
A. Connect the output port from AttributeManager, which is connected to UPDATE port, to one of the writer feature types
B. Connect the INSERT output port from TestFilter to one of the writer feature types
C. Connect the DELETE output port from TestFilter to one of the writer feature types Your workspace should look similar to this:
4. Edit Feature Type Parameter
For each of the writer feature types, In the Feature Type dialog:
Set the Feature Operation to the corresponding output
A. Set Feature operation for the writer connected to AttributeManager port to Update.
a. Specify GLOBALID for Match Columns.
B. Set Feature operation for the writer connected to INSERT port to Insert.
a. Specify GLOBALID for Match Columns.
C. Set Feature operation for the writer connected to DELETE port to Delete.
a. Specify GLOBALID for Match Columns.
5. Save and Run the Workspace
Now, save and run the workspace. View the output data in Esri ArcGIS Pro to see if it was properly written to the File/ ArcSDE Geodatabase.
Bulk Method
1. Add an Esri Geodatabase File Geodb Writer
Continuing in the same workspace as Part 3, add a writer to the canvas. In the parameters, set the following:
A. Set the format as: Esri Geodatabase (File Geodb)
B. Specify the file path and name you want to save to by clicking on the ellipsis next to Dataset.
C. Set the Feature Class or Table Definition as: Import from Dataset…
D. Click on "Parameters...". In the Esri File Geodatabase (File Geodb) Parameters dialog:
A. Enable Overwrite Existing Geodatabase and select your File geodatabase that contains your utility network data as Template File Geodatabase.
-
- For this tutorial, WaterDistribution_UtilityNetwork.gdb will be selected.
B. Expand Advanced and set "yes" for Preserve GlobalID.
C. Click on "OK" and “OK” again, to select feature type layers to write to.
2. Edit Import Writer Feature Types
In the Import Writer Feature Types dialog:
A. Click on “Parameters”
B. Click on the ellipsis next to Layers and select the layer that corresponds to the reader
- For this tutorial, UtilityNetwork/WaterDevice will be selected.
C. Specify Feature Per Request to 1.
- Adjust the feature request on your own discretion, 1 ensures that the writer will not experience HTTP timeout.
D. Click on “OK”.
3. Connecting the Transformer to the Writer Feature Type
From the AttributeManager and TestFilter,
A. Connect all the outputs to the writer feature type Your workspace should look similar to this:
4. Edit Feature Type Parameter
For the writer feature type, In the Feature Type dialog:
A. Set the Feature Operation to: fme_db_operation
B. Specify GLOBALID for Match Columns.
5. Save and Run the Workspace
Now, save and run the workspace. View the output data in Esri ArcGIS Pro to see if it was properly written to the File/ ArcSDE Geodatabase.
Troubleshooting
Error Identification when Updating/ Inserting/ Deleting Features into ArcGIS Portal Feature Service
Solution: Identify the exact error from ArcGIS Server Manager and/or Fiddler
At the moment, the FME Translation Log only informs about the last error and does not provide comprehensive error information. By following these steps, you can identify the exact error message and gain insights into why the feature update, insert, or delete operation is failing. This information will be crucial for troubleshooting and resolving the issue.
ArcGIS Server Manager:
Start by accessing the logs in ArcGIS Server Manager (https://(Your Org ArcGIS Portal URL).com/server/manager/). Log in and navigate to the "Logs'' tab. Set the appropriate parameters for querying log messages and change the level of detail at which the log messages are generated. Query the log messages and look for any entries related to your operation. These logs can provide detailed error messages and codes that can help pinpoint the error.
Fiddler:
Use Fiddler to capture and analyze the HTTP traffic between your application and the server. Download and install Fiddler, then open it and configure it to capture traffic that FME (Feature Manipulation Engine) is sending to the Feature Service REST API. Reproduce the error by performing the feature operation in your application. Fiddler will capture the HTTP requests and responses exchanged. Locate the request associated with your operation and inspect the request and response details in Fiddler. Look for any error messages, status codes, or response bodies that indicate the nature of the problem. Once you have identified the request in Fiddler, you can extract it and send it directly to the Feature Service REST API endpoint on ArcGIS Portal Feature Service. This allows you to isolate the request and test it independently of FME, helping you determine if the issue lies within the request itself or if it's specific to the interaction between FME and the Feature Service.
Esri ArcObjects Error Number '-2147216556'
When writing to a File Geodatabase, you may encounter this error. Update the writer and set Transaction Type to Edit Session. For more information, consult this documentation.
FMEException: 928239 - Generic Error for Writer when ArcGIS REST API returns '400'
This error can be raised when:
- Subnetwork Controller/ Network Topology Violation: Modifying Values that the subnetwork controller is preventing edits to or that violates Network's Topology.
- Invalid Value for Attribute data type: Passing invalid values such as String value to an attribute with the data type set as Integer.
- Mismatch between GLOBALID and OBJECTID: Updating features where there is a mismatch between GLOBALID and OBJECTID between the values passed to FME Writer and what is available in the Feature Service
For the subnetwork controller, as mentioned in the limitation section above, if you are not modifying values for Asset Group and Asset Type, remove these attributes using AttributeManager or AttributeRemover. To modify Asset Group and Asset Type values, you must first disable/remove the subnetwork controller. This can be done using either ArcGIS REST Services (refer to this documentation) or ArcGIS Pro (refer to this documentation). If you want to modify values that violate network Topology, you can temporarily disable using either ArcGIS REST Services (refer to this documentation) or ArcGIS Pro (refer to this documentation).
Remember to re-enable/re-create the subnetwork controller assignments and network topology after completing your database operations to maintain network integrity.
For invalid attribute data type errors, ensure that the values being passed to the Writer conform to the data types defined in the destination schema. For example, if an attribute's data type is defined as an Integer in the schema definition, make sure you are not passing non-integer values to it. Depending on how the utility network dataset is configured, the Portal Feature Service Writer uses either GLOBALID or OBJECTID. As indicated in the ArcGIS REST services documentation, edits to features require either GLOBALID or OBJECTID for matching.
If you attempt to update or delete features without using GLOBALID or OBJECTID, the ArcGIS REST Service may return a '400' error due to its inability to match columns, resulting in FMEException 928239.
Other FME and Esri ArcGIS Errors
If you encounter FME and Esri ArcGIS, this documentation is a comprehensive resource containing various troubleshooting solutions.
Data Attribution
Water Distribution Utility Network Foundation data is copyright 2024 Esri. Licensed under Apache-2.0. Source: ArcGIS Solutions.