End-to-End Tutorial

This tutorial presents an end-to-end procedure for creating a production workflow and making it available to end users. When you are finished, you will be able to run the workflow in a Web AppBuilder for ArcGIS app or a Geocortex Viewer for HTML5 viewer.

If you have never created and run a Geocortex workflow before, you may want to start with the quick steps given in the Get Started section. The tutorial in the Get Started section creates a workflow that displays a message and runs the workflow in the Sandbox, Workflow Designer's test environment.

Before you Begin

To create and use a workflow, you need:

See also...


Main Steps to Create and Use a Workflow

The main steps to create and use a workflow are:

  1. Create a new workflow.
  2. Configure the workflow's deployment settings.
  3. Build the workflow.
  4. Run the workflow in the Sandbox.
  5. Save the workflow.
  6. Share the workflow.
  7. Configure a host application:

  8. Run the workflow in the host application:

Tutorial - Create a Workflow

Step 1: Create a New Workflow

  1. Launch Geocortex Workflow Designer and sign in if you are prompted.

    If you are using Geocortex Workflow in the cloud, you can access Workflow Designer here. If you are using on-premises Geocortex Workflow, use your organization's deployment of Workflow Designer.

  2. Create a new, blank workflow.

    There are several ways to create a new workflow:

    • When you open Workflow Designer, a new, blank workflow is already open for you.

    • In the sidebar, click File | New. To create a blank workflow, select Blank Workflow and click Open, or double-click Blank Workflow. Alternatively, you can base your workflow on a template by opening the template that you want to use.

    • You can create a new, blank workflow at any time by creating a new tab in Workflow Designer.

Step 2: Configure the Workflow's Deployment Settings

Configuring a workflow's deployment settings (Info | Deployment) filters the Toolbox to show only those activities that work in your environment. This prevents you from accidentally using an inappropriate activity.

This step is optional. If you do not configure a workflow's deployment settings, the Toolbox gives you access to all the activities. In this tutorial, you can use the default deployment settings.

See also...

Configure Deployment Settings

Step 3: Build the Workflow

This step shows you how to build a simple workflow that queries ArcGIS Server and displays the attributes of the returned features using an Item Picker form element.

When you build a workflow, there are certain things you can do to make the workflow easier to understand and maintain:

  1. Find the Display Form activity in the Toolbox.

    An easy way to find a particular activity is to type part of the activity's name in the Filter box at the top of the Toolbox. The Toolbox will show only those activities that match what you type.

  2. Drag the Display Form activity to the design surface and drop it on the Start block.

    Dropping an activity on the last item in the workflow automatically positions and connects the activity. In this case, the Start block is the last item in the workflow. You can also connect and disconnect flowchart items manually by hovering over the first item and dragging one of the arrows to the second item.

    The Display Form activity's properties show at the right. These properties apply to the form as a whole. To configure the contents of the form, you will edit the activity.

  3. Double-click the Display Form activity.

    The form opens for editing. In this view, the Toolbox shows the building blocks of forms, form elements, instead of activities. Initially, the form has a header and footer. You will add elements from the Toolbox to the preview area to include in the form.

  4. Find the Item Picker element in the Toolbox and drag it to the position indicated in the form preview, between Form Title and the Submit and Cancel buttons.

    The Item Picker element is used to display a list of items to the user. In this case, the Item Picker will display features returned by an ArcGIS Server query.

  5. In the Item Picker's properties, set Selection Mode to None.

    The Item Picker element optionally allows the user to select one or more items. In this case, we do not want the user to be able to select items.

  6. In the Items area of the Properties panel, click ArcGIS Query.

    The ArcGIS Query subworkflow opens. The ArcGIS Query subworkflow is part of the Display Form activity, as indicated by the breadcrumbs (shown at in the screen capture below).

    Form elements can have subworkflows of different types. The ArcGIS Query subworkflow is a populate subworkflow. Populate subworkflows create the items that will populate the form element, in this case, the items that the Item Picker will display. When the Display Form activity runs, it loads the form and then runs the subworkflow to populate the Item Picker.

    The default ArcGIS Query subworkflow () is a fully functional subworkflow that gets US states from an ArcGIS map service. The query returns two attributes: the state's name and population. It does not return the geometry. Normally you would adapt the ArcGIS Query subworkflow to your needs, but this is not necessary in the context of this tutorial. You will adapt the subworkflow to get states in a particular region. As well, you will get additional attributes and you will format how the attributes are displayed.

