Let end users decide whether to trigger a second workspace based on results form first workspace?
Hi, I’m looking for the best way to let end users decide whether to trigger a second workspace based on result (html data stream service) from first workspace. Is it possbile at all using eg. an automation app? If possible I also want to make use of the same parameters in both workspaces to make sure the geographic extent is the same.
My case is that workspace 1 runs some calculations to get costs. These costs need to be accepted by end user (Yes/No) before ruinning next workspace which produces som files. If possible I want to make use of the same parameters in both workspaces since it should make use om the same geographic extent.
Thanks for any ideas
Page 1 / 1
The two workspaces are separate flows.
The first flow is activated by a flow app, and creates some HTML output, that includes a link to a second flow app.
The second flow app starts the second workspace.
The user chooses whether to activate the link in the first output (as in “yes” to start it).
Parameters can be included in the link, if this is necessary.
Thanks @lifalin2016, sounds promising that you can include the parameters! Will give it a try.
Alas, I may have been too hasty in promising parameters.
I was sure that it worked, but my simple workspace doesn’t adhere to my expectations :-(
I’ll do some tests.
But having the output of one flow trigger another is solid.
And you can define a flow (e.g. the secondary) to start immidiatedly without waiting for user input.
Alas, I may have been too hasty in promising parameters.
I was sure that it worked, but my simple workspace doesn’t adhere to my expectations :-(
I’ll do some tests.
But having the output of one flow trigger another is solid.
And you can define a flow (e.g. the secondary) to start immidiatedly without waiting for user input.
Unfortunately it doesn’t seem like flow apps take parameters directly. It would have been great if they did.
But you could store some sort of a random transaction number/GUID in a file or database table server-side, advise the user of this number, and have him enter it into the second flow app as an “acceptance token”, and use it to retrieve associated data.
Not great, but doable.
Hi @albjoh ,
Another option could be using a Flow app for the first workspace and using a webhook URL to run the second workspace.
This article has a similar concept of a workspace app writing out an HTML file and there’s a button to run the workspace again with Data Download service and takes in the same parameter that was selected in the Flow app.
Tried your solution but can’t seem to get my parameter to follow along into the data download phase where it is omitted in the url. The data streaming works but the ‘second run’ of the workspace ends in picture below. Can you think of any reason for this? I’m writing DWG rather than excel and the workspace is a bit more complex than your example, but can’t see why it should not work.
@keziaatsafe Here is a more clear error message maybe:
I’ve created a workspace with a Python Script that you can use if that’s helpful.
Thanks @siennaatsafe
I’m not sure how to use provided Python API, sorry. However, I did manually encode the url into an identical string as the “Authorization with Query String” received when creating the webhook in Flow.
I tried to use “Authorization with Query String” as it is, for testing, just running it in a browser and it returns success as in below, but without any .zip for download:
But in the job-logs I get this message, which is why no .zip is provided I guess:
This is my url end up after encoding (excluding base url):
In your workspace, can you add a logger, to log the geometry parameter and run the job again?
What I’d like to see if how that parameter is being interpreted, I’m assuming it’s not being decoded by FME. So the Geometry replacer is trying to interpret:
If that is the case, you can use a TextDecoder to the parameter before the GeometryReplacer. Set the Encoding Type to URL Encoded, in the TextDecoder. Then, feed the decoded value to the GeometryReplacer.
Hi @siennaatsafe
The workspace runs two times one via the app (datastreaming) and second via webhook (download). in the first run the logger gives expected geojson string:
Tried using a textdecoder to apply if not geojson format in GeomParam, but still got the same error. Also tried another approach using a parameter for users to supply a shp-file instead of drawing (geojson). Still got the same behaviour.
Hi @albjoh,
It’s likely easiest if we get on a call to discuss. Can you send me an email I’m at sienna.emery@safe.com then, I can send you a link to set up a call. Thanks!