Geocortex Workflow Tutorial Create the Search Schools Workflow

Similar documents
User Guide. Geocortex Workflow Designer 3.7

Using ArcScan for ArcGIS

ArcScan for ArcGIS Tutorial

How to Set Workspace Environments for Project Work

ArcGIS 9. Using ArcReader

Geocortex Essentials 4.5. Installation Guide

Using ArcGIS. Tracking Analyst. GIS by ESRI

ArcGIS 9. Using ArcGIS Tracking Analyst

ArcGIS 9. ArcGIS Tracking Analyst Tutorial

ArcGIS 9. Maplex Tutorial

COGNOS (R) ENTERPRISE BI SERIES COGNOS REPORTNET (TM)

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

WORKFLOW BUILDER TM FOR MICROSOFT ACCESS

2 The Stata user interface

NiceForm User Guide. English Edition. Rev Euro Plus d.o.o. & Niceware International LLC All rights reserved.

PUREEDGE VIEWER User s Manual v6.5

Press the Plus + key to zoom in. Press the Minus - key to zoom out. Scroll the mouse wheel away from you to zoom in; towards you to zoom out.

Forms iq Designer Training

HYPERION SYSTEM 9 BI+ ANALYTIC SERVICES RELEASE 9.2 ANALYTIC SQL INTERFACE GUIDE

Adobe Dreamweaver CS5 Tutorial

SmartView. User Guide - Analysis. Version 2.0

Setting up a 3D Environment for the City of Portland

BC Spatial Member Map Viewer. Version 2.0. User Guide. May 2015

Océ Engineering Exec. Advanced Import and Index

Creating Python Scripts for ArcGIS STUDENT EDITION

SPARK. User Manual Ver ITLAQ Technologies

ICDL & OOo BASE. Module Five. Databases

BMC Remedy Action Request System Using a BIRT Editor to Create or Modify Web Reports

SAS Business Rules Manager 1.2

No Programming Required Create web apps rapidly with Web AppBuilder for ArcGIS

Introducing ArcScan for ArcGIS

Oracle Utilities Work and Asset Management

Visual Workflow Implementation Guide

What Is the ArcIMS Tracking Server?

Using Custom Business Analyst Data Source Layers in ESRI Business Analyst Server

SUM - This says to add together cells F28 through F35. Notice that it will show your result is

Sample A2J Guided Interview & HotDocs Template Exercise

OrgPublisher Photos, Logos, and Legends

Quick Start Guide. ARIS Architect. Version 9.8 Service Release 2

Lexis for Microsoft Office User Guide

Exercise 1: Introduction to MapInfo

Create Your First Print-Quality Reports

Enterprise Portal Train the Trainer User Manual WEB PARTS

FrontBase An Omnis Studio Application

CA CloudMinder. Identity Management User Console Design Guide 1.51

SAS Web Report Studio 3.1

Title Page. Working with Task Workflows

Select Objects for Use

SAS Business Rules Manager 2.1

DataMaster for Windows

AvePoint Permissions Manager

Sage Construction Central Setup Guide (Version 18.1)

ORACLE USER PRODUCTIVITY KIT USAGE TRACKING ADMINISTRATION & REPORTING RELEASE SERVICE PACK 1 PART NO. E

Quick Start Guide. ARIS Architect. Version 9.7

Arena: Edit Existing Reports

BEA WebLogic. Integration. Best Practices in Designing BPM Workflows

User Manual pdoc Signer

Security Explorer 9.1. User Guide

Advanced ARC Reporting

Part 2: Build your own Map Tour with ArcGIS Online

CA Output Management Web Viewer

Cisco TEO Adapter Guide for Microsoft Windows

SWITCHING FROM GRASSHOPPER TO VECTORWORKS

Scorecard Builder User Guide

How Do I: Find the Highest Elevation within an Area

Spatial Data Standards for Facilities, Infrastructure, and Environment (SDSFIE)

ArcGIS 9. ArcGIS Survey Analyst Tutorial

ArcGIS 9 Installation Guide: ArcSDE Developer Kit

Excel Select a template category in the Office.com Templates section. 5. Click the Download button.

GXL-Satellite Mosaic Generation. Training Guide

NVU Web Authoring System

ADOBE DREAMWEAVER CS4 BASICS

Exsys RuleBook Selector Tutorial. Copyright 2004 EXSYS Inc. All right reserved. Printed in the United States of America.

Microsoft Operations Manager

SAS Universal Viewer 1.3

PHPRad. PHPRad At a Glance. This tutorial will show you basic functionalities in PHPRad and

ARIS Architect QUICK START GUIDE. Version Service Release 7

Exporting ArcScene to 3D Web Scenes. Documents. An Esri White Paper November 2013

GIS DATA SUBMISSION USER GUIDE. Innovation and Networks Executive Agency

Adobe Dreamweaver CC 17 Tutorial

An Esri White Paper July 2010 Use GIS Data ReViewer to Inspect ArcFM Feeder Manager Circuits

Chapter 10 Linking Calc Data

Cisco TEO Adapter Guide for Microsoft System Center Operations Manager 2007

Oracle Fusion Middleware

User Guide Product Design Version 1.7

Explore some of the new functionality in ArcMap 10

Excel 2010: Getting Started with Excel

CHAPTER 4: MICROSOFT OFFICE: EXCEL 2010

