Add a Workflow to an App

Access to Geocortex Workflow is included with the Geocortex Web software bundle. Workflows can be very powerful and enable you to extend the functionality of your GXW apps to include complex processes, including forms. For example, if you have specific information for an inspection, you can give field workers multiple options to select to save time and ensure consistent data. You could also include a guided interaction form with cascading combo boxes that limit options based on previous choices.

In the following water pump example, users can identify a pump by serial number or by the type of pump they can observe.

For detailed instructions on building workflows, see the Geocortex Workflow Help on the documentation center. In particular, the Activity Reference contains information about each Workflow Activity.

In Geocortex Web Designer, you can add workflows as menu items in various contexts. The menu context determines what type of information (if any) is passed as input to the workflow. For example, a menu item in the Results List passes the results as the input for a workflow. For more information about menu contexts, see Use the Menu Context as a Workflow Input.

There are a number of options to add workflows to an app:

Create a New Workflow for an App

The following procedure creates a new workflow, either from scratch or a built-in template, and adds it as a menu item to the I Want To menu.

The built-in workflow templates offer common GIS functions, such as performing a buffer identify operation. You can customize the workflow in Geocortex Workflow or use the functionality provided by the template as is.

The built-in templates available are dependent on the context of the menu, which determines the type of data (if any) that is passed as input to the workflow. For example, while the I Want To menu does not pass any type of information into the workflow, the Map Context menu passes the point where the user right-clicked the map into the workflow. For more information about menu contexts, see Use the Menu Context as a Workflow Input.

To create a new workflow for an app:

  1. In Web Designer, in the Components panel, click I want to..., and then click +Add Menu Item.

  2. In the Title of the menu item, type in a title for the menu item, for example, Run My Workflow.

    This title then appears as an option in the I Want To menu.

  3. Click Select Icon and choose an icon to display beside your menu option in the I Want To menu.

  4. In the Command box, start typing Create Workflow and select the command when it appears.

    The Create Workflow window appears.

  5. In the Select a Workflow Template menu, select a workflow template that provides the desired GIS functionality, or Blank Workflow if you want to create a workflow from scratch. The templates available depend on the context of the menu.

  6. In the Workflow Title box, type a title for the new workflow and click Create.

    A message appears about the workflow being successfully created.

  7. If you want to edit the workflow, click Open in Geocortex Workflow. For information about editing workflows, see Geocortex Workflow Help.

    You can edit the workflow later using the same link that appears below the code box.

  8. Click Close.

    A custom command to run the workflow appears in the code box.

    The workflow menu item appears in the I Want To menu.

  9. Click File | Save to save the app.

    If you want the workflow to be available to other users, see Share an ArcGIS Workflow Item with End Users.

Add an Existing Workflow to an App

The following procedure adds a menu item to the I Want To menu that runs an existing workflow created in Geocortex Workflow Designer.

For a list of component menus to which you can add menu items, see Component Menu Types and Contexts.

To add an existing workflow to an app:

  1. In Web Designer, in the Components panel, click I want to..., and then click +Add Menu Item.

  2. In the Title of the menu item, type in a title for the menu item, for example, Run My Workflow.

    This title then appears as an option in the I Want To menu.

  3. Click Select Icon and choose an icon to display beside your menu option in the I Want To menu.

  4. In the Command box, start typing Run Workflow and select the command when it appears.

    A list of selectable workflows appears.

  5. Click the workflow to run and click Select.

    A custom command to run the workflow appears in the code box.

    The workflow menu item appears in the I Want To menu.

  6. Click File | Save to save the app.

    If you want the workflow to be available to other users, see Share an ArcGIS Workflow Item with End Users.

Specify Workflow Input Values

You can manually specify values for one or more workflow inputs.

To specify workflow input values:

This procedure adds a menu item to the Results List menu that runs an existing workflow with custom input.

For a list of component menus to which you can add menu items, see Component Menu Types and Contexts.

  1. While editing an app in Web Designer, in the Components panel, click Results.

  2. Click +Add Menu Item.

  3. In the Title box of the menu item, type a title for the menu item, for example, Run My Workflow With Input.

    This title appears as an option in the Results List menu.

  4. Click Select Icon and choose an icon to display beside the menu option in the Results List menu.

  5. In the Command box, start typing Run Workflow and select the command when it appears.

    A list of selectable workflows appears.

  6. Click the workflow to run and click Select.

    A custom command to run the workflow appears in the code box.

  7. Set the inputs property to a key-value object, where the keys are the names of workflow inputs and the values are the values for those workflow inputs. For example, set MyStringWorkflowInput to a string and MyNumberWorkflowInput to a number. By default, this property is set to {}, which is an empty object.

    The type of the workflow input should match the type of the value specified.

    The inputs property is overridden by the commandArgumentInput property.

    The workflow menu item appears in the Results List menu.

  8. Click File | Save to save the app.

    If you want the workflow to be available to other users, see Share an ArcGIS Workflow Item with End Users.

Use the Menu Context as a Workflow Input

Some menus have a context in which they are used. You can pass the context of the menu as the value for a workflow input. For example, a menu item in the Results List passes the results as the input for a workflow.

The following table indicates the types of context of each kind of menu.

Component Menu Types and Contexts

Component Menu

Type

Context

I Want To menu

null

None

Toolbar

null

None

Map > Events > Map Initialized

null

None

Launch Link Workflows

null

None

Result Details *

Feature[]

An array of Feature objects representing the result in the Result Details panel.

Results List *

Feature[]

An array of Feature objects representing the results in the search results.

Results Table *

Feature[]

An array of Feature objects representing the results in the search results.

Map > (Specific layer) *

Feature[]

An array of Feature objects representing the results from the specified layer in the search results.

Map (Context Menu)

Geometry

The Esri Geometry object representing the point on the map where the user activates the context menu.

Layer List

Layer

A Layer object representing layer from which the menu was activated in the layer list.

* The Result Details, Results List and Results Table component menus all share the same menu items. The Map > (Specific layer) component menu also shares the same menu items for results from the specified layer.

To use the menu context as a workflow input:

This procedure adds a menu item to the Results List menu that runs an existing workflow with the results in the Results List as its input.

  1. While editing an app in Web Designer, in the Components panel, click Results List.

  2. Click +Add Menu Item.

  3. In the Title box of the menu item, type a title for the menu item, for example, Run My Workflow With Input.

    This title appears as an option in the Results List menu.

  4. Click Select Icon and choose an icon to display beside the menu option in the Results List menu.

  5. In the Command box, start typing Run Workflow and select the command when it appears.

    A list of selectable workflows appears.

  6. Click the workflow to run and click Select.

    A custom command to run the workflow appears in the code box.

  7. Set the commandArgumentInput property to the name of the workflow input you want to pass the menu's context to. For example, MyGraphicsWorkflowInput. By default, this property is set to context, which only works if that is the name of your workflow input.

    The type of the workflow input should match the type of the context of the component menu. For example, the workflow input type is an array of Esri Graphic objects which is the same type as the context of the Results List component menu. For a list of types and contexts, see Component Menu Types and Contexts.

    The commandArgumentInput property overrides the inputs property.

    The workflow menu item appears in the Results List menu.

  8. Click File | Save to save the app.

    If you want the workflow to be available to other users, see Share an ArcGIS Workflow Item with End Users.

© 2019 Latitude Geographics Group Ltd. All Rights Reserved.

Documentation Version 5.3