import CreateFeaturesWorkflow from "@arcgis/core/widgets/Editor/CreateFeaturesWorkflow.js";const CreateFeaturesWorkflow = await $arcgis.import("@arcgis/core/widgets/Editor/CreateFeaturesWorkflow.js");- Inheritance:
- CreateFeaturesWorkflow→
Workflow<CreateFeaturesWorkflowData‚ CreateFeaturesWorkflowStep>→ 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.

This workflow is only enabled if the feature service allows this operation.
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
| Property | Type | Class |
|---|---|---|
createFeatureState readonly | | |
data readonly | | |
declaredClass readonly inherited | ||
hasNextStep readonly inherited | ||
hasPreviousStep readonly inherited | ||
numPendingFeatures readonly | | |
pendingFeatures readonly | | |
started readonly inherited | ||
stepId readonly inherited | S | |
type readonly inherited | "add-association" | "create-features" | "merge-features" | "split-feature" | "update" | "update-feature" | "update-features" | "update-table-record" |
createFeatureState
- Type
- CreateFeatureState
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.
- Default value
- "create-new"
numPendingFeatures
- Type
- number
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
- Type
- ReadonlyCollection<Graphic>
Returns a collection of graphics representing features that are currently pending in the CreateFeaturesWorkflowData.
- See also
stepId
- Type
- S
The name of the current step in the workflow.
type
- Type
- "add-association" | "create-features" | "merge-features" | "split-feature" | "update" | "update-feature" | "update-features" | "update-table-record"
Value indicating the workflow type.
| Possible Value | Description |
|---|---|
| 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.
Methods
| Method | Signature | Class |
|---|---|---|
cancel inherited | cancel(options?: CancelWorkflowOptions): Promise<void> | |
commit inherited | commit(): Promise<void> | |
emit inherited | emit<Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean | |
hasEventListener inherited | hasEventListener<Type extends EventNames<this>>(type: Type): boolean | |
next inherited | next(): Promise<void> | |
on inherited | on<Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle | |
previous inherited | previous(options?: WorkflowPreviousOptions): Promise<void> | |
reset inherited | reset(): Promise<void> | |
start inherited | start(): Promise<any> | |
updatePendingFeature(feature: Graphic): Promise<void> | |
cancel
- Signature
-
cancel (options?: CancelWorkflowOptions): Promise<void>
Cancels the active workflow.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| options | An object with the following properties. | |
emit
- Signature
-
emit <Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
- Type parameters
- <Type extends EventNames<this>>
Emits an event on the instance. This method should only be used when creating subclasses of this class.
hasEventListener
- Signature
-
hasEventListener <Type extends EventNames<this>>(type: Type): boolean
- Type parameters
- <Type extends EventNames<this>>
Indicates whether there is an event listener on the instance that matches the provided event name.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| type | Type | The name of the event. | |
- Returns
- boolean
Returns true if the class supports the input event.
on
- Signature
-
on <Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
- Type parameters
- <Type extends EventNames<this>>
Registers an event handler on the instance. Call this method to hook an event with a listener.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| type | Type | An event or an array of events to listen for. | |
| listener | EventedCallback<this["@eventTypes"][Type]> | The function to call when the event fires. | |
- Returns
- ResourceHandle
Returns an event handler with a
remove()method that should be called to stop listening for the event(s).Property Type Description remove Function When called, removes the listener from the event.
Example
view.on("click", function(event){ // event is the event handle returned after the event fires. console.log(event.mapPoint);}); previous
- Signature
-
previous (options?: WorkflowPreviousOptions): Promise<void>
Moves to the previous step in the workflow.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| options | Options when calling this method. | |