Skip to content

SplitFeatureWorkflow

ESM: import SplitFeatureWorkflow from "@arcgis/core/widgets/Editor/SplitFeatureWorkflow.js";
CDN: const SplitFeatureWorkflow = await $arcgis.import("@arcgis/core/widgets/Editor/SplitFeatureWorkflow.js");
Class: @arcgis/core/widgets/Editor/SplitFeatureWorkflow
Inheritance: SplitFeatureWorkflow→Workflow→Accessor
Since: ArcGIS Maps SDK for JavaScript 4.34

A read-only class containing the logic used when splitting a selected feature using the Editor widget. The workflow has two steps. In the first step, the user sketches the geometry that will be used to split the feature. In the next step, the user can review the two resulting features and their attributes.

  • Currently only supported in 2D.
  • Support is limited to splitting one feature at a time.
  • Point features cannot be split.
  • When using a polyline splitter geometry, all parts of a multipart feature must be split together. To split only specific parts of a multipart feature, use a polygon splitter geometry instead.
See also

Property Overview

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
Show inherited properties Hide inherited properties
Name Type Summary Class

The currently active feature.

SplitFeatureWorkflow

The shared workflow data.

Workflow

The name of the class.

Accessor

Specifies the type of geometry to be drawn by the Sketch operation that is started automatically when the workflow is launched.

SplitFeatureWorkflow

The instance of FeatureFormViewModel used by the workflow to manage the attributes of the resulting features.

SplitFeatureWorkflow

This property indicates whether there is a next step in the workflow.

Workflow

This property indicates if there is a previous step in the workflow.

Workflow

The layer to which the feature being split belongs.

SplitFeatureWorkflow

Indicates whether the workflow is considered active.

Workflow

The name of the current step in the workflow.

Workflow

The type of the workflow.

SplitFeatureWorkflow

Property Details

activeFeature

Property
activeFeature Graphic |null |undefinedreadonly

The currently active feature. The active feature is highlighted in the view, and is assigned to the workflow's featureFormViewModel, so that the form shows and manages its attribute values.

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

The name of the class. The declared class name is formatted as esri.folder.className.

defaultSplitterGeometryType

Property
defaultSplitterGeometryType String |null |undefined

Specifies the type of geometry to be drawn by the Sketch operation that is started automatically when the workflow is launched. The user has the option to begin a different Sketch operation with a different geometry type.

Possible Values:"point" |"polyline" |"polygon"

formViewModel

Property
formViewModel FeatureFormViewModelreadonly

The instance of FeatureFormViewModel used by the workflow to manage the attributes of the resulting features.

hasNextStep

Inherited
Property
hasNextStep Booleanreadonly
Inherited from Workflow

This property indicates whether there is a next step in the workflow.

hasPreviousStep

Inherited
Property
hasPreviousStep Booleanreadonly
Inherited from Workflow

This property indicates if there is a previous step in the workflow.

The layer to which the feature being split belongs. This is also the layer to which the new feature created by the workflow will be added.

started

Inherited
Property
started Booleanreadonly
Inherited from Workflow

Indicates whether the workflow is considered active.

Default Value:false

stepId

Inherited
Property
stepId Stringreadonly
Inherited from Workflow

The name of the current step in the workflow.

type

Property
type Stringreadonly

The type of the workflow.

For SplitFeatureWorkflow the type is always "split-feature".

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

Accessor
Promise<void>

Cancels the active workflow.

Workflow
Promise<void>

Call this method when the workflow is considered finished.

Workflow

Returns true if a named group of handles exist.

Accessor
Promise<void>

Moves to the next step in the workflow.

Workflow
Promise<void>

Moves to the previous step in the workflow.

Workflow

Removes a group of handles owned by the object.

Accessor
Promise<void>

Resets the workflow.

Workflow
Promise<void>

Sets the specified feature as the active feature in the workflow.

SplitFeatureWorkflow
Promise<any>

Starts the workflow.

Workflow

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

cancel

Inherited
Method
cancel(options){Promise<void>}
Inherited from Workflow

Cancels the active workflow.

Parameters
Specification
options Object
optional

An object with the following properties.

Specification
error Error
optional

The returned Error object.

force Boolean
optional

Indicates whether to force cancel the active workflow.

emitCancelEvent Boolean
optional

Indicates whether to display a prompt indicating canceling the active workflow.

Returns
Type Description
Promise<void> Resolves when the active workflow is canceled.

commit

Inherited
Method
commit(){Promise<void>}
Inherited from Workflow

Call this method when the workflow is considered finished. This is used to help process the editing results.

Returns
Type Description
Promise<void> Resolves when the active workflow commits and processes the edited results.

hasHandles

Inherited
Method
hasHandles(groupKey){Boolean}
Inherited from Accessor

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}

next

Inherited
Method
next(){Promise<void>}
Inherited from Workflow

Moves to the next step in the workflow.

Returns
Type Description
Promise<void> Resolves when moved to the next step within the active workflow.

previous

Inherited
Method
previous(options){Promise<void>}
Inherited from Workflow

Moves to the previous step in the workflow.

Parameters
options Object
optional

Options when calling this method.

Specification
cancelCurrentStep Boolean

Cancels the current workflow when calling this method. Default value is false.

Returns
Type Description
Promise<void> Resolves when moved to the previous step within the active workflow.

removeHandles

Inherited
Method
removeHandles(groupKey)
Inherited from Accessor

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

reset

Inherited
Method
reset(){Promise<void>}
Inherited from Workflow

Resets the workflow.

Returns
Type Description
Promise<void> Resolves when the active workflow is reset.

setActiveFeature

Method
setActiveFeature(feature){Promise<void>}

Sets the specified feature as the active feature in the workflow. Setting a feature as active causes it to become highlighted and to be assigned to the form view model.

The feature must be one of the two features resulting from the split operation — i.e., the instance of {esri/Graphic} associated with either the existingFeatureEdits or newFeatureEdits property of the workflow's data.

Parameter
feature Graphic

The feature to set as active.

Returns
Type Description
Promise<void> A promise that resolves when the feature has been set as active.

start

Inherited
Method
start(){Promise<any>}
Inherited from Workflow

Starts the workflow.

Returns
Type Description
Promise<any> Resolves when the active workflow starts.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.