Query All Layers
Hi
This sounds relatively simple but i'm struggling to find an example in the code gallery.
I have a workflow that creates a buffer, then it returns all the features within a layer based on a query task. This works fine but how do i return all features within all layers within the buffer?
Thanks in advance.
-
Have you tried using the Identify command in a RunExternalCommand activity?
From SL Admin Guide
Command: Identify
Result: Identifies any features that intersect the specified geometry and populates the FeatureSetManager’s active collection with the results.
When the IdentifyCommand executes, the FeatureSetManager’s Events fire as the default feature set is updated.Arguments: ESRI.ArcGIS.Client.Geometry.Geometry
Use in workflow?: Yes
0 -
Yeah. Sorted it now thanks, that is what I was after
0 -
Hi John and Matthew, Do you mind sharing detail about how you use the identify command in your workflow to return feature results from multiple layers?
Thank you and regards,
Jin
0 -
Jin,
One the activities you can use in the Workflow Designer is called RunExternalCommand. It will run a command on the client side of the workflow. The Silverlight Administrator and Developer Guide (available in the Downloads section if you haven't already saved a copy) has an reference section that list all of the commands you can use and their parameters.
Some commands can be used in workflows, but others can't . The Identify command will identify any features that intersect the input geometry (command parameter) and can be used in a workflow. In this specific example, the geometry is coming from a buffer that gets created using the BufferTask activity.
The output of BufferTask is actually a graphic, so to get the geometry for use in the Identify command you need to use the UnionTask activity. For the feature set, you need to enter new ESRI.ArcGIS.Client.Tasks.FeatureSet(resultBuffer) , which will create a new feature set and load the buffer into it.
Here's a sample workflow of the process. You'll have to plug in your own data to try it out.
<Activity mc:Ignorable="sap sads" x:Class="{x:Null}" sap:VirtualizedContainerService.HintSize="399,1050" 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:gce="clr-namespace:Geocortex.Core.Extensions;assembly=Geocortex.Core"
xmlns:gfc="clr-namespace:Geocortex.Forms.Client;assembly=Geocortex.EssentialsWpfApi"
xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;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:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
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:sl="clr-namespace:System.Linq;assembly=System.Core"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Sequence sap:VirtualizedContainerService.HintSize="359,970" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
<Sequence.Variables>
<Variable x:TypeArguments="esri:FeatureSet" Name="resultFeatureSet" />
<Variable x:TypeArguments="scg2:IEnumerable(esri:Graphic)" Name="resultBuffer" />
<Variable x:TypeArguments="esri:Geometry" Name="resultBufferGeometry" />
</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:QueryTask sap:VirtualizedContainerService.HintSize="337,243" OutFields="*" QueryServiceUrl="your service url" Results="[resultFeatureSet]" ReturnGeometry="True" SpatialRelationship="esriSpatialRelIntersects" Where="Where Clause" />
<gwa1:BufferTask Distance="100" FeatureSet="[resultFeatureSet]" GeometryServiceUrl="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" sap:VirtualizedContainerService.HintSize="337,261" Results="[resultBuffer]" />
<gwa1:UnionTask FeatureSet="[new ESRI.ArcGIS.Client.Tasks.FeatureSet(resultBuffer)]" GeometryServiceUrl="https://cityview.brooklynpark.org/arcgis/rest/services/Utilities/Geometry/GeometryServer" sap:VirtualizedContainerService.HintSize="337,136" Result="[resultBufferGeometry]">
<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:UnionTask>
<gwa1:RunExternalCommand CommandName="Identify" CommandParameter="[resultBufferGeometry]" sap:VirtualizedContainerService.HintSize="337,86" />
</Sequence>
</Activity>0 -
John,
Thanks so much for explaining how to use the identify command in detail and for sharing the sample workflow. You just saved me hours of work!
Regards,
Jin
0 -
Hello,
Being newbie to GE, I have a very basic questions here. What are external commands? Where can i find list of all sort of external commands guide? Can I use external commands in HTML Viewer?
Thanks in advance.
0 -
You can find a lot of commands, both internal and server side, in the viewer admin guides. There are also many commands listed within workflow manager. Just add the Run External Command activity to your workflow, and then click the ? to the right of the Command Name parameter to see a list of available external commands.
Just keep in mind that they aren't all available in both the GVS and GVH, so make sure to check the admin guide to see if the command you want to use is included.
0 -
Thanks a lot John. That would be a great help.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
8 Kommentare