Skip to main content

Workflow Activity Reference

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.

src/activities/CustomActivity.ts
import type { IActivityHandler } from "@geocortex/workflow/runtime/IActivityHandler";
/** An interface that defines the inputs of the activity. */export interface CustomActivityInputs {    /**     * @description The first input to the activity.     * @required     */    input1?: string;
    /**     * @description The second input to the activity.     */    input2?: number;}
/** An interface that defines the outputs of the activity. */export interface CustomActivityOutputs {    /**     * @description The result of the activity.     */    result: string;}
/** * @category Custom Activities * @description A description of the activity. */export class CustomActivity implements IActivityHandler {    /** Perform the execution logic of the activity. */    async execute(        inputs: CustomActivityInputs    ): Promise<CustomActivityOutputs> {        return { result: "test" };    }}

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.

import { AppActivity } from "@geocortex/workflow/runtime/app/AppActivity";
/** * @supportedApps GWV * @category Custom Activities * @description An activity which adds a graphics layer to a map. */export class CustomAppActivity extends AppActivity {    /** Perform the execution logic of the activity. */    async execute(inputs: object): Promise<void> {        // This function has access to the this.map, this.app, and this.widget properties.        // ...    }}

For a complete example, check out the Add Layer to Map custom activity tutorial.