Question

Failure of Server Workspace Run not signaled back to submitting workspace

  • 3 May 2018
  • 1 reply
  • 0 views

Badge

I have a very simple server workspace copying a table from one database to another using the dynamic workflow:

This workspace is uploaded on the server and gets triggered from a job submitting workspace in FME desktop:

which should signal success or failure through messages.

Strange enough, when I submit a non existing table to be copied, the submitter signals success, while the server log shows:

Error executing SQL command ('select * from "gsm"."odt99" where false limit 0'): 'ERROR: relation "gsm.odt99" does not exist

What is wrong here?

Or, more precisely, how can I get such an error reported back to the job submitter?


1 reply

Userlevel 2
Badge +17

Hi @dollargis, I was able to reproduce the same situation as yours. I feel it's strange that FME would consider the translation has succeeded even if the reader failed.

A workaround I can think of is, to determine if the specified table exists with a SQL statement (SQLCreator or SQLExecutor), and then abort (i.e. force failure) the translation with a Terminator if the table didn't exist.

For example, this SQL statement for PostgreSQL/PostGIS database returns t (true) if specified table exists, f (false) otherwise. Assuming that schema name and table name are specified through user parameters called SCHEMA and TABLE. If you execute this statement with a SQLCreator/Executer, it outputs a feature contains an attribute called exists which stores t or f.

select exists (
    select * 
    from information_schema.tables 
    where table_schema = '$(SCHEMA)'
        and table_name = '$(TABLE)'
)

0684Q00000ArK8wQAF.png

Reply