See also...

About Forms

Item Picker Form Element

Header Form Element

Footer Button Bar

Step 4: Run the Workflow in the Sandbox

Test the workflow by running it in the Sandbox, Workflow Designer's built-in test environment. You can choose the environment to use to run the workflow. In this tutorial, you will use the default map, a 2D map based on version 3.x of the ArcGIS API for JavaScript.

The Sandbox will remember your selection for the next time you run a workflow.

You can use verbose logging to see what is happening at each step in the running workflow. You do not need to turn verbose logging on—verbose logging is always turned on in the Sandbox.

  1. In the sidebar, click Info | Run in Sandbox.

  2. Click Run Workflow.

    The workflow opens the form and displays the US state names in the item picker.

  3. To see the verbose log for this workflow, press F12 and view the console.

    Verbose log, shown in the Chrome console

    Log entries are usually in pairs. An entry with an arrow (-->) at the beginning indicates that the activity is about to run. An entry with an arrow after the name or ID indicates that the activity has finished running (possibly temporarily while a subworkflow runs).

    To explore the log, click objects to expand their log entries. Continue to click items to see deeper levels of detail. For example, in the first line of the log, click Object | inputs | form to show the elements property. The elements property shows that the Display Form activity has three form elements: the header, an item picker, and the footer.

    Ignore log entries labelled __proto__. They are not useful to workflow authors.

See also...

Use the Console to Debug Workflows

Example 2 - Verbose Log for a Query Layer Activity

Example 3 - Verbose Log for a Display Form Activity

Step 5: Save the Workflow

Workflows are saved as ArcGIS items. The workflows you have authored appear on your Content page. You can open a workflow's item in ArcGIS by clicking Info | View in Workflow Designer.

  1. Save the workflow: click File | Save or File | Save As, or press Ctrl+S.

  2. Enter a title for the workflow.

  3. Click OK.

Step 6: Share the Workflow

To share the workflow, use the Share function in ArcGIS. When you first save a workflow, only you have access to the workflow. You can share workflows with groups that you belong to, with your entire organization, or with everyone (including the public). In this tutorial, for simplicity, you will share the workflow with everyone.

Normally we do not recommend sharing workflows with everyone unless the application is public and you want to allow everyone to run the workflow.

  1. In the sidebar, click Info | View.

    This signs you in to your ArcGIS account and opens the workflow item.

  2. Click Share.

  3. Select the Everyone (public) checkbox.

  4. Click OK.

See also...

Share Workflows

Step 7: Configure a Host Application

Geocortex workflows can be run from any of the supported types of host applications. For information on configuring a Geocortex Web or Geocortex Mobile app to host and run workflows, see Host and Run Workflows in Geocortex Web or Host and Run Workflows in Geocortex Mobile. Otherwise, follow the instructions for the type of host application that you use:

Configure a Web AppBuilder App

Geocortex provides custom Web AppBuilder widgets that run Geocortex workflows in Web AppBuilder apps. In this step, you will create a new 2D app, add a Workflow widget to the app, and configure the widget to run your workflow.

  1. In Web AppBuilder, create a new 2D app. Use the default theme.

  2. Add the widget called Workflow. This widget runs a workflow in the side panel of a 2D app.

    To add the widget, open the Widget panel, click Set the widgets in this controller, and then click the icon to add widgets . Select the widget and click OK.

    Workflow widget

  3. Click Choose Workflow.

  4. Locate your workflow.

  5. Select the workflow and click OK.

  6. Click OK.

  7. Save the app.

    You can now run the workflow in the host app.