Feature-based CAM software for mills, multi-tasking lathes and wire EDM. Getting Started

Amgraf s OneForm Designer Plus Creating I-Forms

Overview. CHAPTER 2 Using the SAS System and SAS/ ASSIST Software

GIS DATA SUBMISSION USER GUIDE. Innovation and Networks Executive Agency

InDesign Part II. Create a Library by selecting File, New, Library. Save the library with a unique file name.

ArcGIS Online (AGOL) Quick Start Guide Fall 2018

1 Siebel Attachments Solution Overview

Animation in ArcMap Tutorial

Libraries. Multi-Touch. Aero Peek. Sema Foundation 10 Classes 2 nd Exam Review ICT Department 5/22/ Lesson - 15

Roxen Content Provider

How to lay out a web page with CSS

Sage Estimating (SQL) v18.12

Transcription:

Geocortex Workflow Tutorial Create the Search Schools Workflow July-2011 www.geocortex.com/essentials Latitude Geographics Group Ltd. 200-1117 Wharf St, Victoria, BC V8W 1T7 Canada Tel: (250) 381-8130 Fax: (250) 381-8132 www.latitudegeo.com info@latitudegeo.com

Copyright 2011 Latitude Geographics Group Ltd. All Rights Reserved. Printed in Canada The information contained in this document is the exclusive property of Latitude Geographics Group Ltd. This work is protected under Canadian and US copyright law and copyright laws of the given countries of origin and applicable international laws, treaties, and/or conventions. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying or recording, or by any information storage or retrieval system, except as expressly permitted in writing by Latitude Geographics Group Ltd. All requests should be sent to Attention: Contracts Manager, Latitude Geographics Group Ltd, 200-1117 Wharf Street, Victoria, British Columbia V8W 1T7. This information is subject to change without notice. US Government Restricted Rights The Software and documentation are provided with restricted rights. Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer Software clause at DFARS 252.227-7013, or subparagraphs (c)(1) and (2) of the Commercial Computer Software - Restricted Rights at 48 CFR 52.227-19, as applicable. The Contractor/Manufacturer is Latitude Geographics Group Ltd., 200-1117 Wharf Street Victoria, British Columbia V8W 1T7. Latitude Geographics, Geocortex Internet Mapping, and the Product Name are trademarks of Latitude Geographics Group Ltd. Geocortex is a registered trademark of Latitude Geographics in Canada and the United States. Latitude Geographics is a registered trademark in Canada and the United States. Esri, ArcIMS and the Esri globe logo are trademarks of Environmental Systems Research Institute. Microsoft and the Windows logo are registered trademarks and the Microsoft Internet Explorer logo is a trademark of Microsoft Corporation. Other companies and products mentioned herein are trademarks or registered trademarks of their respective trademark owners.

Contents Create the Search Schools Workflow Tutorial 1 Search Schools Workflow Functionality 1 Completed Workflow 1 Tutorial Overview 3 Add a Sequence and a Flowchart Activity 3 Add and Define a Form 4 Add the First Cascading ComboBox (Zip Codes) 6 Use a Query to Populate the Zip Drop-down List 8 Add the Second Cascading ComboBox (Schools) 12 Use a Query to Populate the Schools Drop-down List 13 Define the Outputs from the Form 15 Create a FlowDecision Activity with Conditions 19 Create the QueryTask 25 Check Results and Create a Feedback Loop 28 Option - Replace ComboBox2 with a ListBox 33 i

