Skip to content
import CreateFeaturesWorkflow from "@arcgis/core/widgets/Editor/CreateFeaturesWorkflow.js";
Inheritance:
CreateFeaturesWorkflowWorkflow<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.

create-feature

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

See also

Constructors

Constructor

Constructor
Parameters
ParameterTypeDescriptionRequired
properties
See the properties table for a list of all the properties that may be passed into the constructor.

Properties

Any properties can be set, retrieved or listened to. See the Watch for changes topic.
PropertyTypeClass
data
readonly
declaredClass
readonly inherited
hasNextStep
readonly inherited
hasPreviousStep
readonly inherited
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

readonly Property
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"

data

readonly Property
Type
CreateFeaturesWorkflowData
Since
ArcGIS Maps SDK for JavaScript 4.30

The shared workflow data.

declaredClass

readonlyinherited Property
Type
string
Inherited from: Accessor

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

hasNextStep

readonlyinherited Property
Type
boolean
Inherited from: Workflow

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

hasPreviousStep

readonlyinherited Property
Type
boolean
Inherited from: Workflow

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

numPendingFeatures

readonly Property
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

readonly Property
Type
ReadonlyCollection<Graphic>

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

See also

started

readonlyinherited Property
Type
boolean
Inherited from: Workflow

Indicates whether the workflow is considered active.

Default value
false

stepId

readonlyinherited Property
Type
S
Inherited from: Workflow

The name of the current step in the workflow.

type

readonlyinherited Property
Type
"add-association" | "create-features" | "merge-features" | "split-feature" | "update" | "update-feature" | "update-features" | "update-table-record"
Inherited from: Workflow

Value indicating the workflow type.

Possible ValueDescription
create-featuresThis allows the end user to create either individual or continuous features in the feature service. (Since 4.23)
updateThis 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

MethodSignatureClass
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

inherited Method
Signature
cancel (options?: CancelWorkflowOptions): Promise<void>
Inherited from: Workflow

Cancels the active workflow.

Parameters
ParameterTypeDescriptionRequired
options

An object with the following properties.

Returns
Promise<void>

Resolves when the active workflow is canceled.

commit

inherited Method
Signature
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
Promise<void>

Resolves when the active workflow commits and processes the edited results.

emit

inherited Method
Signature
emit <Type extends EventNames<this>>(type: Type, event?: this["@eventTypes"][Type]): boolean
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Emits an event on the instance. This method should only be used when creating subclasses of this class.

Parameters
ParameterTypeDescriptionRequired
type
Type

The name of the event.

event
this["@eventTypes"][Type]

The event payload.

Returns
boolean

true if a listener was notified

hasEventListener

inherited Method
Signature
hasEventListener <Type extends EventNames<this>>(type: Type): boolean
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Indicates whether there is an event listener on the instance that matches the provided event name.

Parameters
ParameterTypeDescriptionRequired
type
Type

The name of the event.

Returns
boolean

Returns true if the class supports the input event.

next

inherited Method
Signature
next (): Promise<void>
Inherited from: Workflow

Moves to the next step in the workflow.

Returns
Promise<void>

Resolves when moved to the next step within the active workflow.

on

inherited Method
Signature
on <Type extends EventNames<this>>(type: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle
Type parameters
<Type extends EventNames<this>>
Inherited from: EventedMixin

Registers an event handler on the instance. Call this method to hook an event with a listener.

Parameters
ParameterTypeDescriptionRequired
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).

PropertyTypeDescription
removeFunctionWhen 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

inherited Method
Signature
previous (options?: WorkflowPreviousOptions): Promise<void>
Inherited from: Workflow

Moves to the previous step in the workflow.

Parameters
ParameterTypeDescriptionRequired
options

Options when calling this method.

Returns
Promise<void>

Resolves when moved to the previous step within the active workflow.

reset

inherited Method
Signature
reset (): Promise<void>
Inherited from: Workflow

Resets the workflow.

Returns
Promise<void>

Resolves when the active workflow is reset.

start

inherited Method
Signature
start (): Promise<any>
Inherited from: Workflow

Starts the workflow.

Returns
Promise<any>

Resolves when the active workflow starts.

updatePendingFeature

Method
Signature
updatePendingFeature (feature: Graphic): Promise<void>

Moves the pending feature into update mode.

Parameters
ParameterTypeDescriptionRequired
feature

The pending feature to be updated.

Returns
Promise<void>

Resolves when successfully moves the pending feature into update mode.