CreateFeaturesWorkflow

AMD: require(["esri/widgets/Editor/CreateFeaturesWorkflow"], (CreateFeaturesWorkflow) => { /* code goes here */ });
ESM: import CreateFeaturesWorkflow from "@arcgis/core/widgets/Editor/CreateFeaturesWorkflow.js";
Class: esri/widgets/Editor/CreateFeaturesWorkflow
Inheritance: CreateFeaturesWorkflow Workflow Accessor
Since: ArcGIS Maps SDK for JavaScript 4.23

A read-only class containing the logic used when creating features using the Editor widget. This workflow provides continuous creation of multiple features of the same type at once. After the initial sketch is created, the attribute form will display with the set field elements. These fields can be updated as the user creates new features. This workflow is designed for both individual and multiple feature creation.

create-feature

This workflow is only enabled if the feature service allows this operation.

See also

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
String

Indicates the current feature state during creation.

CreateFeaturesWorkflow
CreateFeaturesWorkflowData|UpdateWorkflowData

The shared workflow data.

Workflow
String

The name of the class.

Accessor
Boolean

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

Workflow
Boolean

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

Workflow
Number

Returns the number of pending features of an active CreateFeaturesWorkflow.

CreateFeaturesWorkflow
Collection<GraphicsLayer>

Returns a collection of graphics representing features that are currently pending in the CreateFeaturesWorkflowData.

CreateFeaturesWorkflow
Boolean

Indicates whether the workflow is considered active.

Workflow
String

The name of the current step in the workflow.

Workflow
String

Value indicating the workflow type.

Workflow

Property Details

createFeatureState

Property
createFeatureState Stringreadonly

Indicates the current feature state during creation. This state is either 1) while creating a new feature, or 2) updating a pending feature while in the "creating-features" step.

Possible Values:"create-new"|"update-pending"

Default Value:"create-new"

data

Inherited
Property
data CreateFeaturesWorkflowData|UpdateWorkflowDatareadonly
Inherited from Workflow

The shared workflow data. This can be either CreateFeaturesWorkflowData or UpdateWorkflowData.

declaredClass

Inherited
Property
declaredClass Stringreadonly
Inherited from Accessor

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

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.

numPendingFeatures

Property
numPendingFeatures Numberreadonly

Returns the number of pending features of an active CreateFeaturesWorkflow. Returns 0 (zero) if no workflow is active or the workflow type is not matching.

See also

pendingFeatures

Property
pendingFeatures Collection<GraphicsLayer>readonly

Returns a collection of graphics representing features that are currently pending in the CreateFeaturesWorkflowData.

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

Inherited
Property
type Stringreadonly
Inherited from Workflow

Value indicating the workflow type.

Possible Value Description
create This allows the end user to create a new individual feature in the feature service. (deprecated as of 4.23, use create-features as noted below.)
create-features This allows the end user to create either individual or continuous features in the feature service. (Since 4.23)
update This allows the end user to update and/or delete features in the feature service.

These workflows are only enabled if the feature service allows these operations.

Possible Values:"create"|"create-features"|"update"

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
Boolean

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<any>

Starts the workflow.

Workflow
Promise<void>

Moves the pending feature into update mode.

CreateFeaturesWorkflow

Method Details

addHandles

Inherited
Method
addHandles(handleOrHandles, groupKey)
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, addHandles added at 4.25.

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.

notify 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
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, hasHandles added at 4.25.

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
Since: ArcGIS Maps SDK for JavaScript 4.25 Accessor since 4.0, removeHandles added at 4.25.

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.

start

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

Starts the workflow.

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

updatePendingFeature

Method
updatePendingFeature(feature){Promise<void>}

Moves the pending feature into update mode.

Parameter
feature Graphic

The pending feature to be updated.

Returns
Type Description
Promise<void> Resolves when successfully moves the pending feature into update mode.

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