Create the Search Schools Workflow Tutorial Create the Search Schools Workflow Tutorial This tutorial walks you through the steps to create the SearchSchools.xaml workflow that is shipped with Geocortex Essentials. It explains each step, selection, expression, and parameter in the process of creating a typical workflow. The tutorial is for people who do not know the Workflow Designer, or who have limited experience with SQL and Visual Basic. It is intended to make it possible for a person with little or no programming experience to understand how to build a workflow. Search Schools Workflow Functionality The Search Schools workflow includes several commonly-used workflow activities such as DisplayForm, Flowchart, FlowDecision, QueryTask, Select Features, and an If activity with conditions. The completed workflow displays in the Viewer as a form with two cascading ComboBoxes and two buttons - Search and Cancel. To build the Search Schools workflow, you will create the form in the Form Designer that populates a drop-down list of zip codes for users to select. The workflow then populates a second drop-down list with the schools in the selected zip code or displays a message saying that no schools were found. The user can select one school and click Search, or click Search without making a selection to list all the schools. Users can also click Cancel to exit the workflow. Zip Code - ComboBox1: Displays a list of zip codes for the user to select. If they do not select a zip code, an error message asks them to select a zip code. School - ComboBox2: Takes the zip code selected and displays the schools in that zip code. The drop-down list is empty if there are no schools in the selected zip code. School drop-down list: Users can select one school or list all the schools if they do not select one. The workflow in the Viewer Search button: Searches for a single school if one is selected or all the schools if no selection is made. Cancel button: Closes the workflow without running it. Completed Workflow Because the workflow we are going to create is shipped with the Geocortex Essentials, you may want to open it and examine the file as we build the workflow. The default location for the sample.xaml workflow files is: C:\Program Files\Latitude Geographics\Geocortex Essentials\Default\REST Elements\Sample Sites\Resources\Workflows The file name is SearchSchool.xaml. There may be differences between the SearchSchool.xaml file on your system and the one we create in this tutorial, as the sample files are sometimes updated and improved. 1

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow The Search Schools workflow 2 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Tutorial Overview Tutorial Overview This tutorial is divided into the following sections, which need to be completed in this order: Add a Sequence and a Flowchart Activity Add and Define a Form Add the First Cascading ComboBox (Zip Codes) Use a Query to Populate the Zip Drop-down List Add the Second Cascading ComboBox (Schools) Use a Query to Populate the Schools Drop-down List Define the Outputs from the Form Create a FlowDecision Activity with Conditions Create the QueryTask Check Results and Create a Feedback Loop Option - Replace ComboBox2 with a ListBox Add a Sequence and a Flowchart Activity The first activity that we will add is a Sequence activity. Workflows are often contained within a default Sequence activity, which runs all the activities within it in sequential order. All the activities for a workflow must be dragged inside a Sequence activity when you are building it. Next, we will add a Flowchart activity, which represents actions and activities graphically as a flow diagram. This graphical presentation makes a workflow easier to interpret, edit, and maintain. It is also easier to create user decision points, which we need in our workflow. We could do this declaratively, but it is often much easier to do so using a Flowchart activity. To add Sequence and Flowchart activities: 1. In the Geocortex Workflow Designer, click File New. This creates a new workflow with a singe Sequence activity. Sequence activity when you start a new workflow 2. In the ActivityBuilder, from the Flowchart section of the Toolbox, drag a Flowchart activity inside the Sequence activity. 3

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow Drag Flowchart activity into the Sequence activity 3. Double-click the Flowchart activity to open it. All the remaining activities in our workflow will be added inside the Flowchart activity. Return to Tutorial Overview Add and Define a Form In this section, we add a Display Form activity and explain the DisplayForm and the Form Designer dialog. We also define the shell of the form that will collect user responses. To add a form to the Search Schools Workflow: 1. From the Common Client section of the Toolbox, drag a Display Form activity into the Flowchart activity. Drop the Display Form activity into the Flowchart activity 2. Drag a connector from a node on the Start to a node on the DisplayForm to connect them. The DisplayForm is now the first item in the Flowchart. Join the Start to the DisplayForm Once connected, you can move the objects in a flowchart around and the connecting lines will accommodate the move and remain connected. 4 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Add and Define a Form The DisplayForm activity contains a number of features that help you to create a form. The DisplayForm activity is the shell inside which you create a form. The Design Form button opens the Form Designer where you design and configure the form. The Form Preview displays the form as the user will see it. As you enter properties, the Form Preview updates to include them. DisplayForm activity The Buttons feature opens the Button Editor where you add buttons and define their properties and function. We do not plan to use an Input Geometry for this particular workflow, but it can be used to specify a spatial extent for a from to act on. For example, the user could draw a polygon to run a query configured to limit the values of an AutoComplete, ListBox, or ComboBox. 3. To open the Form Designer, click the Design Form button. The Form Designer is where you design and build forms to use in your workflow. The Add/Remove Form Items area is where you add and arrange items such as fields and controls to your form. As you add items, they appear in the Form tree. You can click the Move Up and Move Down buttons to change the order of the Form Items, or click Remove to delete them. The properties/parameters of a form element appear in this panel when you select the Form Item in the Form tree. The properties change depending on the type of Form Item selected. The Form Designer The Preview of the Form Item updates as you change any properties that will be visible on the final form, for example, the Label. 4. In the Form tree, select the root: Form. Notice that the properties that you can set for the Form appear in the right panel. These properties apply to the shell of the form. 5. In the Title field, type in the title for this form, which we will call Search Schools by Zip Code. As you type, the title appears in the form in the Preview to show you how the user will see it. 6. To set the overall size of your form, set the Max Width to 400 and the Max Height to 800 pixels. 7. To add instructional text to the form, click Group in the tree, and then in the Description box, type: Find one school, or all the schools, within a ZIP code. 5

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow 8. Use the Items Orientation field to align the controls vertically or horizontally. Leave it Vertical. 9. Use the Maximum Width field to set the size of the group in pixels. Leave it at Infinity. 10. Click OK to accept the changes and close the Form Designer. 11. To ensure that this form displays in the Results panel of the Viewer when the workflow is deployed, in the Properties panel, type "DataRegion" into the Region Name box. Use quotes as this is a string. Data Region specified in the Region Name The form is now ready to add other elements to it. In the next section, we add two ComboBoxes to the form. The first ComboBox will display zip codes for selection. The second ComboBox will display the list of schools based on the zip code selected in the first ComboBox. Return to Tutorial Overview Add the First Cascading ComboBox (Zip Codes) To add a cascading ComboBox to the form: 1. To open the Form Designer, click the Design Form button. 2. To add a ComboBox, click the Group1 icon and select ComboBox from the list. Add a ComboBox When you select the new ComboBox in the tree, its parameters and settings display on the right-hand side to be defined. 6 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Add the First Cascading ComboBox (Zip Codes) ComboBox1 selected When you add a ComboBox in the Form Designer and click OK, an associated Input Data section is added to the DisplayForm activity. Input Data sections are only added automatically for ComboBoxes and ListBoxes. 3. In the Argument Name box, type zip. The argument is used to pass data gathered by the form to the next part of the workflow. In this ComboBox, the argument will be the user's response; a selected zip code. By giving the argument a name, we can treat the user s response as output from the DisplayForm activity and assign it to a variable that can be used later in the workflow. When you add a value to the Argument Name field in the Form Designer and click OK, an Output Arguments section with a new field called zip is added to the Display Form. 7

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow Input Data and Output Arguments added to workflow 4. In the ToolTip box, type Select a Zip Code. This text will appear when the user hovers over the field in the Viewer. 5. In the Label box, type Zip Code. This field adds a name in front of the new field on the form, so include a colon. The label appears in the Preview as you type. 6. In the Default Text box, type Select Zip Code. This field allows you to add instructional text inside the field to tell the user what to do. As you type, the text appears inside the ComboBox in the Preview. Return to Tutorial Overview Use a Query to Populate the Zip Drop-down List We have created the first ComboBox but we need to populate its drop-down list with zip codes for the user to select. We could do this manually by clicking the Add/Remove Items button and typing in all the zip codes, but this would be time-consuming and error-prone. Instead, we will use a query to find the appropriate zip codes and populate the drop-down list. For the query to work, we have to define where it should find the data we want in the drop-down list. In our case, it will be the Geocortex sample site: Charlotte ArcGIS Online. The first information you need to define is the URL of the REST endpoint, as well as the exact layer and fields to search. To add zip codes to the drop-down list using a query: 1. To find the correct URL for the site and MapServer we plan to use, open Geocortex Essentials REST Manager and log in. Start menu to open REST Manager 8 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Use a Query to Populate the Zip Drop-down List 2. In the REST API Sites Directory URL list, click the Charlotte ArcGIS Online link. The Charlotte ArcGIS Online site opens. Charlotte ArcGIS Online site You can go directly to the site if you know the URL. Copy-and-paste the URL into your browser address and press Enter. In our case, the URL is: http://sampleserver1.geocortex.com/geocortex/essentials/rest/sites/charlottearcgisonline 3. In the Site, click Map. When the map page of site opens, it lists the Map servides and their layers that are available for this particular site, including the Zip Codes (6) layer, which is the one we want. At the moment, we are interested in the URL, as it tells us where to find the Esri MapServer that is hosting this layer. Map page of the Charlotte ArcGIS Online site 4. Select and copy the URL, paste it into the browser address, and press Enter. http://sampleserver1.geocortex.com/arcgis/rest/services/charlotteoperational/mapserver 9

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow The ArcGIS Directory opens to CharlotteOperational (MapServer). Esri MapServer - CharlotteOperational 5. To identify the map layer we plan to use for our query, click Zip Codes (6). We now have the full URL we need for our query, including the specific map service and layer. 6. Copy the new MapServer URL from the browser address bar, and then in the Geocortex Workflow Designer, paste the URL into the QueryTask Url box. http://sampleserver1.geocortex.com/arcgis/rest/services/charlotteoperational/mapserver/6 Because none of the fields in the Form use Visual Basic expressions, you do not use quotation marks in any of these fields. You should never try to get a list of distinct domain values by querying an operational layer. For example, trying to list parcel types by querying the parcel layer. Instead, you should query a layer or table containing unique values. 7. In the Query Where Clause, type 1=1, as we want to return all the zip codes. 1=1 means that the query will return everything. SQL syntax is used in this box, so any SQL syntax will work in this field. 10 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Use a Query to Populate the Zip Drop-down List The 1=1 syntax works if the number of records returned is less than 500. If a query is likely to return many more records than 500, then you should use syntax that limits the number of records. This is because by default, the ArcGIS server limits the number of records returned in order to improve performance. Although this number can be changed in the ArcGIS configuration file, changing it could adversely affect performance. 8. In the Query Display Field, type ZIP. On the Layer: Zip Codes page, if you scroll to the bottom of the page, there is a list of the fields available on this layer with a description of the type of data the field contains. In the case of the ZIP field, the data type is String. It is the data from this field that we want to use to populate our drop-down list in the form. Fields available on the Zip Codes layer If you would like to test a query before including it in a workflow, you can test it on the Layer page of the map service. At the bottom of the Layer: Zip Codes page is a Query link that opens a page where you can test your query. To test this query on the map layer: 1. In the Where box, type 1=1. 2. For the Return Geometry radio button, select False. 3. In Return Fields type in ZIP to obtain values from this field for the query. 4. Click the Query (GET) button. 5. Scroll down to see the zip codes listed. Test query in the Zip Codes layer 9. In the Query Value Field, type ZIP, as this is the name of the field name for the values that will be displayed in the ComboBox. 11

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow We are not using the Query Cascading ID or Filter By Geometry in this ComboBox. We will use a validator to be sure the user enters a zip code as this is important for the next part of the workflow. The validator checks the information that the user enters and if their response is incorrect, displays a message to request the correct information. 10. To add a Validator, click Add/Remove Validation. 11. When the Validation Items dialog box opens, click Add, and then select Required. Set validation for the query 12. In the Error Message box, type You must select a zip code, and then click OK twice. The message will be displayed if user does not select a zip code. Return to Tutorial Overview Add the Second Cascading ComboBox (Schools) The second ComboBox will take the zip code the user selected and display the list of schools that are within that zip code. We will use the same CharlotteOperational (Mapserver) but a different layer Schools. We will use a new query to populate the drop-down list of the ComboBox but this time, we will filter the query based on the zip code the user chose in ComboBox 1. To add the second ComboBox: 1. In the Form Designer, click the icon, and select ComboBox from the list. 2. The Argument Name that we will assign for the output of this ComboBox will be school. The argument name is how the school data will be passed to the next part of the workflow using a variable. To make this possible, as you add the new ComboBox and the Argument name, the Input and Output fields for their data are created in the DisplayForm. 12 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Use a Query to Populate the Schools Drop-down List The second ComboBox and Output Argument added to the DisplayForm 3. The Label (name) for this ComboBox will be Schools: and the Tooltip and Default Text will both be Select a school. Second ComboBox defined Return to Tutorial Overview Use a Query to Populate the Schools Drop-down List To define the query that will populate the drop-down list for the second ComboBox, we need to find the correct layer and URL for the schools. Our query will need to be more specific, as it has to find only those schools that match the zip code selected in the first ComboBox. Because we need to use zip codes to filter the schools, we need to ensure that there is a Field in the Schools layer that makes this possible. 13

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow The following fields are found in the Schools layer in the ArcGIS Server Services Directory: Fields available on the Schools layer There is a NAME field that we will use to display the names of the schools and a ZIP field that we will use to filter the schools by zip code. Both of these are the String data type, so they are suitable for display to the user. The SCHL field is a double a number likely an administrative school ID code, which would not be as useful, so we will not use it, but will use the OBJECTID instead. To add schools from a zip code to the drop-down list using a query: 1. To find the URL of the Schools layer that we need, return to the CharlotteOperational (MapServer). Under Layers and the Points of Interest group layer, is the Schools (2) layer. Schools (2) layer on CharlotteOperational MapServer 2. Click Schools, and then copy the URL from the browser address bar. 3. In the Form Designer, paste the URL into the QueryTask Url box in the ComboBox 2 parameters. http://sampleserver1.geocortex.com/arcgis/rest/services/charlotteoperational/mapserver/2 We now have the full URL we need for our schools query, including the specific map service and layer. Next we have to create the syntax of the query. 4. For the Query Where Clause, type ZIP = '{0}'. 14 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Define the Outputs from the Form The syntax indicates that the query should return all schools within the zip code that are inside the single quotation marks '{0}'. (Single quotation marks are used as this data type is a String, and Strings need quotes to indicate where they begin and end.) As we do not know what zip code the user will select, we insert {0}, as a placeholder, which will then be replaced by whatever the user selects in ComboBox1. Currently, though, the form does not know what data we want to go into the {0} placeholder. Therefore, we have to specify where the data must be taken from by specifying the value in the Query Cascading ID field. 5. In The Query Cascading ID box, type ComboBox1. Now, whatever zip code the user enters in ComboBox1 will replace {0}, for example, ZIP='28209'. We now need to specify what data about each school we want to display to the user. To find out what data is available on the layer, we return to the Schools layer of the CharlotteOperational (MapServer). The Fields on the Schools layer contain the following possibilities: Fields available on the Schools Layer 6. In the Query Display Field, type NAME. This specifies that the values from the NAME field will be displayed in the drop-down list. 7. In the Query Value Field, type OBJECTID. Using OBJECTID specifies that the query also searches based on the unique identifier of each school. This ensures that the search is both faster and more accurate. We will also use the OBJECTID later in the workflow to provide details about the school to the user. We will not use Validators for the schools data as we want the user to be able to select one school, or all the schools, in the zip code. 8. In the Form Designer, click OK to accept the parameters of the second ComboBox. 9. In the ActivityBuilder, click File Save to save the form. Return to Tutorial Overview Define the Outputs from the Form At the moment, there is no way for a user to submit their form entries (search), so we need to create a Search button on the form, define an argument/expression, and also a variable to pass the search value to the next part of the workflow. The data that the form collects (zip codes and schools), also has to be passed on to the next activities in the workflow. This is also done using arguments and variables. So we need to define the Output Arguments for zip and school, as well as to declare variables for these arguments that will hold the user's outputs. Then both outputs can be used by the other activities in the workflow. 15

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow To add the Search button: 1. In the DisplayForm, click Buttons. 2. When the Button Editor opens, click to create a new button. 3. In the Label box, type Search, and the preview of the button updates to show the new name of the button. 4. In the Value box, type Search as well. We are simply giving a name to the value that will be returned if the user clicks the Search button. 5. Select the Causes Validation checkbox as we do want the form entries to be validated when this button is clicked. New Search button defined in the Button Editor 6. Click OK to create the Search button. To declare a variable for the Button Result Value: To capture the value from the button in the form, we need to declare a variable that can store the result. 1. In the ActivityBuilder, click the Variables tab at the bottom of the panel. Variables tab 2. When the Variables panel opens, click on the Create Variable text and type btnresult into the Name box. Leave the Variable type as String. Variable for the form button 16 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Define the Outputs from the Form The Scope of the variable is currently Flowchart. This means that the variable will apply only within the Flowchart activity. If we wanted to use this variable outside the flowchart, we could expand the scope of the variable to the whole workflow. In this case, we would click in the Scope cell, and set the scope to Sequence. For this workflow, we plan to leave it as Flowchart. Set the scope of the variable 3. To link the btnresult variable in the workflow with the form's b utton, click the DisplayForm frame and in the Properties pane, under Out Arguments, locate Button Results Value. Link the button output argument to the variable 4. In the Button Results Value box, type the name of the variable - btnresult. Now, when button in the form is clicked, it's value will be assigned to the Button Result Value. To declare variables for the zip and school Output Arguments: Remember that the Output Arguments for the zip and school data were created automatically when we filled in the parameters for ComboBox1 and ComboBox2. Output Arguments for zip and school We now have to declare the Variables that will hold the value of these arguments in order to pass this data to other activities of the workflow. 17

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow The data type of the variables must match the data type of the output arguments to function correctly. For example, if the Argument data type is object, then the variable data type must also be object. Certain form elements like ComboBoxes or Checkboxes use specific data types for their arguments. Usually, you can find out which data type the argument requires by hovering over the argument and reading its tooltip. In this case, the object data type is used as its the lowest common denominator for system types. Tooltip showing the expected data type 1. In the Variable panel, click on the text Create Variable, and type zip. Add the zip variable 2. Click the String Variable type and select Object, as the zip Output Argument produced is of the Object type. Select Object Variable type 3. To create the school variable, click Create Variable again, and type school. 4. Select Object as the Variable type. Define the school variable 5. To assign the new variables to their arguments, in the DisplayForm, type the name of each new variable beside its argument: zip and school. 18 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Create a FlowDecision Activity with Conditions Output Arguments with assigned variables The name of the variable and output argument do not have to be the same, but using the same word can help you remember what they refer to. Making names meaningful also makes it easier for others to understand the workflow and how it works. 6. Click File Save to save the changes to the workflow. Return to Tutorial Overview Create a FlowDecision Activity with Conditions We now have our form to collect responses from the user and we have defined variables to hold the data and make it possible to pass it on to the next part of the workflow. At this point, we want to add the ability for the user to make a decision and either select a single school, or display results for them all. In the this section of the tutorial, we will create a FlowDecision activity and apply conditions that allow the user to display either a single school, or multiple schools per zip code. To add a FlowDecision and define its conditions: 1. In the ActivityBuilder, drag a FlowDecision activity from the Flowchart section of the Toolbox to just below the Display Form. Drag FlowDecision activity into the flowchart 2. To join the decision to the form, drag a connector from a node on the bottom edge of the DisplayForm to a node on the Decision. Join Decision to DisplayForm 19

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow 3. To define the condition, click on the Decision in the workflow, and then in the Properties panel, click the Condition ellipses. Define the condition 4. When the Expression Editor dialog opens, type in btnsearch = "Search", and then click OK. Expression for the Search button The "Search" in the expression is referring to the value Search that we assigned to the Search button. The expression is stating that, if the value returned from the button is Search (the user clicks the Search button), then the True choice of the decision applies and the workflow continues down the True arm of the Flow chart. Because a Condition is Boolean, there is either a True or False choice on either side of the Decision activity. So we need to create follow-up activities for both the True and False outcome decisions. In our workflow, if the choice is True (Search button selected), our queries will run and the schools will be presented to the user. If the choice is False, it is because the user clicks closes the panel. So, to create the False choice, we can add a new Cancel button to our form. When you define a Decision activity, there are two features that make the workflow graphic easier to read. In the top right corner of the Decision box, there is a small arrow that shows the Condition expression when you hover over it. You can also change the True and False labels of the Decision to indicate their specific value (or any other text) rather than simply saying True or False. Change labels in the Decision activity 20 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Create a FlowDecision Activity with Conditions To define the False choice of the decision: 1. To create a new button, click Buttons in the DisplayForm, and then the click Add in the Button Editor. 2. In the Label box, type Cancel, and in the Value box, type Cancel again. 3. As we do not need to validate the user's response, do not select the Causes Validation checkbox. Cancel button added in the Button Editor 4. To close the Button Editor, click OK. 5. To create the False branch of the Decision, from the Modelling section of the Toolbox, drag a ServerPlaceHolder activity into position to the right side of the Decision. Drag the ServerPlaceHolder activity into the workflow The ServerPlaceHolder activity does not do anything except act as a visual record within the workflow to indicate that the user cancelled. 6. To make it easier to identify the function of the ServerPlaceHolder activity, click the name of the activity and type in User Cancelled. Change the name of an activity 21

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow You can change the name of any activity in the workflow to make the workflow easier to interpret. For example, we can change the name of the DisplayForm activity to Form to Collect User Input and the Sequence activity to Search for Schools Workflow. When you change an activity name, all references to the name in the Workflow Designer change too, including links and variable Scope. Names of activities changed 7. Drag a connector to join the User Cancelled activity to the False side of the Decision. Join the Decision to the User Cancelled activity To define the True choice of the Decision: The True side of the Decision is going to involve several activities that include a query string, a query task and another decision with a condition. As we need to store the school query, we will need to define a variable for it. 1. In the Variable panel, click Create Variable, and type school_query. The Variable type should be String and the Scope should be Search for Schools Worklow. (Remember that we changed the name of the Sequence activity, so the Scope name now matches the new activity name.) Create the school_query variable 2. To create an activity to contain the queries, from the Control Flow section of the Toolbox, drag a Sequence activity to the True side of the Decision, and then drag a line from a node on the Decision to a node on the Sequence activity. 22 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Create a FlowDecision Activity with Conditions Join the Decision to the Sequence activity 3. To make it easier to identify what the activities do within this part of the workflow, click and rename the Sequence activity: Create Query String. 4. Double-click the Create Query String activity to enlarge it and make it the main focus in the workflow. Because we want users to be able to display either one or all the schools, we now have to set up another condition. This time we will use an If activity. 5. From the Control Flow section of the Toolbox, drag an If activity inside the Create Query String activity. Drag an If activity inside the Create Query String activity 6. To define the condition, type in the Visual Basic expression: school is Nothing. school is Nothing condition The school is Nothing syntax means that nothing has been assigned to school, in other words, the user has not selected a specific school. So in effect, the condition now reads "If the user does not select a school..." In the Then box, we now have to define what will happen if this Condition is true. In the Else box, we must then define what will happen if this condition is false (the user has selected a school). We do this by assigning two different expressions to the school_query variable for the Then and the Else options. For this task, we use two Assign activities, which allow you to assign variables to queries. 7. From the Common Server section of the Toolbox, drag an Assign activity into both the Then and the Else boxes. The error icon appears because we have not completed the VB expressions yet, so the query is still invalid. 23

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow Assign activities added to the Then and Else boxes of the Condition 8. To complete the Then side of the Condition, assign the following value to the school_query variable: "ZIP = '" +zip.tostring() +"'" The Then expression for school_query The Then side of the Condition now states, "If the user selects nothing in the school drop-down list, then display all the schools in the zip code." Explanation of the Then expression If you need to see the whole expression or edit it, you can open the Expression Editor by clicking the beside the Value field in the Properties panel. 9. To complete the Else side of the Condition, assign the following value to the school_query variable: "OBJECTID = " + school.tostring () 24 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Create the QueryTask The Else expression for school_query The Condition now states, "If the user selects nothing in the school drop-down list, then display all the schools in the zip code, or else display the specific school selected." Explanation of the Else expression 10. Click File Save. Return to Tutorial Overview Create the QueryTask Now that we have assembled the query string, we can use it in a Query Task activity. To define the QueryTask parameters: 1. To return to the Flowchart so that we can add more activities, click the Flowchart link in the navigation bar at the top of the Design area. 2. From the ArcGIS Server section of the Toolbox, drag a QueryTask activity into place below the Create Query String activity and drag a connector from it to the Query Task. 25

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow Drag a QueryTask activity into the workflow 3. Double-click on the QueryTask activity to open it. The parameters we need for the QueryTask activity are very similar to those we defined for the zip codes query and we go to the same place to get them the CharlotteOperational Mapserver. The zip codes query was to get the zip codes and use them to populate the drop-down list so that users could select them. For this query, we actually want to display the data to the user as the outcome of a search (for schools). 4. In the Query Service Url box, copy and paste the URL to the Schools layer of the CharlotteOperational Mapserver: http://sampleserver1.geocortex.com/arcgis/rest/services/charlotteoperational/mapserver/2 In this field, you need to put the URL inside quotes as it is being used as a Visual Basic expression. 5. In the Where field, type school_query, which is the variable that we assigned the query string to in the previous section. In effect, this will run the query we defined using the If condition. (We are doing an attribute query, not a spatial query, so ignore the Geometry field.) 6. In the Out Fields box, type "*", which returns the data from all the Fields in the layer. In Out Fields, you specify which Fields in the layer you want to display to the user. As there are only five Fields on this layer, using the all ("*") wildcard is safe, but if there were many fields available, you would want to define specific fields whose information you want to display. To specify specific fields, type in the actual field names separated by commas, for example, "NAME, OBJECTID, ZIP". Quotes are used here as it is a Visual Basic expression. 7. Because we do not need the geometries of the results, we won't use a Return Geometry, so type False in this field. Queries that return geometries are slower than those that do not. Only set Return Geometry to True if you need it. To define the Result of the QueryTask: If you hover over the Result box in the QueryTask dialog box, you will see that the QueryTask is expecting the results to be encapsulated within an ESRI FeatureSet. 26 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Create the QueryTask Tooltip of the Result field To pass this feature set to the next part of the workflow, we need to define a variable. Because the data type for the variable must be the same as the argument, the variable type will need to be a feature set too. 1. In the Variable panel, click Create Variable and type school_fs as the name of the variable. 2. For the Variable type, click in the cell and select ESRI.ArcGIS.Client.Tasks.FeatureSet. Select the ESRI FeatureSet for the Variable type If the Variable type that you needed is not in the drop-down list, you can select Browse for Types in the drop-down list. This option opens the Browse and Select a.net Type dialog, where you can search for a variable type in all referenced assemblies. Search for a Variable type 3. Select Flowchart for the Scope of the variable. 27

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow 4. In the Result box of the QueryTask, type the name of the new variable: school_fs. Now the results will be passed on as a feature set using the variable. Because this is a variable, you should not put it in quotes. 5. To make it easier to identify what the Query Task activity does, select the activity name and type Query for Schools to change the name. Change the name to Query for Schools 6. To close the Query for Schools (Query Task) activity and return to the Flowchart, click the Flowchart link at the top of the design area. 7. Click File Save. Return to Tutorial Overview Check Results and Create a Feedback Loop The final part of the workflow is another FlowDecision activity that counts the number of schools returned. If no results are found by the query, a message displays and the user can return to the original form to enter a different zip code. To add the next activities, you may need to make the Flowchart activity larger. To increase the size of a Flowchart activity, drag the corner outwards. To define the Decision condition that counts the results: 1. Drag a connector to join the QueryTask and the FlowDecision. Join the QueryTask to the Decision 28 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Check Results and Create a Feedback Loop 2. To define the Decision, select it and then in the Properties panel, click beside the Condition field to open the Expression Editor. Open the Expression Editor from the Properties Panel 3. In the Expression Editor type: school_fs.features.count > 0 The count expression in the Expression Editor This expression defines the condition, so if the number of schools returned by the query is greater than zero, the condition is True. If there are no results, the condition is False. To create a Select Features activity to display the feature set in the Viewer: The Select Feature activity is used to display a feature set in the Viewer. We already have the feature set variable (school_fs) so all we need to do is refer to the variable. 1. From the Common Viewer section of the Toolbox, drag a Select Features activity into the flowchart and drag a connector to join it to the true side of the condition. Drag the SelectFeatures activity to the true position of the Decision 2. Double-click on the SelectFeatures activity to open it and in the Feature Set box, type school_fs. Because school_fs is a variable, it should not be in quotes. 3. For the Map Service ID, we return to our Geocortex Essentials Site Directory REST endpoint Charlotte ArcGIS 29

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow Online, where we can find the Map Service ID in two places: Map Service ID on the Map page Map Service ID on the Map Service page 4. In the Map Service ID box, type "0". The zero has to be in quotes as it is a string. The Layer Id for the Schools layer is available on the same pages. Layer ID on the Map Service page Layer ID on the Map page 5. In the Layer Id box, type "2". 6. To give the display of schools a name when it is displayed in the Results panel of the Viewer, type the following expression into the Collection Name box: "Search Schools in ZIP: " & zip.tostring() Define Select Features 30 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Check Results and Create a Feedback Loop This expression puts the words Search Schools in Zip: at the top of the Results panel, and replaces & zip.tostring() with the actual zip code selected. The actual zip code is taken from the variable zip, and the number of schools found is in brackets: Collection Name expression in the Results panel in the Viewer 7. Click the Flowchart link to return to the workflow, and then click File Save. You can click the links at the top of the design area to navigate to those parts of the workflow. Navigate using the links in the title bar 8. To clearly identify the function of the Select Features activity, click and type in a new name: Display School Featureset. Change the name of the Select Features activity To create a feedback loop using a simple form: The final task in creating the workflow is to create a simple form to let the user know if no schools are found in a zip code they selected. To do this, we create the form and then link it back to the original form in the flowchart. That way the user is again presented with the original form and can enter a new zip code. 1. From the Common Client section of the Toolbox, drag a DisplayForm activity into the workflow on the False side of the Decision. Drag the DisplayForm activity into the workflow 2. To clarify the funcion of the DisplayForm, click and change the name to No-Results Form. 31

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow Change the name of the DisplayForm activity 3. To open the Form Designer, click Design Form. 4. When the Form Designer opens, in the Form tree, click the root: Form. 5. In the Title box, type in the feedback: No Results Found. Enter a title for the form 6. In the Form tree, select Group. 7. In the Description box, type No Schools were found that match the search criteria, and then click OK. Enter informative text on the form 8. To define a button that will return users to the original form, in the DisplayForm, click the Buttons ellipsis: Click to open the Button Editor 9. In the Button Editor, click Add, type Back in both the Label and the Value boxes, and then click OK. Create the Back button 10. To link the feedback form back to the original form, drag a connector from the right side of the new DisplayForm to the right side of the original form. 32 2011 Latitude Geographics Group Ltd. All Rights Reserved.

