The read-only Workflow
class helps manage different stages of an editing workflow.
A workflow can be thought of as one of two types: CreateFeaturesWorkflow and UpdateWorkflow.
If adding an individual or multiple features, the CreateFeaturesWorkflow is used. This takes the place of the deprecated CreateWorkflow. Whereas if editing an existing feature, the UpdateWorkflow is used.
Updating workflows include both editing geometry and attribute data and deleting features.
An instance of either a CreateFeaturesWorkflow or UpdateWorkflow
is accessed via the activeWorkflow
property in either the Editor or EditorViewModel classes.
These workflows are only enabled if the feature service allows these operations. For example, if a feature service is only enabled to allow updates, it is not possible to override this using the API.
Starting with version 4.23, CreateWorkflow is deprecated in favor of using CreateFeaturesWorkflow.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
CreateWorkflowData|CreateFeaturesWorkflowData|UpdateWorkflowData | The shared workflow data. more details | Workflow | |
String | The name of the class. more details | Accessor | |
Boolean | This property indicates whether there is a next step in the workflow. more details | Workflow | |
Boolean | This property indicates if there is a previous step in the workflow. more details | Workflow | |
Boolean | Indicates whether the workflow is considered active. more details | Workflow | |
String | The name of the current step in the workflow. more details | Workflow | |
String | Value indicating the workflow type. more details | Workflow |
Property Details
-
The shared workflow data. This can be either CreateFeaturesWorkflowData (use this in place of the deprecated CreateWorkflowData) or UpdateWorkflowData.
-
The name of the class. The declared class name is formatted as
esri.folder.className
.
-
hasNextStep Booleanreadonly
-
This property indicates whether there is a next step in the workflow.
-
hasPreviousStep Booleanreadonly
-
This property indicates if there is a previous step in the workflow.
-
started Booleanreadonly
-
Indicates whether the workflow is considered active.
- Default Value:false
-
stepId Stringreadonly
-
The name of the current step in the workflow.
-
type Stringreadonly
-
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
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. more details | Accessor | ||
Promise<void> | Cancels the active workflow. more details | Workflow | |
Promise<void> | Call this method when the workflow is considered finished. more details | Workflow | |
Boolean | Returns true if a named group of handles exist. more details | Accessor | |
Promise<void> | Moves to the next step in the workflow. more details | Workflow | |
Promise<void> | Moves to the previous step in the workflow. more details | Workflow | |
Removes a group of handles owned by the object. more details | Accessor | ||
Promise<void> | Resets the workflow. more details | Workflow | |
Promise<void> | Starts the workflow. more details | Workflow |
Method Details
-
addHandles(handleOrHandles, groupKey)inheritedSince: ArcGIS Maps SDK for JavaScript 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();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey 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(options){Promise<void>}
-
Cancels the active workflow.
ParametersSpecificationoptions ObjectoptionalAn object with the following properties.
Specificationerror ErroroptionalThe returned Error object.
force BooleanoptionalIndicates whether to force cancel the active workflow.
notify BooleanoptionalIndicates whether to display a prompt indicating canceling the active workflow.
ReturnsType Description Promise<void> Resolves when the active workflow is canceled.
-
commit(){Promise<void>}Since: ArcGIS Maps SDK for JavaScript 4.15
-
Call this method when the workflow is considered finished. This is used to help process the editing results.
ReturnsType Description Promise<void> Resolves when the active workflow commits and processes the edited results.
-
Since: ArcGIS Maps SDK for JavaScript 4.25
-
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType 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(){Promise<void>}
-
Moves to the next step in the workflow.
ReturnsType Description Promise<void> Resolves when moved to the next step within the active workflow.
-
previous(options){Promise<void>}
-
Moves to the previous step in the workflow.
Parametersoptions ObjectoptionalOptions when calling this method.
SpecificationcancelCurrentStep BooleanCancels the current workflow when calling this method. Default value is
false
.ReturnsType Description Promise<void> Resolves when moved to the previous step within the active workflow.
-
removeHandles(groupKey)inheritedSince: ArcGIS Maps SDK for JavaScript 4.25
-
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");