Follow the instructions in the Web Applications SDK page to set up your development environment.
A working knowledge of TypeScript is recommended before extending Workflow for web-based hosts.
Follow the instructions in Implement a Custom Activity to create a custom workflow activity. You can then import ArcGIS API types with a
Example: Custom Activity for Expanding a Polygon
- Geocortex Web - 4.x ArcGIS API
- Geocortex Viewer for HTML5 - 3.x ArcGIS API
- Web AppBuilder for ArcGIS - 3.x ArcGIS API for 2D View, 4.x ArcGIS API for scene view.
If you decide to use the API, you should ensure you are using the right version for your application.
Change the API Version used by the Activity SDK
The ArcGIS API version for the activity SDK can be changed by updating the
@types/arcgis-js-api version in the
package.json file and then running
npm install again.
For example, a
package.json file in an activity SDK that uses the 4.x ArcGIS API might look like this;
Build Activities to work with both ArcGIS API Versions
You can structure your activity to be compatible with differences between versions by using the
esri/kernel module to determine the API version that the activity is running in.
Example: ExpandPolygon Custom Activity that is 4.x and 3.x ArcGIS API Compatible
This example builds on the ExpandPolygon activity to make it work with both the 3.x and 4.x versions of the ArcGIS API. The
execute method of the activity checks the ArcGIS API version and executes the appropriate code for the given API.
any for the other API version types when necessary to override TypeScript errors.
In this example, the way the Extent of a polygon is retrieved is the difference between the APIs. In 4.x,
extent is a property, while in 3.x extent is retrieved using the
getExtent() method. The APIs converge after this, with both supporting the