Workflow queries fail when I change dynamic symbolization
Hello. I'm trying to implement dynamic symbolization, using AGS 10.1/GE 3.15/GVS1.10. To turn on dynamic symbolization, all I did in AGS was go to Server Properties|Mapping, and check the "Allow per request modification of layer order and symbology" box for a given map service.
Now in the GVS Layer List I can click on a layer and click Symbolization, and change the symbology. So far, so great!
The problem lies with my workflows - as soon as I change the symbolization, any workflow with a Query task that hits that layer fails. The documentation is pretty sparse, but I'm wondering, does it have something to do with the "Source" parameter in the Query Task? If so, what do I put in there? Any other ideas? Anything else I need to do in ArcGIS Server?
Thanks for any advice.
Chris
-
Hi Chris
you need to set the layer source parameter in the Query Activity. Set it first in the workflow using the GetMapServiceInfo activity. layerSource is one of the outputs of that activity.
Regards
Ralph
0 -
Chris, this gave me so much grief!
You may also have to add a sequence with an IF statement to your workflow to deal with the "dynamic layer" ids. When you have dynamic layers, the layer ID shows up as "dynamic layer" instead of "58" for example. So adding this IF statement deals with that; if the layer ID is "dynamic layer" then go find the actual ID and stop giving me errors. :)
In this snippet you will have to create a variable to use where it says "_YourVariableLayerId" in the condition. The "YourVariableLayerSource" is the variable that you create and put in the source (e.g. in your query task, and your GetMapServiceInfo as well).
<Activity mc:Ignorable="sap" x:Class="{x:Null}" sap:VirtualizedContainerService.HintSize="526,370" 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: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: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=mscorlib" xmlns:sl="clr-namespace:System.Linq;assembly=System.Core" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Sequence sap:VirtualizedContainerService.HintSize="486,330" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<If Condition="[_YourVariableLayerId = "dynamicLayer"]" sap:VirtualizedContainerService.HintSize="464,206">
<If.Then>
<Assign sap:VirtualizedContainerService.HintSize="291,100">
<Assign.To>
<OutArgument x:TypeArguments="x:Object">[_YourVariableLayerId]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Object">[if(Typeof YourVariableLayerSource Is ESRI.ArcGIS.Client.LayerMapSource, string.Format("{0}", CType(YourVariableLayerSource, ESRI.ArcGIS.Client.LayerMapSource).MapLayerID), string.empty)]</InArgument>
</Assign.Value>
</Assign>
</If.Then>
</If>
</Sequence>
</Activity>0 -
Thanks Ralph and Stephanie. Gah, this dynamic layer stuff is confusing!
- Can you please clarify a couple of things. Is the layer id of a dynamic layer always the same as the "regular" layer id?
- When using a query activity with dynamic layers, I understand I have to supply the "Source" parameter that gets returned by the GetMapServiceInfo activity. But what goes in the Query Service Url? I couldn't figure out the syntax.
Thanks for the help!
Chris
0 -
Hi Chris
it would seem that once the mapservice is dynamic then every layer id will be 'dynamic'or whatever is returned.
The 'Source'is where all the power is. (Sounds like a plot for Indiana Jones and the Source of the ArcGIS Server Map Service Layer )
The query service url along the lines of:
/customer/servlet/servlet.FileDownload?file=00P6000000e88WjEAI
where GetMapServiceInfo is getting a Source parameter populated also and that same source parameter is again used in the QueryTask
Does that help?
Ralph
0 -
And, if it helps (since it took me a while to get my head around all of it):
The "Source" is a Variable that you add to the GetMapServiceInfo and Query tasks. When you click on them in Workflow designer, you can add the Source on the right hand side under Properties.
I set up my Source, Layer ID, and Map Service URL as Variables, and my Layer Name and Map Service ID are Arguments.
/customer/servlet/servlet.FileDownload?file=00P6000000elzYnEAI
and then my Query Service URL is
_ParcelsMapServiceUrl & "/" & _ParcelsLayerId
0 -
Thanks again, that worked fine. So the logic seems to be that if the layer is dynamic, the query activity uses the layer source end point, otherwise it uses the regular end point.
To complicate things a little.... I have some workflows that parse out the JSON retrieved from the endpoint uri using the Download String activity. Up till now I've been defining the Uri as strMapServiceURL + "/" + strLayerID + "?f=json" (where strMapServiceURL and strLayerID are variables set using the GetMapServiceInfo activity). When I symbolize the layer, this now fails, as the dynamic layer uses a different REST endpoint. Do you know the syntax I should use for the uri if the layer is dynamic? (it's interesting that combo boxes in forms are populated just fine using the "regular" rest endpoint uri, even when the layer is dynamic. Not sure why the "regular" rest endpoint is not available in my Download String activity when using a dynamic layer...)
Thanks for all your help,
Chris
0 -
Oops, ignore my last post.
I was finally able to get it all working. My GetMapServiceInfo activity sets the attribute layerID with the Layer Id. I then set an If activity with the condition layerID="dynamicLayer". If it's dynamic, I set a new attribute, layerID_FINAL to if(Typeof layerSource1 Is ESRI.ArcGIS.Client.LayerMapSource, string.Format("{0}", CType(layerSource1, ESRI.ArcGIS.Client.LayerMapSource).MapLayerID), string.empty), otherwise set layerID_Final= layerID. From this point on, I just reference layerID_FINAL.
Thanks again to Ralph and Stephanie, who figured this all out for me.
Chris
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
7 Kommentare