How to Display Buffer Graphic and How to clear Selection
Hi all,
Throwing this out prior to leaving for vacation. I have a workflow based on the code-gallery-buffer-parcel-and-select.xaml. The workflow runs as expected by selecting a feature, running a 1/2 mile buffer and displaying the feature results list . The two issues I'm having is that the buffer graphic does not display withing the map and the results table does not clear between running the workflow. I have attempted a large number of different command adjustments in the workflow to fix one or both of these issue with no luck. Any help would be appreciated. Here is the current code, at this point it is pretty much back to the native downloaded code. We are working HTML5 2.3 and GE 4.2.
Thanks!
Brian
<Activity>
<Sequence sap2010:WorkflowViewState.IdRef="Sequence_2" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
<Sequence.Variables>
<Variable x:TypeArguments="esri:Geometry" Name="geometry" />
<Variable x:TypeArguments="esri:FeatureSet" Name="selectedFeatures" />
<Variable x:TypeArguments="esri:Polygon" Default="[new ESRI.ArcGIS.Client.Geometry.Polygon]" Name="polygon" />
<Variable x:TypeArguments="x:Int32" Default="2264" Name="localWKID" />
<Variable x:TypeArguments="x:Int32" Default="102100" Name="mapWKID" />
<Variable x:TypeArguments="esri:MapPoint" Name="point" />
<Variable x:TypeArguments="x:String" Name="Locations" />
<Variable x:TypeArguments="esri:FeatureSet" Name="fsBuffer1" />
</Sequence.Variables>
<Sequence DisplayName="Inner Sequence 1" sap2010:WorkflowViewState.IdRef="Sequence_1">
<Sequence.Variables>
<Variable x:TypeArguments="scg:IEnumerable(esri:Graphic)" Name="graphic" />
<Variable x:TypeArguments="scg:IList(esri:Graphic)" Name="graphics" />
<Variable x:TypeArguments="esri:FeatureSet" Name="parcel" />
<Variable x:TypeArguments="esri:FeatureSet" Name="Establishment" />
<Variable x:TypeArguments="scg:IEnumerable(esri:Graphic)" Name="bufferGraphics" />
<Variable x:TypeArguments="x:String" Name="newGraphic" />
<Variable x:TypeArguments="scg:IEnumerable(esri:Graphic)" Name="liqLocation" />
</Sequence.Variables>
<gwa1:CaptureGeometry CaptureType="[Geocortex.Workflow.Activities.GeometryCaptureType.MapPoint]" sap2010:WorkflowViewState.IdRef="CaptureGeometry_1" Result="[geometry]" />
<gwa1:QueryTask Geometry="[geometry]" sap2010:WorkflowViewState.IdRef="QueryTask_1" MaxAllowableOffset="0" OutFields="*" QueryServiceUrl="http://gis3.greeleygov.com/greeleygis/rest/services/Data_Services/ParcelID/MapServer/0" Results="[parcel]" ReturnGeometry="True" SpatialRelationship="esriSpatialRelIntersects" />
<gwa1:BufferTask Distance="2640" Geometry="[parcel.first().geometry]" GeometryServiceUrl="http://gis3.greeleygov.com/greeleygis/rest/services/Utilities/Geometry/GeometryServer" sap2010:WorkflowViewState.IdRef="BufferTask_1" OutSpatialReference="[new ESRI.ArcGIS.Client.Geometry.SpatialReference(localWKID)]" Results="[graphic]" Unit="[ESRI.ArcGIS.Client.Tasks.LinearUnit.Foot]" />
<gwa1:ProjectTask FeatureSet="[graphic]" GeometryServiceUrl="http://gis3.greeleygov.com/greeleygis/rest/services/Utilities/Geometry/GeometryServer" sap2010:WorkflowViewState.IdRef="ProjectTask_1" Results="[graphics]" SpatialReference="[new ESRI.ArcGIS.Client.Geometry.SpatialReference(mapWKID)]" />
<Assign sap2010:WorkflowViewState.IdRef="Assign_1">
<Assign.To>
<OutArgument x:TypeArguments="esri:Polygon">[polygon]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="esri:Polygon">[CType(graphics.first().geometry,ESRI.ArcGIS.Client.Geometry.Polygon).Clone]</InArgument>
</Assign.Value>
</Assign>
</Sequence>
<gwa1:RunExternalCommand CommandName="AddMarkup" CommandParameter="[polygon]" sap2010:WorkflowViewState.IdRef="RunExternalCommand_1" />
<gwa1:QueryTask Geometry="[polygon]" sap2010:WorkflowViewState.IdRef="QueryTask_2" MaxAllowableOffset="0" OutFields="*" OutSpatialReference="[new ESRI.ArcGIS.Client.Geometry.SpatialReference(mapWKID)]" QueryServiceUrl="http://gis3.greeleygov.com/greeleygis/rest/services/Data_Services/LiquorLicenses/MapServer/0" Results="[selectedFeatures]" ReturnGeometry="True" SpatialRelationship="esriSpatialRelIntersects" />
<gwa1:SelectFeatures FeatureSet="[selectedFeatures]" sap2010:WorkflowViewState.IdRef="SelectFeatures_1" LayerId="0" MapServiceId="18" />
</Sequence>
<sap2010:WorkflowViewState.ViewStateManager>
<sap2010:ViewStateManager>
<sap2010:ViewStateData Id="CaptureGeometry_1" sap:VirtualizedContainerService.HintSize="337,86" />
<sap2010:ViewStateData Id="QueryTask_1" sap:VirtualizedContainerService.HintSize="337,243" />
<sap2010:ViewStateData Id="BufferTask_1" sap:VirtualizedContainerService.HintSize="337,261" />
<sap2010:ViewStateData Id="ProjectTask_1" sap:VirtualizedContainerService.HintSize="337,161" />
<sap2010:ViewStateData Id="Assign_1" sap:VirtualizedContainerService.HintSize="337,60" />
<sap2010:ViewStateData Id="Sequence_1" sap:VirtualizedContainerService.HintSize="359,1095">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="RunExternalCommand_1" sap:VirtualizedContainerService.HintSize="359,86" />
<sap2010:ViewStateData Id="QueryTask_2" sap:VirtualizedContainerService.HintSize="359,243" />
<sap2010:ViewStateData Id="SelectFeatures_1" sap:VirtualizedContainerService.HintSize="359,161" />
<sap2010:ViewStateData Id="Sequence_2" sap:VirtualizedContainerService.HintSize="381,1829">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</sap2010:ViewStateData>
<sap2010:ViewStateData Id="ActivityBuilder_1" sap:VirtualizedContainerService.HintSize="421,1909" />
</sap2010:ViewStateManager>
</sap2010:WorkflowViewState.ViewStateManager>
</Activity>
-
I've done some small testing with these methods in the GVH, but not at 2.3.
To clear a selection, use the RunExternalCommand activity and set the Command Name parameter to "ClearSelection".
To draw a buffer markup, use the Parallel For Each <T> activity.
/customer/servlet/servlet.FileDownload?file=00P6000000elzn9EAA
In this example, resultBuffer is the result from your BufferTask activity. I use "AddTemporaryMarkupGeometry" because my workflow clears the buffer drawing when it completes, but you could all use the "AddMarkupGeometry" command if you want to add the markup to your map and be able to edit/remove it using the drawing tools.
0 -
Hi Brian,
Just to add to Johns post, to clear the results list between successive iterations of the workflow the 'Clear Collection First' argument of the SelectFeatures activity to 'True'. This will clear any selected features of the results list each time the workflow executes.
Waren
0 -
Thanks Warren and John! Warren, that was exactly what I needed. Cleared my list between running the workflow. John when I try to use the ParallelForEach with the BuffTask result I get an error message seen below:
/customer/servlet/servlet.FileDownload?file=00P6000000e88aNEAQ
Thanks! And yes, I haven't changed the original variable names, so the buffer result is called 'graphic'.
Brian
0 -
It's having a conversion issue, but I'm not sure why. Our settings on our Buffer Task activity are a little different.
/customer/servlet/servlet.FileDownload?file=00P6000000elu7KEAQ
My Distance argument looks like that because the buffer distance is based on user input.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
4 Kommentare