Using Create List collection
Howdy,
does anyone out there have an example of how to use the 'Create List' activity?
I'm trying to ultimately present the user with a list of field values from a published map service - into a combo-box on a form.
So far I've been wrestling with this worflow..
Create the list of type (systems.collections.generic.IList<System.String>)
Run query task on map service and return feature set of one field of values.
For Each activity.. to iterate through the feature set and invoke the Add to Collection activity...
crude attempt below ; (
<Activity mc:Ignorable="sap" x:Class="{x:Null}" sap:VirtualizedContainerService.HintSize="392,733" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:eac="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client" xmlns:eacg="clr-namespace:ESRI.ArcGIS.Client.Geometry;assembly=ESRI.ArcGIS.Client" xmlns:eact="clr-namespace:ESRI.ArcGIS.Client.Tasks;assembly=ESRI.ArcGIS.Client" xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:gfc="clr-namespace:Geocortex.Forms.Client;assembly=Geocortex.EssentialsWpfApi" xmlns:gr="clr-namespace:Geocortex.Reporting;assembly=Geocortex.Reporting" xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow" xmlns:gwa1="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities" xmlns:s="clr-namespace:System;assembly=System.Core" xmlns:s1="clr-namespace:System;assembly=System" xmlns:s2="clr-namespace:System;assembly=mscorlib" xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg1="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=mscorlib" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Sequence sap:VirtualizedContainerService.HintSize="352,693" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
<Sequence.Variables>
<Variable x:TypeArguments="scg2:IList(x:String)" Name="pointObsTypesList" />
<Variable x:TypeArguments="esri:FeatureSet" Name="pointObsTypes" />
<Variable x:TypeArguments="x:String" Name="variable1" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg2:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg2:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<gwa1:CreateList x:TypeArguments="x:String" DisplayName="Create List of Point Observation types" sap:VirtualizedContainerService.HintSize="330,59" Result="[pointObsTypesList]" />
<gwa1:QueryTask sap:VirtualizedContainerService.HintSize="330,227" OutFields="FIRE_OBS_TYPE_PY" QueryServiceUrl="http://firemapgc.dse.vic.gov.au/ArcGIS/rest/services/fire_obs_feat/FeatureServer/0" Results="[pointObsTypes]" ReturnGeometry="False" SpatialRelationship="esriSpatialRelIntersects" Where="1=1" />
<ForEach x:TypeArguments="x:String" DisplayName="ForEach<String>" sap:VirtualizedContainerService.HintSize="282,203" Values="[pointObsTypes.Features.Attributes"(FIRE_OBS_TYPE_PY)"]">
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="item" />
</ActivityAction.Argument>
<AddToCollection x:TypeArguments="x:String" Collection="[pointObsTypesList]" DisplayName="AddToCollection<string>" sap:VirtualizedContainerService.HintSize="252,100" Item="[item]" />
</ActivityAction>
</ForEach>
</Sequence>
</Activity>
any help greatly appreciated...
cheers
Gareth
-
Hi Gareth,
Do you have any particular reason to want to run the query on the server? You can simply configure the ComboBox in the form designer to accomplish the same thing.
The only reason to use the input parameter to a ComboBox/ListBox is to provide it with data that doesn't come from a map service/feature service.
Cheers,
Christian.
0 -
Thanks Christian,
not sure what I was thinking there!! obviously I wasn't ; )
cheers
Gareth
0 -
Christian,
ok, I've got a question then that extends on the populating of values in lists, regardless of client or server side querying - I managed to get the server side list sorted, but it's displaying the 'code' integer of the coded domain, not the description. Is there a simple way of presenting the description to the user/
cheers
Gareth
0 -
Gareth/Christian,
I have the same issue, from what I could figure, Geocortex doesn't handle the domain or subtype values in forms etc. I had to manually enter the subtype values into the combobox...not ideal but still worked with my query later in the workflow. I would love to be proven wrong though..
Ben
0 -
Hi Ben/Gareth,
The form are using a query task internally and unfortunately, Esri doesn't perform the coded domain value replacements in query task, they only do it in the identify task. But identify task are spatial only and do not use a where clause.
In a future version of forms, We may introduce a new option that will allow you to populate a ComboBox/ListBox from the coded domain values of a particular field in a layer. The coded domain value information is actually available on the REST endpoint of a map service layer.
In the mean time, if someone wanted to do some extra coding, they could create a custom rest endpoint (a technology offered by Essentials) that accepts the parameters of a query task as used by forms and it would return the coded domain values in the format returned by a query task. This would make a nice code gallery sample. This is an advanced solution.
Cheers,
Christian.
0 -
Thanks Christian,
our local distributor has confirmed it also... so not great news. Would really love a future version of forms to incorporate domains - could this please be added as an enhancement request x2 (and I'm sure there'll be more!)
The coding's a bit out of my league, so I'll stick to hard coding the 30 or so, it's not that bad luckily.. ; )
cheers
G
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
6 kommentarer