Solved

Data Download Service in Server App with a FME Job Submitter


Badge

I have an FME Server App configured to run a workspace. That workspace may run an FME Job Submitter that runs another workspace. The second workspace has a data download service on it.

 

How can I get the App to access the data that is made available from the second workspace triggered by the Data Download service?

icon

Best answer by hollyatsafe 2 June 2021, 23:10

View original

4 replies

Badge +2

Hi @rchoucroun​ ,

The FMEServerJobSubmitter transformer submits jobs using the REST API, so it does not make use of any of the transformation services and won't run the workspace under the data download service.

 

In your Server App workspace, do you need to read in the data for further processing or do you want to return the data download URL as part of the app response?

 

Badge

Hi @rchoucroun​ ,

The FMEServerJobSubmitter transformer submits jobs using the REST API, so it does not make use of any of the transformation services and won't run the workspace under the data download service.

 

In your Server App workspace, do you need to read in the data for further processing or do you want to return the data download URL as part of the app response?

 

I would like to return the data download as part of the app response, if possible.

Badge +2

I would like to return the data download as part of the app response, if possible.

Hi @rchoucroun​ ,

If possible I would recommend combining the two workspaces so that the output is being written directly in the first workspace which can then make use of the Data Download Service, this would likely be the simplest approach.

 

However if that is not an option I would suggest:

  1. Open the Run Workspace page in FME Server, and point it to the workspace you are currently submitting in the FMEServerJobSubmitter, do not run the workspace, instead in the top right-hand corner select Workspace Actions > Create Webhook
  2. Once the Webhook is created copy the URL under the heading 'Authorization with Query String'. This generates a URL that will allow you to submit the job via the Data Download service rather than REST
  3. In your workspace replace the FMEServerJobSubmitter Transformer with a HTTPCaller, set the Request URL to the URL created in step 2, and set the HTTP Method to Post.
  4. When you run this workspace, the output from the HTTPCaller will be a response_body attribute, this will contain the HTML response that you would get if you run the URL directly in the web browser, and it includes the data download URL.
  5. Update the response body attribute to have the name html_content and then connect an HTML Writer to the workspace.
  6. Publish the workspace under the Data Streaming Service, now when it is run as the server app, the response from the nested workspace will be returned in the UI.

 

The ability to chain workspaces in Server Apps is something that our team is currently investigating, so I'll be sure to add this use case to their notes and hopefully, this is something we can make easier in the future.

 

Badge

I would like to return the data download as part of the app response, if possible.

Thanks. That's a good idea.

Reply