File picker and Read file bytes activities
I am trying to make the File Picker and Read Bytes activities work together so that I can allow a user to upload a shapefile and then use the data in it for further analysis. I might be on completely the wrong track but this is what made sense to me.
I have a client side workflow that allows them to pick the files and then I invoke a server side workflow to use the Read File Bytes activity. I pass the array of Files to the server side workflow from the client and then use the the Get Workflow Inputs. When I look at the trace log for the server, however, I see the array of 6 files selected (and my other argument 'Temp Folder' which is populate) but it looks like it was passed as a string and all of the entries are empty. It looks like this:
"results": [
{
"$type": "JobTraceLog",
"start": "2019-03-19T17:40:50.5895267Z",
"end": "2019-03-19T17:40:50.5979264Z",
"traces": [
"Starting Server Side Workflow to Get Shapefile",
"Temp Folder: a97c371c-ab0d-433a-82ea-fac72850a278",
"[",
" {},",
" {},",
" {},",
" {},",
" {},",
" {}",
"]",
"Input File: null",
"Error: 0: Unexpected Error: Geocortex.Workflow.Runtime.Execution.Exceptions.ActivityExecutionException: [WF: Activity execution error] Failed to execute activity 52 with action gcx:wf:server::ReadFileBytes: [WF: Activity input error] Input path was invalid. Expected type string ---> Geocortex.Workflow.Runtime.ActivityInputException: [WF: Activity input error] Input path was invalid. Expected type string",
" at Geocortex.Workflow.Runtime.Utils.ActivityInputUtils.EnsureStringStrict(IDictionary`2 inputs, String input)",
" at Geocortex.Workflow.Server.Activities.ReadFileBytes.Execute(IDictionary`2 inputs, IActivityContext context)",
" at Geocortex.Workflow.Runtime.Execution.ActivityContext.ExecuteActivityHandler(IActivityHandler handler, IDictionary`2 inputs)",
" --- End of inner exception stack trace ---",
" at Geocortex.Workflow.Runtime.Execution.ActivityContext.ExecuteActivityHandler(IActivityHandler handler, IDictionary`2 inputs)",
" at Geocortex.Workflow.Runtime.Execution.ActivityContext.ExecuteFinish(IActivityHandler handler, IDictionary`2 inputs)",
" at Geocortex.Workflow.Runtime.Execution.ActivityContext.ExecuteStart()",
" at Geocortex.Workflow.Runtime.Execution.AmbientState.ExecuteCurrentContext()",
" at Geocortex.Workflow.Runtime.Execution.AmbientState.Execute()",
" at Geocortex.Workflow.Runtime.Execution.Engine.Run(Program program, RunOptions options)",
" at Geocortex.Workflow.Hosts.Server.Host.RunWorkflow(String workflowJson, IDictionary`2 inputs, IDictionary`2 trivia, CancellationToken cancellationToken)",
" at Geocortex.Workflow.Server.Foundation.WorkflowRunner.ProcessAsync(Object content)"
]
The error is the Read File Bytes activity failing obviously due to no input information.
Is what I am trying to accomplish possible?
Is there another way to approach this without getting into developing a custom activity?
I'd prefer to not use third party solutions that I have seen posted.
thanks in advance for any input.
Anthony
-
I ended up doing 2 things to make a solution. I'm not entirely happy with it though, as it has got more separate parts than I would like and implementing becomes trickier.
1) I wrote a client side custom activity for streaming the shapefile parts into byte data (in-memory). The SDK was easy to get started with.
2) I used a simple Workflow 4 activity to take the byte data I got from the shapefile (for prj,shp,dbf) and converted to a featureset using the ShapefileToFeatureSet activity. I passed this back to my WF5 workflow as JSON and continued my processing.
I would be curious to know if Latitude is intending to develop more of the server side activities to bring workflow 5 to a similar functionality that is in 4. I.e. the ShapefileToFeatureSet activity would be useful.
0 -
Hi Anthony,
Could you post the ShapefileToFeatureSet activity suggestion to the Ideas page? https://communities.geocortex.com/s/ideas
The server part of workflow 5 is still very young, so feedback about the activity selection is useful.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
2 Kommentare