Workflow Activity Reference
In the Geocortex Workflow TypeScript SDK, activities are represented as simple classes with an execute
method.
Registering Activities
The recommended method of creating and registering a new activity is through the npm run activity
script.
- The script will perform the following operations:
- Create a new activity
.ts
file with the provided name in thesrc/activities
folder. - Populate the activity
.ts
file from an activity template. - Register the activity in
src/index.ts
.
- Create a new activity
tip
It's convention to use PascalCase for activity names. You can add many activities to the same project.
Inputs and Outputs
The execute
method of an activity class has typed inputs and outputs. These inputs and outputs are decorated with block tags to provide display hints in Geocortex Workflow Designer.
App Activities
The Geocortex Workflow TypeScript SDK has a concept of an AppActivity
, which is an activity that needs access to its host.
Activities that extend the AppActivity
gain access to the map
, app
, or widget
properties.
note
Depending on the type of host application, different resources will be available. For example, Web AppBuilder for ArcGIS is the only platform which has access to the widget
property.
For a complete example, check out the Add Layer to Map custom activity tutorial.