Option - Replace ComboBox2 with a ListBox Feedback form looped back to the original form. 11. To ensure that this form displays in the Results panel of the Viewer when the workflow is deployed, in the Properties panel, type "DataRegion" into the Region Name box. Use quotes as this is a string. Data Region specified in the Region Name 12. Click File Save. The workflow is now complete. You will find information on how to publish the workflow in the Geocortex Workflow Designer User Guide. Option - Replace ComboBox2 with a ListBox An alternative way to implement this workflow would be to use a ListBox in place of the second ComboBox. The procedure would be the same. The settings and parameters for the ListBox would be very similar to those for ComboBox 2. 33

Geocortex Workflow Designer Tutorial : Create Search Schools Workflow There are two extra parameters in a ListBox to fill in: The Selection Mode field allows you to select whether you want the user to be able so select one (Single), or many items in the list. For example, if you want the user to select more than one school in the list, you can set the Selection Mode to Multiple. If you want the user to be able to select multiple consecutive schools while holding down the SHIFT key, select Extended. The Max Height field is where you set the height of the ListBox when it is displayed in a viewer. You can start with 200 pixels and change it if this is not enough. A scroll bar appears automatically in the ListBox if there are more items in it than are visible. ListBox settings to replace ComboBox2 Return to Tutorial Overview 34 2011 Latitude Geographics Group Ltd. All Rights Reserved.