Getting workflow results into custom module
Does anyone know if it's possible to call a workflow from a custom module and have the results returned to the custom module rather than displayed in the default workflow container?
Specifically, I've got a custom module displayed in the data region that defines several radio/checkboxes for various filter options. I execute the command RunWorkflowWithArguments to apply a layer definition to filter the map results and then query the map service to get a list of all the filtered results. However, the SelectFeatures workflow activity displays in the same data region, replacing my custom form. I want to display the results below my form instead of it being replaced by the results.
My thinking was to try and simply return the featureset to the custom module and add the results below the form. Alternatively though, is it possible to define a new region within my custom module and somehow tell the workflow to put the results in the new region?
Any thoughts/idea/samples would be greatly appreciated.
0
-
Starting a workflow from your module is trivial: this.app.command("RunWorkflowWithArguments").execute(...);To get information from the workflow back to your module, you could either implement an external command in your module, which is called by the workflow, or wait for the workflow to finish by listening to the WorkflowCompletedEvent:this.app.event("WorkflowCompletedEvent").subscribe(this, (workflow: geocortex.essentials.Workflow, outputs: any) => { if (workflow.id === "myWorkflowId") { // parse outputs } });The event handler has two arguments, the workflow that was finshed, and the outputs. You have to check if that workflow is the one you're interested in.
If the workflow fails, this event is not raised (IIRC), so you may need to listen to the WorkflowAbortedEvent event too, if your code relies on the workflow to finish.
The SelectFeatures activity does not have a Container Name property, so I doubt you can display it in a region other than the one defined in your viewer's configuration (i.e. desktop.json.js). A workaround would be to have the results shown in table format, this will show them below the map instead of to the left of it. To do this, call the SwitchToTabularResultsView external command from your workflow.0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
1 kommentar