Hoppa till huvudinnehållet

Problems with editing exising features workflow

Kommentarer

9 kommentarer

  • Permanently deleted user

    Hi Gareth

     

    here is one:

    <Activity mc:Ignorable="sap" x:Class="{x:Null}" sap:VirtualizedContainerService.HintSize="392,1382" 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: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:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mv1="clr-namespace:Microsoft.VisualBasic;assembly=Microsoft.VisualBasic" 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:s4="clr-namespace:System;assembly=System.Drawing.Design" xmlns:s5="clr-namespace:System;assembly=System.Design" xmlns:s6="clr-namespace:System;assembly=System.Web.Services" 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:scg1="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:sw="clr-namespace:System.Windows;assembly=PresentationFramework" xmlns:sw1="clr-namespace:System.Windows;assembly=WindowsBase" xmlns:sw2="clr-namespace:System.Windows;assembly=PresentationCore" xmlns:sw3="clr-namespace:System.Windows;assembly=UIAutomationTypes" xmlns:swt="clr-namespace:System.Windows.Threading;assembly=WindowsBase" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

     

      <Sequence sap:VirtualizedContainerService.HintSize="352,1579" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">

     

        <Sequence.Variables>

     

          <Variable x:TypeArguments="x:String" Default="http://gisagsdev:6080/arcgis/rest/services/Apps/addressEditting/FeatureServer/0" Name="_AddressFeatureService" />

     

          <Variable x:TypeArguments="esri:FeatureSet" Name="fsAddress" />

     

          <Variable x:TypeArguments="x:String" Name="strAngle" />

     

          <Variable x:TypeArguments="x:String" Name="variable1" />

     

          <Variable x:TypeArguments="esri:Geometry" Name="geom" />

     

          <Variable x:TypeArguments="scg:IList(esri:EditResultItem)" Name="iListUpdateSucess" />

     

          <Variable x:TypeArguments="scg:ICollection(esri:Graphic)" Name="icollGraphics" />

     

          <Variable x:TypeArguments="esri:Graphic" Name="graphic" />

     

          <Variable x:TypeArguments="esri:FeatureSet" Name="featureSet1" />

     

        </Sequence.Variables>

     

        <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:QueryTask sap:VirtualizedContainerService.HintSize="330,227" OutFields="*" OutSpatialReference="[New SpatialReference(102113)]" QueryServiceUrl="[_AddressFeatureService]" Results="[fsAddress]" ReturnGeometry="True" SpatialRelationship="esriSpatialRelIntersects" Where="OBJECTID = 28114" />

     

        <gwa1:Alert sap:VirtualizedContainerService.HintSize="330,82" Text="[fsAddress.ToJson().ToString]" Title="prior to change" />

     

        <gwa1:CommentOut sap:VirtualizedContainerService.HintSize="330,118">

     

          <gwa1:Alert sap:VirtualizedContainerService.HintSize="211,82" Text="[fsAddress.ToJson().ToString]" Title="prior to change" />

     

        </gwa1:CommentOut>

     

        <Assign sap:VirtualizedContainerService.HintSize="330,57">

     

          <Assign.To>

     

            <OutArgument x:TypeArguments="x:Object">[fsAddress.Features(0).Attributes("Angle")]</OutArgument>

     

          </Assign.To>

     

          <Assign.Value>

     

            <InArgument x:TypeArguments="x:Object">[60]</InArgument>

     

          </Assign.Value>

     

        </Assign>

     

        <gwa1:CommentOut sap:VirtualizedContainerService.HintSize="330,118">

     

          <gwa1:Alert sap:VirtualizedContainerService.HintSize="211,82" Text="[fsAddress.ToJson().ToString]" Title="after change" />

     

        </gwa1:CommentOut>

     

        <gwa1:QueryTask sap:VirtualizedContainerService.HintSize="330,227" OutFields="*" OutSpatialReference="[New SpatialReference(102113)]" QueryServiceUrl="[_AddressFeatureService]" Results="[fsAddress]" ReturnGeometry="True" SpatialRelationship="esriSpatialRelIntersects" Where="OBJECTID = 28114" />

     

        <Assign sap:VirtualizedContainerService.HintSize="330,57">

     

          <Assign.To>

     

            <OutArgument x:TypeArguments="x:Object">[fsAddress.Features(0).Attributes("Angle")]</OutArgument>

     

          </Assign.To>

     

          <Assign.Value>

     

            <InArgument x:TypeArguments="x:Object">[60]</InArgument>

     

          </Assign.Value>

     

        </Assign>

     

        <gwa1:UpdateFeatures FeatureLayerUrl="[_AddressFeatureService]" Features="[fsAddress]" sap:VirtualizedContainerService.HintSize="330,105" Results="[iListUpdateSucess]" />

     

        <gwa1:Alert sap:VirtualizedContainerService.HintSize="330,82" Text="[iListUpdateSucess.Item(0).ErrorDescription]" Title="[iListUpdateSucess.Item(0).Success.ToString]" />

     

        <TerminateWorkflow sap:VirtualizedContainerService.HintSize="330,22" Reason="Finished" />

     

      </Sequence>

     

    </Activity>

     

    This is bound not to suit your purposes but the biggest issue is to not do any client side activity from when you first get the featureset that you want to update until after the Update Activity is run due to a serialization to JSON error.

    Have fun

    Ralph

    0
  • Permanently deleted user

    Thanks Ralph for the example. 

    I'll take a look!

    cheers

    Gareth

    0
  • Permanently deleted user

    Ralph,

    looked to PM you but no details - smart!

    but I've tried a version of your worklow with no success..

    I get the dreaded Exception - 'Object Reference not set to an instance of an object'

    I get the count of the featureset selection - in this case only 1, as one objectid is returned, but for some reason, it does not want to run the UpdateFeatures activity... it throws the exception at this very point...

    sorry to be a pain but any thoughts - or anyone @Latititude?

    our local distributor are stumped also ; (

    my 'simple' version of updating...

    <Activity mc:Ignorable="sap" x:Class="{x:Null}" sap:VirtualizedContainerService.HintSize="392,1255" 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: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:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mv1="clr-namespace:Microsoft.VisualBasic;assembly=Microsoft.VisualBasic" 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:s4="clr-namespace:System;assembly=System.Drawing.Design" xmlns:s5="clr-namespace:System;assembly=System.Design" xmlns:s6="clr-namespace:System;assembly=System.Web.Services" 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:scg1="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:sw="clr-namespace:System.Windows;assembly=PresentationFramework" xmlns:sw1="clr-namespace:System.Windows;assembly=WindowsBase" xmlns:sw2="clr-namespace:System.Windows;assembly=PresentationCore" xmlns:sw3="clr-namespace:System.Windows;assembly=UIAutomationTypes" xmlns:swt="clr-namespace:System.Windows.Threading;assembly=WindowsBase" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

     

      <Sequence sap:VirtualizedContainerService.HintSize="352,1215" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">

     

        <Sequence.Variables>

     

          <Variable x:TypeArguments="x:String" Default="http://firemapgc.dse.vic.gov.au/ArcGIS/rest/services/fire_obs_feat/FeatureServer/2" Name="_FeatureService" />

     

          <Variable x:TypeArguments="esri:FeatureSet" Name="fsSelected" />

     

          <Variable x:TypeArguments="x:String" Name="strAngle" />

     

          <Variable x:TypeArguments="x:String" Name="variable1" />

     

          <Variable x:TypeArguments="esri:Geometry" Name="geom" />

     

          <Variable x:TypeArguments="scg:IList(esri:EditResultItem)" Name="iListUpdateSucess" />

     

          <Variable x:TypeArguments="scg:ICollection(esri:Graphic)" Name="icollGraphics" />

     

          <Variable x:TypeArguments="esri:Graphic" Name="graphic" />

     

          <Variable x:TypeArguments="esri:FeatureSet" Name="featureSet1" />

     

          <Variable x:TypeArguments="scg:IEnumerable(esri:Graphic)" Name="fSIEnum" />

     

        </Sequence.Variables>

     

        <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:QueryTask sap:VirtualizedContainerService.HintSize="330,227" OutFields="*" QueryServiceUrl="[_FeatureService]" Results="[fsSelected]" ReturnGeometry="True" SpatialRelationship="esriSpatialRelIntersects" Where="OBJECTID = 2420" />

     

        <gwa1:Alert sap:VirtualizedContainerService.HintSize="330,82" Text="[fsSelected.ToJson().ToString]" Title="prior to change" />

     

        <Assign sap:VirtualizedContainerService.HintSize="330,57">

     

          <Assign.To>

     

            <OutArgument x:TypeArguments="x:Object">[fsSelected.Features(0).Attributes("COMMENTS")]</OutArgument>

     

          </Assign.To>

     

          <Assign.Value>

     

            <InArgument x:TypeArguments="x:Object">["new comment"]</InArgument>

     

          </Assign.Value>

     

        </Assign>

     

        <gwa1:CommentOut sap:VirtualizedContainerService.HintSize="330,118">

     

          <gwa1:Alert sap:VirtualizedContainerService.HintSize="211,82" Text="[fsSelected.ToJson().ToString]" Title="after change" />

     

        </gwa1:CommentOut>

     

        <gwa1:CommentOut sap:VirtualizedContainerService.HintSize="330,118">

     

          <gwa1:Alert sap:VirtualizedContainerService.HintSize="211,82" Text="[fsSelected.Features.Count.ToString]" Title="FS count" />

     

        </gwa1:CommentOut>

     

        <gwa1:UpdateFeatures FeatureLayerUrl="[_FeatureService]" Features="[fsSelected]" sap:VirtualizedContainerService.HintSize="330,105" Results="[iListUpdateSucess]" />

     

        <gwa1:Alert sap:VirtualizedContainerService.HintSize="330,82" Text="[iListUpdateSucess.Item(0).ErrorDescription]" Title="[iListUpdateSucess.Item(0).Success.ToString]" />

     

        <TerminateWorkflow sap:VirtualizedContainerService.HintSize="330,22" Reason="Finished" />

     

      </Sequence>

     

    </Activity>

    thanks again,

    Gareth

    0
  • Permanently deleted user

    Hi Gareth

    comment out the alert just before the assign or use the following:

    <Activity mc:Ignorable="sap" x:Class="{x:Null}" sap:VirtualizedContainerService.HintSize="392,755" 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: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:mv="clr-namespace:Microsoft.VisualBasic;assembly=System" xmlns:mv1="clr-namespace:Microsoft.VisualBasic;assembly=Microsoft.VisualBasic" 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:s4="clr-namespace:System;assembly=System.Drawing.Design" xmlns:s5="clr-namespace:System;assembly=System.Design" xmlns:s6="clr-namespace:System;assembly=System.Web.Services" 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:scg1="clr-namespace:System.Collections.Generic;assembly=System" xmlns:scg2="clr-namespace:System.Collections.Generic;assembly=System.Core" xmlns:scg3="clr-namespace:System.Collections.Generic;assembly=System.ServiceModel" xmlns:sw="clr-namespace:System.Windows;assembly=PresentationFramework" xmlns:sw1="clr-namespace:System.Windows;assembly=WindowsBase" xmlns:sw2="clr-namespace:System.Windows;assembly=PresentationCore" xmlns:sw3="clr-namespace:System.Windows;assembly=UIAutomationTypes" xmlns:swt="clr-namespace:System.Windows.Threading;assembly=WindowsBase" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

     

      <Sequence sap:VirtualizedContainerService.HintSize="352,715" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">

     

        <Sequence.Variables>

     

          <Variable x:TypeArguments="x:String" Default="http://firemapgc.dse.vic.gov.au/ArcGIS/rest/services/fire_obs_feat/FeatureServer/2" Name="_FeatureService" />

     

          <Variable x:TypeArguments="esri:FeatureSet" Name="fsSelected" />

     

          <Variable x:TypeArguments="x:String" Name="strAngle" />

     

          <Variable x:TypeArguments="x:String" Name="variable1" />

     

          <Variable x:TypeArguments="esri:Geometry" Name="geom" />

     

          <Variable x:TypeArguments="scg:IList(esri:EditResultItem)" Name="iListUpdateSucess" />

     

          <Variable x:TypeArguments="scg:ICollection(esri:Graphic)" Name="icollGraphics" />

     

          <Variable x:TypeArguments="esri:Graphic" Name="graphic" />

     

          <Variable x:TypeArguments="esri:FeatureSet" Name="featureSet1" />

     

          <Variable x:TypeArguments="scg:IEnumerable(esri:Graphic)" Name="fSIEnum" />

     

        </Sequence.Variables>

     

        <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:QueryTask sap:VirtualizedContainerService.HintSize="330,227" OutFields="*" QueryServiceUrl="[_FeatureService]" Results="[fsSelected]" ReturnGeometry="True" SpatialRelationship="esriSpatialRelIntersects" Where="OBJECTID = 2420" />

     

        <Assign sap:VirtualizedContainerService.HintSize="330,57">

     

          <Assign.To>

     

            <OutArgument x:TypeArguments="x:Object">[fsSelected.Features(0).Attributes("COMMENTS")]</OutArgument>

     

          </Assign.To>

     

          <Assign.Value>

     

            <InArgument x:TypeArguments="x:Object">["new comment"]</InArgument>

     

          </Assign.Value>

     

        </Assign>

     

        <gwa1:UpdateFeatures FeatureLayerUrl="[_FeatureService]" Features="[fsSelected]" sap:VirtualizedContainerService.HintSize="330,105" Results="[iListUpdateSucess]" />

     

        <gwa1:Alert sap:VirtualizedContainerService.HintSize="330,82" Text="[iListUpdateSucess.Item(0).ErrorDescription]" Title="[iListUpdateSucess.Item(0).Success.ToString]" />

     

      </Sequence>

     

    </Activity>

    By doing that Alert Activity you cause serialisation to occur everything else is occuring on the server. (All state is sent back and forth).

    There is a fault with the ESRI (not Latitude) serialisation to JSON (and back again) that is causing this to occur.

    Thanks

    Ralph

     

    0
  • Permanently deleted user

    Ralph - mate, made my day!

    So I take it then I need to present all client side form items (choices for users) before I get into the show capture geom (selection) --> featureset --> update activities?

    thanks again..

    Gareth

    0
  • Permanently deleted user

    Hi Gareth

    glad that worked for you.

    With one of my workflows where I need to present attributes from the current feature to the user to change (in a form) I:

    1. first get the feature
    2. present to user
    3. get their changes and store in a variable
    4. re-query to get the featureset in a fresh state
    5. update the attributes in the graphics (within the featureset)
    6. run the Update Activity

    A little long-winded but necessary until this "serialization to JSON and back again" fault is resolved.

    Catch you later

    Ralph

    PS Did you want that workflow as well or do those instructions above make enough sense? Off home now but can check for your reply when I get there.

    0
  • Permanently deleted user

    Ralph, 

    I'll keep you posted - about to make a couple of subtle changes and will let you know. If I still have issues I'll take you up on the offer of the xaml...

    again, much appreciated.

    regards

    Gareth

    0
  • Permanently deleted user

    Ralph - can't thank you enough! it's all working, I was having some issues post testing your last post, but I simply re-ran the query to refresh the feature set, as in your step 4 and that made all the difference!

    big big thanks from across the ditch : )

    cheers

    Gareth

     

    EDIT. PS. Ralph.. I'd love to see how you go about the selection process so would you mind posting your xaml?

    0
  • Permanently deleted user

    Hi Gareth

    the xaml for the workflow follows. I do not have any documentation for it as yet so not posting to the code gallery.

    No doubt there are better ways to do some things including the scope of variables etc.

    There are four input args which are set as properties of the workflow via the Geocortex REST Manager

        <x:Property Name="cadastralMapService" Type="InArgument(x:String)" /> 

     

        <x:Property Name="mapServiceUrl" Type="InArgument(x:String)" />

     

        <x:Property Name="addrFeatureService" Type="InArgument(x:String)" />

     

        <x:Property Name="coreTablesService" Type="InArgument(x:String)" />

    cadastralMapService = map service that the parcel layer is in. Value is the id of the mapservice in the site.xml eg 1

    addrFeatureService = feature service of the address layer being edited eg 3

    coreTablesService = map service that includes a number of tables published as Query Layers that will be a source of attributes for the address points eg 4

    mapServiceUrl = doesn't need to be an input arg but is used in several places. Since starting to write this I have change it to a variable in the workflow but the xaml below does not show that change. Anyway it ends up getting set to the actual URL of the cadastralMapService

    It is working in our production environment for our person who maintains our address points (and me when I had cause do some the other day)

    Let me know if you have any questions or need further explanation

    Thanks

    Ralph

     

    (http://data.latitudegeo.com/community/userfiles/rprice/editFeature.zip) Workflow

    0

Du måste logga in om du vill lämna en kommentar.