Passing Geometry into workflow in HTML5?
I have a workflow that is initiated from the Identify Results of features. This line is in the Feature Description: <a href="command:RunWorkflowWithArguments?workflowId=Climate_Buffer_From_Partners&input={$Geometry}">Select Other Partners within a Specific Distance</a>
On the Silverlight viewer this works just fine; it takes the feature geometry, buffers it and select all features within that buffer.
On the HTML5 viewer (Both 1.2 and 1.3), it fails. I get this error: There was a workflow error running activity: Exception has been thrown by the target of an invocation. Workflow 'Climate_Buffer_From_Partners' failed Unhandled exception: 'Required parameter is null or empty. Parameter name: bufferParameters.Features' in activity '1.115: BufferTask'. Required parameter is null or empty. Parameter name: bufferParameters.Features
I am thinking that as {$Geometry} is not getting passed so the buffer is trying to work on a null or empty value. Is there something that I need to do differently to get this to work?
-
Hi Marcus,
It does sound like the geometry isn't being passed. Try swapping in this simple workflow in place of your current one - it simply shows the extent of the passed in geometry. You can use Fiddler to see the inargs on the run workflow command; here's a sample of what I see in my test system in Fiddler using the WebForms view:
[{"runtimeTypeName":"ESRI.ArcGIS.Client.Geometry.Geometry, ESRI.ArcGIS.Client","name":"thisGeometry","typeName":"ESRI.ArcGIS.Client.Geometry.Geometry, ESRI.ArcGIS.Client","isRequired":false,"value":{"type":"polygon","rings":[[[1434105.12509534,560706.062577073
<snip>
[1434105.12509534,560706.062577073]]],"_ring":0,"spatialReference":{"wkid":2264}}}]
I've run this in the 1.3 viewer without issue.
regards,
Edmond
PS - Using Fiddler with the Silverlight viewer will also show the geometry argument.
<Activity mc:Ignorable="sads sap" x:Class="{x:Null}"
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:s3="clr-namespace:System;assembly=System.ServiceModel"
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=mscorlib"
xmlns:sl="clr-namespace:System.Linq;assembly=System.Core"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<x:Members>
<x:Property Name="thisGeometry" Type="InArgument(esri:Geometry)" />
</x:Members>
<sap:VirtualizedContainerService.HintSize>273,286</sap:VirtualizedContainerService.HintSize>
<mva:VisualBasic.Settings>Assembly references and imported namespaces serialized as XML namespaces</mva:VisualBasic.Settings>
<Sequence sap:VirtualizedContainerService.HintSize="233,206" 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>
<gwa1:Alert sap:VirtualizedContainerService.HintSize="211,82" Text="[thisGeometry.extent.tostring]" Title="[thisGeometry.tostring]" />
</Sequence>
</Activity>0 -
The geometry is not be being passed into the workflow. I get the following error when I use the alert you provided: There was a workflow error running activity: Exception has been thrown by the target of an invocation. Workflow 'Climate_Buffer_From_Partners' failed Unhandled exception: 'Object reference not set to an instance of an object.' in activity '1.153: Alert'. Object reference not set to an instance of an object.
I get the geometry returned just fine in the Silverlight Viewer.
Any Ideas for a workaround?
0 -
Hi Marcus,
I forgot to explicitly state that the hyperlink specifies the name of the argument, so if there was a mismatch you'd see the error you got. Here is the hyperlink text I used:
HyperLink Command
<a href="command:RunWorkflowWithArguments?workflowId=thisWorkflow&thisGeometry={$Geometry}">Run this workflow too</a>So for your system, rather then mess with your hyperlink command in your layer, change my workflow's argument from "thisGeometry" to "input" and retry it. If it fails again then go to Fiddler and capture the run workflow request, then examine it. Is the input "value" blank? If so, compare it agains the request on the Silverlight one.
regards,
Edmond
0 -
That is what I already did.
Here are the results of the request in Fiddler, as you can see, they are not the same and there is no geometry :
Silverlight:
GET http://gis-test.cs.city.fcgov.com/Geocortex/Essentials/REST/sites/ClimateWise_Partners/workflows/Climate_Buffer_From_Partners/run?f=json&inargs=%5b%7b%22isRequired%22%3atrue%2c%22name%22%3a%22input%22%2c%22typeName%22%3a%22ESRI.ArcGIS.Client.Geometry.Geometry%2c+ESRI.ArcGIS.Client%22%2c%22runtimeTypeName%22%3a%22ESRI.ArcGIS.Client.Geometry.Geometry%2c+ESRI.ArcGIS.Client%22%2c%22value%22%3a%7b%22spatialReference%22%3a%7b%22wkid%22%3a102100%7d%2c%22x%22%3a-11696964.9745975%2c%22y%22%3a4951867.77682491%2c%22z%22%3aNaN%2c%22m%22%3aNaN%7d%7d%5d&ts=635140687783289589&v=3.0 HTTP/1.1HTML5:
0 -
Has anyone found a workaround for this issue? I still can not pass geometry from the HTML5 Viewer
0 -
Hi Marcus,
There was a bug in the HTML5 Viewer that prevented arguments from being passed to the workflow when using the RunWorkflowWithArguments command. This has been fixed in the 1.3.1 maintenance release, which is available under the Downloads tab.
-Victoria
0 -
That fixed the issue - Thank you very much!
0 -
I'm trying to do this with a tool, passing the geometry drawn by the tool to the workflow. I've not had any luck at all despite changing the desktop.json to include
"command": "RunWorkflowWithArguments",
"commandParameter": {
"workflowId": "MyWorkflow",
"ExtGeom": "{{geometry}}"
}
Is this possible? it seems to not even try and fail to run the workflow. it just does nothing.0 -
Hi All,
I got this error when try to run a hyperlink workflow:
This is the my command:
<div>{ParcelNumber}</div><div>{BlockNumber}</div><div>{CommunityName_Arabic}</div><div style="font-size: 10pt;"><span style="font-family: Arial; font-size: small;"><span style="font-weight: bold; color: rgb(0, 0, 153);"><br/></span></span></div><a href="command:RunWorkflowWithArguments?workflowId=MultiLayerReportWithMap&objectID={OBJECTID}" style="font-size: 10pt; font-weight: bold;">????? ??????? ??????</a><span style="font-size: 10pt;"> </span>
And I got this error in the buffer tool:
There was a workflow error running activity: Exception has been thrown by the target of an invocation. Workflow 'MultiLayerReportWithMap' failed Unhandled exception: 'Value cannot be null. Parameter name: geometry' in activity '1.170: BufferTask'. Value cannot be null. Parameter name: geometry
please note that if I add a display form instead of hyperlink on the layer the workflow will work fine, so the problem from the hyperlink.
Any suggestion?
Thank you in advance0
Please sign in to leave a comment.
Comments
9 comments