See also...

Host and Run Workflows in Web AppBuilder for ArcGIS

Configure a Geocortex Viewer for HTML5 Viewer

To configure a Geocortex HTML5 viewer to run a workflow, you add a menu item, toolbar button, or hyperlink that runs the workflow using an HTML5 Viewer command. You may also have to enable Geocortex Workflow, if it is not already enabled.

The following steps show you how to configure an I Want To menu item that runs the workflow.

Step 1: Add an I Want To Menu item

  1. Edit the viewer in Geocortex Essentials Manager.

  2. Click I Want To Menu in the side panel.

  3. Add a new menu item.

  4. In the Text box, type the menu item's text.

  5. In the Command box, type RunWorkflowByUrl.

  6. In the Command Parameter box, type or paste the workflow's URL.

    You can get the URL from Geocortex Workflow Designer or from ArcGIS:

    • Geocortex Workflow Designer: In Geocortex Workflow Designer, open the workflow, click Info in the sidebar, and copy the URL from the URL box.

      If there is no URL box in the Info panel, save the workflow. A workflow does not have a URL until it has been saved.

    • ArcGIS: In ArcGIS, go to your Content page and click the workflow to open its details. Copy the URL from your browser's address bar.

  7. Click OK.

  8. Click Apply Changes.

  9. Click Save Site.

Step 2: Enable Geocortex Workflow

Viewers created in Geocortex Viewer for HTML52.9 or newer have Geocortex Workflow enabled by default.

  1. Click Workflow 5 in Manager's side panel.

  2. If it is not already selected, select the Enabled checkbox, click Apply Changes, and click Save Site.

See also...

Host and Run Workflows in the Geocortex Viewer for HTML5

Step 8: Run the Workflow in the Host Application

Test your workflow by running it in the host application with verbose logging turned on. To use verbose logging with a host application, you must turn it on.

Follow the instructions to run the workflow in the host application:

If you get a permissions error when you run the workflow, make sure you have shared the workflow with Everyone (public) in ArcGIS, as described in Step 6: Share the Workflow.

Run the Workflow in the Web AppBuilder App

  1. In Web AppBuilder, edit the app that hosts the workflow.

  2. Press F12 to open the browser console.

  3. If you use Chrome or Firefox, set the console's log level:

    • Chrome: Make sure the Verbose level is selected.

    • Firefox: In the Filter bar, make sure the Debug filter is selected.

    In Edge, verbose logging appears in the console no matter which log levels you choose.

  4. Click the widget in the Web AppBuilder editor to run the workflow.

    If you run the workflow by clicking the Launch or Preview link in the editor, verbose logging will not appear in the console. To show verbose logging, you must run the workflow by clicking the widget within the Web AppBuilder editor.

    The workflow runs and verbose log information appears in the console.

    Workflow previewed in Web AppBuilder

  5. Click Submit to allow the workflow to complete.

See also...

Use the Console to Debug Workflows

Run the Workflow in the Geocortex HTML5 Viewer

  1. Launch the viewer in your browser.

    If you use the Geocortex Mobile App Framework, you can also launch the viewer on your mobile device and run the workflow when there is no network connectivity.

  2. In the address bar, add the dev=true URL parameter to the viewer's URL.

    For example: http://host.domain.com/Html5Viewer/index.html?viewer=myviewer.gvh&dev=true

    The dev=true URL parameter turns on verbose logging.

  3. Press Enter.

  4. Press F12 to open the browser console.

  5. If you use Chrome or Firefox, set the console's log level:

    • Chrome: Make sure the Verbose level is selected.

    • Firefox: In the Filter bar, make sure the Debug filter is selected.

    In Edge, verbose logging appears in the console no matter which log levels you choose.

  6. Select the I Want To menu item to run the workflow.

    The workflow runs and verbose log information appears in the console.

    Workflow running in the Geocortex Viewer for HTML5

  7. Click Submit to allow the workflow to complete.

See also...

Use the Console to Debug Workflows